Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #73 from labs13-connect-kids/production
Browse files Browse the repository at this point in the history
Production
  • Loading branch information
tlinehan authored Jul 10, 2019
2 parents a622c27 + 8be4b0a commit a8f55be
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 160 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .expo-shared/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"6bb3206b0acf2dcc4ac643efea102f020eab6923127f40db56165b27b151e9b9": true,
"d490dcf018953a1e713d87b14430562cb9669b0e0e6151e5757fdb32aaff504c": true,
"e9676a094e81d5e8ef64e6e385163269b285fffdaf75e53c9d5c241f97f10183": true,
"9c9be79f7d164ef23d16ee23a18024ff1e66a73cfe2af5a0b0c18bae8cd1165c": true
"9c9be79f7d164ef23d16ee23a18024ff1e66a73cfe2af5a0b0c18bae8cd1165c": true,
"2ab101a72efbaae7dc5ff3163940a95f8569c0761f22b5a0c6ab7f31e961754b": true
}
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"privacy": "public",
"sdkVersion": "33.0.0",
"platforms": ["ios", "android", "web"],
"version": "1.0.5",
"version": "1.0.6",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
Expand All @@ -24,7 +24,7 @@
},
"android": {
"package": "com.connectOurKids.connectOurKids",
"versionCode": 2
"versionCode": 3
}
}
}
Binary file modified assets/logoSmall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions connectOurKids_upload_cert.pem

This file was deleted.

33 changes: 15 additions & 18 deletions src/components/Messages/ErrorMessage.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';
import { Linking, Text, TouchableHighlight, View } from 'react-native';
import { Linking, Text, View } from 'react-native';
import {
isName,
isEmail,
isAddress,
isPhone,
isUrl,
isCityState
} from '../../helpers/inputValidators';

const handleOpenEmail = () => {
Expand All @@ -24,7 +23,6 @@ const handleOpenEmail = () => {
};

const ErrorMessage = (props) => {

renderMessage = () => {
if (props.data.inputKey && props.data.inputValue) {
if (props.data.inputKey === "name") {
Expand Down Expand Up @@ -57,45 +55,44 @@ const ErrorMessage = (props) => {
console.log('fetching...')
}


if (props.query) {
// const name = props.query.names[0]["display"];
// const email = props.query.emails[0]["address"];
// const address = props.query.addresses[0]["display"];
// const phone = props.query.phones[0]["number"];
if (props.query.names) {
// if (isName(props.query.names[0].display)) {
if (isName(props.query.names[0]["display"])) {
// if (isName(props.query.names[0]["display"])) {
if (props.query.names[0]["display"]) {
return <Text>Sorry, no results were found for your search. Check the spelling and try again. </Text>
}
}
else if (props.query.emails) {
if (isEmail(props.query.emails[0]["address"])) {
// if (isEmail(props.query.emails[0]["address"])) {
if (props.query.emails[0]["address"]) {
return <Text>Sorry, no results were found for your search. Check the spelling and try again.</Text>
}
}

else if (props.query.addresses) {
if (isAddress(props.query.addresses[0]["display"])) {
// if (isAddress(props.query.addresses[0]["display"])) {
if (props.query.addresses[0]["display"]) {
return (<Text style={{ color: '#856404' }}>There was an error during the search. Please try again later, or <Text style={{ color: '#508db3' }} onPress={handleOpenEmail}>Contact Support.</Text>
</Text>)
}
}
else if (props.query.phones) {
if (isPhone(props.query.phones[0]["number"])) {
// if (isPhone(props.query.phones[0]["number"])) {
if (props.query.phones[0]["number"]) {
return (<Text style={{ color: '#856404' }}>There was an error during the search. Please try again later, or <Text style={{ color: '#508db3' }} onPress={handleOpenEmail}>Contact Support.</Text>
</Text>)
}
}
else if (isUrl(props.query.urls[0]["@source_id"])) {
return <Text style={{ color: '#856404' }}>There was an error during the search. Please try again later, or <Text style={{ color: '#508db3' }} onPress={handleOpenEmail}>Contact Support.</Text>
</Text>
}
// else if (isUrl(props.query.urls[0]["@source_id"])) {
// return <Text style={{ color: '#856404' }}>There was an error during the search. Please try again later, or <Text style={{ color: '#508db3' }} onPress={handleOpenEmail}>Contact Support.</Text>
// </Text>
// }
}
else{
else {
console.log("ERROR in ErrorMessage.js")
}
}

return (
<View style={{ backgroundColor: '#fff3cd', padding: 15 }}>
{this.renderMessage()}
Expand Down
20 changes: 11 additions & 9 deletions src/components/Person/PersonInfoRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const PersonInfoRow = ({
</Text>
</TouchableOpacity>
);
} else if (isLoggedIn && itemKey === 'relationships') {
} else if (itemKey === 'relationships') {
return (
<TouchableOpacity
style={styles.colListContainer}
Expand All @@ -124,7 +124,9 @@ const PersonInfoRow = ({
}
>
<Text style={styles.colListText}>
{renderMaskedOrResult(key[itemValue][0].display, itemKey)}
{isLoggedIn
? renderMaskedOrResult(key[itemValue][0].display, itemKey)
: '**** ********* **'}
</Text>
</TouchableOpacity>
);
Expand All @@ -147,12 +149,12 @@ const PersonInfoRow = ({
{key['@last_seen'].split('-')[0]}
</Text>
) : (
key['@valid_since'] && (
<Text style={styles.colListLabelText}>
{key['@valid_since'].split('-')[0]}
</Text>
)
)}
key['@valid_since'] && (
<Text style={styles.colListLabelText}>
{key['@valid_since'].split('-')[0]}
</Text>
)
)}
</TouchableOpacity>
);
}
Expand All @@ -173,4 +175,4 @@ const mapStateToProps = state => {
export default connect(
mapStateToProps,
{ resetState, showModal }
)(PersonInfoRow);
)(PersonInfoRow);
40 changes: 0 additions & 40 deletions src/components/SearchForm/InputDisplay.js

This file was deleted.

79 changes: 11 additions & 68 deletions src/components/SearchForm/SearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
isAddress,
isPhone,
isUrl,
isCityState
} from '../../helpers/inputValidators';
import { parseAddress, parseCityState, parseName } from '../../helpers/parsers';
import { connect } from 'react-redux';
Expand All @@ -26,7 +25,6 @@ class SearchForm extends Component {
address: '',
phone: '',
url: '',
inputValidate: true,
tabPage: 0
};

Expand Down Expand Up @@ -70,23 +68,6 @@ class SearchForm extends Component {
}
this.setState({ [name]: value });

if (name === 'name') {
if (this.state.name) {
this.setState({ inputValidate: isName(value) });
}
} else if (name === 'cityState') {
if (this.state.cityState) {
this.setState({ inputValidate: isCityState(value) });
}
} else if (name === 'email') {
this.setState({ inputValidate: isEmail(value) });
} else if (name === 'address') {
this.setState({ inputValidate: isAddress(value) });
} else if (name === 'phone') {
this.setState({ inputValidate: isPhone(value) });
} else if (name === 'url') {
this.setState({ inputValidate: isUrl(value) });
}
};

handleFormSubmit = () => {
Expand Down Expand Up @@ -228,13 +209,7 @@ class SearchForm extends Component {
});
};

// toggleCityStateInput = (data) => {
// console.log(data.i)
// this.setState({ showCityStateInput: data.i == 0 ? true : false, tabPage: data.i });
// }

render() {
// console.log('IN RENDER', this.props);
return (
<View style={{ marginBottom: 20 }}>
<Tabs
Expand All @@ -254,35 +229,19 @@ class SearchForm extends Component {
<View style={styles.nameInputFullWidth}>
<Input
placeholder="First and last, middle optional"
style={[
styles.textInput,
!this.state.inputValidate ? styles.error : null
]}
style={styles.textInput}
value={this.state.name}
onChangeText={text => this.inputHandler('name', text)}
/>
<View>
<Input
placeholder="City, State"
// style={styles.textInput}
style={[
styles.textInput,
!this.state.inputValidate ? styles.error : null
]}
value={this.state.cityState}
onChangeText={text => this.inputHandler('cityState', text)}
/>
<Input
placeholder="City, State"
style={styles.textInput}
value={this.state.cityState}
onChangeText={text => this.inputHandler('cityState', text)}
/>
</View>
</View>
{/*this.state.showCityStateInput ?
<InputDisplay
inputValidate={this.state.inputValidate}
name={this.state.name}
cityState={this.state.cityState}
inputHandlerName={text => this.inputHandler('name', text)}
inputHandlerCityState={text => this.inputHandler('cityState', text)}
/>
: styles.displayNoneInput*/}
</Tab>

<Tab
Expand All @@ -296,10 +255,7 @@ class SearchForm extends Component {
<View>
<Input
placeholder="Email address"
style={[
styles.textInput,
!this.state.inputValidate ? styles.error : null
]}
style={styles.textInput}
value={this.state.email}
onChangeText={text => this.inputHandler('email', text)}
/>
Expand All @@ -316,10 +272,7 @@ class SearchForm extends Component {
<View>
<Input
placeholder="Mailing address"
style={[
styles.textInput,
!this.state.inputValidate ? styles.error : null
]}
style={styles.textInput}
value={this.state.address}
onChangeText={text => this.inputHandler('address', text)}
/>
Expand All @@ -336,10 +289,7 @@ class SearchForm extends Component {
<View>
<Input
placeholder="Phone any format, no letters"
style={[
styles.textInput,
!this.state.inputValidate ? styles.error : null
]}
style={styles.textInput}
value={this.state.phone}
onChangeText={text => this.inputHandler('phone', text)}
/>
Expand All @@ -356,10 +306,7 @@ class SearchForm extends Component {
<View>
<Input
placeholder="Social profile link or any URL"
style={[
styles.textInput,
!this.state.inputValidate ? styles.error : null
]}
style={styles.textInput}
value={this.state.url}
onChangeText={text => this.inputHandler('url', text)}
/>
Expand All @@ -374,10 +321,6 @@ class SearchForm extends Component {
<Button style={styles.greyButton} onPress={this.startOver}>
<Text style={styles.buttonText}> Start Over </Text>
</Button>

{/* <Button info style={styles.greyButton} onPress={this.getData}>
<Text style={styles.buttonText}> get object </Text>
</Button> */}
</View>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/inputValidators.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ export const isUrl = url => {
return !!pattern.test(url);
}
return false;
};
};

0 comments on commit a8f55be

Please sign in to comment.