Skip to content
Snippets Groups Projects
Commit eedd6070 authored by Julia Friesel's avatar Julia Friesel
Browse files

Make temperature suggestion grey

parent e9c42566
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,7 @@ export default class Temp extends Component { ...@@ -45,6 +45,7 @@ export default class Temp extends Component {
const [integer, fractional] = prevTemp.toString().split('.') const [integer, fractional] = prevTemp.toString().split('.')
this.state.integer = integer this.state.integer = integer
this.state.fractional = fractional this.state.fractional = fractional
this.state.isSuggestion = true
} }
} }
} }
...@@ -58,6 +59,7 @@ export default class Temp extends Component { ...@@ -58,6 +59,7 @@ export default class Temp extends Component {
integer={this.state.integer} integer={this.state.integer}
fractional={this.state.fractional} fractional={this.state.fractional}
setState={(val) => this.setState(val)} setState={(val) => this.setState(val)}
isSuggestion={this.state.isSuggestion}
/> />
</View> </View>
<View style={styles.symptomViewRowInline}> <View style={styles.symptomViewRowInline}>
...@@ -125,6 +127,7 @@ class TempInputPair extends Component { ...@@ -125,6 +127,7 @@ class TempInputPair extends Component {
integer={this.props.integer} integer={this.props.integer}
fractional={this.props.fractional} fractional={this.props.fractional}
setState={this.props.setState} setState={this.props.setState}
isSuggestion={this.props.isSuggestion}
/> />
<Text style={styles.temperatureTextInput}>.</Text> <Text style={styles.temperatureTextInput}>.</Text>
<TempInput <TempInput
...@@ -132,6 +135,7 @@ class TempInputPair extends Component { ...@@ -132,6 +135,7 @@ class TempInputPair extends Component {
integer={this.props.integer} integer={this.props.integer}
fractional={this.props.fractional} fractional={this.props.fractional}
setState={this.props.setState} setState={this.props.setState}
isSuggestion={this.props.isSuggestion}
/> />
</View> </View>
) )
...@@ -151,12 +155,16 @@ class TempInput extends Component { ...@@ -151,12 +155,16 @@ class TempInput extends Component {
} }
render() { render() {
const style = [styles.temperatureTextInput]
if (this.props.isSuggestion) {
style.push(styles.temperatureTextInputSuggestion)
}
return ( return (
<TextInput <TextInput
style={styles.temperatureTextInput} style={style}
onChangeText={(val) => { onChangeText={(val) => {
if (isNaN(Number(val))) return if (isNaN(Number(val))) return
this.props.setState({ [this.props.type]: val }) this.props.setState({ [this.props.type]: val, isSuggestion: false })
}} }}
keyboardType='numeric' keyboardType='numeric'
value={this.props[this.props.type]} value={this.props[this.props.type]}
......
...@@ -66,7 +66,11 @@ export default StyleSheet.create({ ...@@ -66,7 +66,11 @@ export default StyleSheet.create({
marginBottom: 15 marginBottom: 15
}, },
temperatureTextInput: { temperatureTextInput: {
fontSize: 20 fontSize: 20,
color: 'black'
},
temperatureTextInputSuggestion: {
color: '#939393'
}, },
actionButtonRow: { actionButtonRow: {
flexDirection: 'row', flexDirection: 'row',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment