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

Use style arrays

parent a3c02d30
No related branches found
No related tags found
No related merge requests found
...@@ -187,24 +187,20 @@ class SymptomBox extends Component { ...@@ -187,24 +187,20 @@ class SymptomBox extends Component {
const d = this.props.data const d = this.props.data
const boxActive = d ? styles.symptomBoxActive : {} const boxActive = d ? styles.symptomBoxActive : {}
const iconActive = d ? iconStyles.symptomBoxActive : {} const iconActive = d ? iconStyles.symptomBoxActive : {}
const iconStyle = Object.assign({}, iconStyles.symptomBox, iconActive, disabledStyle)
const textActive = d ? styles.symptomTextActive : {} const textActive = d ? styles.symptomTextActive : {}
const disabledStyle = this.props.disabled ? styles.symptomInFuture : {} const disabledStyle = this.props.disabled ? styles.symptomInFuture : {}
const symptomBoxStyle = Object.assign({}, styles.symptomBox, boxActive, disabledStyle)
const iconStyle = Object.assign({}, iconStyles.symptomBox, iconActive, disabledStyle)
const symptomDataBoxStyle = Object.assign({}, styles.symptomDataBox, disabledStyle)
const textStyle = Object.assign({}, textActive, disabledStyle)
return ( return (
<TouchableOpacity onPress={this.props.onPress} disabled={this.props.disabled}> <TouchableOpacity onPress={this.props.onPress} disabled={this.props.disabled}>
<View style={symptomBoxStyle}> <View style={[styles.symptomBox, boxActive, disabledStyle]}>
<Icon <Icon
name='thermometer' name='thermometer'
{...iconStyle} {...iconStyle}
/> />
<Text style={textStyle}>{this.props.title}</Text> <Text style={[textActive, disabledStyle]}>{this.props.title}</Text>
</View> </View>
<View style={symptomDataBoxStyle}> <View style={[styles.symptomDataBox, disabledStyle]}>
<Text style={styles.symptomDataText}>{this.props.data}</Text> <Text style={styles.symptomDataText}>{this.props.data}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
......
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