diff --git a/mobile/android/gradle.properties b/mobile/android/gradle.properties index 521cf00..67fb837 100644 --- a/mobile/android/gradle.properties +++ b/mobile/android/gradle.properties @@ -18,4 +18,6 @@ # org.gradle.parallel=true android.useDeprecatedNdk=true -# android.enableAapt2=false + +# See https://github.com/react-navigation/react-navigation/issues/3097 +android.enableAapt2=false diff --git a/mobile/src/config.js b/mobile/src/config.js index 6c22756..f5e926f 100644 --- a/mobile/src/config.js +++ b/mobile/src/config.js @@ -8,25 +8,25 @@ export const config = { googleGeocodeAPIKey: "AIzaSyCs4JVT6gysnY5dAJ7KjVJYeykLv_xz1GI", googleGeocodeURL: "https://maps.googleapis.com/maps/api/geocode/json", refererURL: "https://dar.kss.us.com", - //defaultUser: "john@lyon-smith.org", - defaultUser: "", + defaultUser: "john@lyon-smith.org", + //defaultUser: "", //minGPSAccuracy: 50, minGPSAccuracy: 20, minDistanceToItem: 10, geocodeDelayMilliseconds: 500, // This region is downtown Toronto - initialRegion: { - latitude: 43.653908, - longitude: -79.384293, - latitudeDelta: 0.0922, - longitudeDelta: 0.0421, - }, - // This region is Bainbridge Island // initialRegion: { - // latitude: 47.629536, - // longitude: -122.524162, + // latitude: 43.653908, + // longitude: -79.384293, // latitudeDelta: 0.0922, // longitudeDelta: 0.0421, // }, + // This region is Bainbridge Island + initialRegion: { + latitude: 47.629536, + longitude: -122.524162, + latitudeDelta: 0.0922, + longitudeDelta: 0.0421, + }, // alwaysShowWorkItemInAR: true, } diff --git a/mobile/src/ui/BoundInput.js b/mobile/src/ui/BoundInput.js index 97a2788..5f7f1f9 100644 --- a/mobile/src/ui/BoundInput.js +++ b/mobile/src/ui/BoundInput.js @@ -24,6 +24,7 @@ export class BoundInput extends React.Component { const { name, binder } = this.props this.state = binder.getFieldState(name) + this.handleChangeText = this.handleChangeText.bind(this) } componentWillReceiveProps(nextProps) { @@ -32,12 +33,12 @@ export class BoundInput extends React.Component { } } - @autobind + // @autobind : There seems to be a bug with using this here, so we just do it the old way handleChangeText(newText) { - if (this && this.props && this.props.binder) { - this.setState( - this.props.binder.updateFieldValue(this.props.name, newText) - ) + const { binder, name } = this.props + + if (binder) { + this.setState(binder.updateFieldValue(name, newText)) } } diff --git a/mobile/src/ui/BoundText.js b/mobile/src/ui/BoundText.js deleted file mode 100644 index b1e2521..0000000 --- a/mobile/src/ui/BoundText.js +++ /dev/null @@ -1,68 +0,0 @@ -import React from "react" -import PropTypes from "prop-types" -import { View, Text, TouchableHighlight } from "react-native" -import autobind from "autobind-decorator" - -export class BoundText extends React.Component { - static propTypes = { - name: PropTypes.string.isRequired, - label: PropTypes.string, - value: PropTypes.string, - binder: PropTypes.object.isRequired, - } - - constructor(props) { - super(props) - - const { name, binder } = this.props - - binder.addListener(name, this.updateValue) - this.state = binder.getFieldState(name) - } - - @autobind - updateValue(e) { - this.setState(e.state) - } - - componentWillUnmount() { - this.props.binder.removeListener(this.props.name, this.updateValue) - } - - componentWillReceiveProps(nextProps) { - if (nextProps.binder !== this.props.binder) { - this.props.binder.removeListener(this.props.name, this.updateValue) - nextProps.binder.addListener(nextProps.name, this.updateValue) - this.setState(nextProps.binder.getFieldState(nextProps.name)) - } - } - - render() { - const { name, label, value } = this.props - const { visible, disabled } = this.state - - if (!visible) { - return null - } - - return ( - - - {label} - - - {value} - - - ) - } -} diff --git a/website/src/Profile/Profile.js b/website/src/Profile/Profile.js index 20f8a83..0b79bce 100644 --- a/website/src/Profile/Profile.js +++ b/website/src/Profile/Profile.js @@ -9,14 +9,9 @@ import { } from "../Modal" import { Column, Row } from "ui" import { sizeInfo } from "ui/style" -import PropTypes from "prop-types" import autobind from "autobind-decorator" export class Profile extends Component { - static propTypes = { - changeTitle: PropTypes.func.isRequired, - } - constructor(props) { super(props) diff --git a/website/src/index.js b/website/src/index.js index 3433880..90f496e 100644 --- a/website/src/index.js +++ b/website/src/index.js @@ -8,8 +8,8 @@ ReactDOM.render( document.getElementById('root') ) -// HACK: See https://github.com/facebook/react/issues/5619 -let css = document.createElement('style') +// HACK: Setting placeholder color. See https://github.com/facebook/react/issues/5619 +let css = document.createElement("style") document.body.appendChild(css) css.innerHTML = `::-webkit-input-placeholder { color: ${colorInfo.textPlaceholder} }`