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

Use realistic icon and set active state

parent fae27843
No related branches found
No related tags found
No related merge requests found
components/cycle-day/assets/placeholder.png

4.67 KiB

...@@ -2,11 +2,11 @@ import React, { Component } from 'react' ...@@ -2,11 +2,11 @@ import React, { Component } from 'react'
import { import {
View, View,
Text, Text,
Image,
TouchableOpacity, TouchableOpacity,
Dimensions Dimensions
} from 'react-native' } from 'react-native'
import styles from '../../styles' import Icon from 'react-native-vector-icons/FontAwesome'
import styles, { iconStyles } from '../../styles'
import { import {
bleeding as bleedingLabels, bleeding as bleedingLabels,
mucusFeeling as feelingLabels, mucusFeeling as feelingLabels,
...@@ -25,44 +25,37 @@ export default class DayView extends Component { ...@@ -25,44 +25,37 @@ export default class DayView extends Component {
<View style={styles.symptomBoxesView}> <View style={styles.symptomBoxesView}>
<SymptomBox <SymptomBox
title='Bleeding' title='Bleeding'
icon={require('./assets/placeholder.png')} onPress={() => this.props.showView('BleedingEditView')}
onPress={() => this.showView('BleedingEditView')}
data={getLabel('bleeding', cycleDay.bleeding)} data={getLabel('bleeding', cycleDay.bleeding)}
/> />
<SymptomBox <SymptomBox
title='Temperature' title='Temperature'
icon={require('./assets/placeholder.png')} onPress={() => this.props.showView('TemperatureEditView')}
onPress={() => this.showView('TemperatureEditView')}
data={getLabel('temperature', cycleDay.temperature)} data={getLabel('temperature', cycleDay.temperature)}
/> />
<SymptomBox <SymptomBox
title='Mucus' title='Mucus'
icon={require('./assets/placeholder.png')} onPress={() => this.props.showView('MucusEditView')}
onPress={() => this.showView('MucusEditView')}
data={getLabel('mucus', cycleDay.mucus)} data={getLabel('mucus', cycleDay.mucus)}
/> />
<SymptomBox <SymptomBox
title='Cervix' title='Cervix'
icon={require('./assets/placeholder.png')} onPress={() => this.props.showView('CervixEditView')}
onPress={() => this.showView('CervixEditView')}
data={getLabel('cervix', cycleDay.cervix)} data={getLabel('cervix', cycleDay.cervix)}
/> />
<SymptomBox <SymptomBox
title='Note' title='Note'
icon={require('./assets/placeholder.png')} onPress={() => this.props.showView('NoteEditView')}
onPress={() => this.showView('NoteEditView')}
data={getLabel('note', cycleDay.note)} data={getLabel('note', cycleDay.note)}
/> />
<SymptomBox <SymptomBox
title='Desire' title='Desire'
icon={require('./assets/placeholder.png')} onPress={() => this.props.showView('DesireEditView')}
onPress={() => this.showView('DesireEditView')}
data={getLabel('desire', cycleDay.desire)} data={getLabel('desire', cycleDay.desire)}
/> />
<SymptomBox <SymptomBox
title='Sex' title='Sex'
icon={require('./assets/placeholder.png')} onPress={() => this.props.showView('SexEditView')}
onPress={() => this.showView('SexEditView')}
data={getLabel('sex', cycleDay.sex)} data={getLabel('sex', cycleDay.sex)}
/> />
{/* this is just to make the last row adhere to the grid {/* this is just to make the last row adhere to the grid
...@@ -145,15 +138,23 @@ function getLabel(symptomName, symptom) { ...@@ -145,15 +138,23 @@ function getLabel(symptomName, symptom) {
class SymptomBox extends Component { class SymptomBox extends Component {
render() { render() {
const d = this.props.data
const boxActive = d ? styles.symptomBoxActive : {}
const iconActive = d ? iconStyles.symptomBoxActive : {}
const textStyle = d ? styles.symptomTextActive : {}
const symptomBoxStyle = Object.assign({}, styles.symptomBox, boxActive)
const iconStyle = Object.assign({}, iconStyles.symptomBox, iconActive)
return ( return (
<TouchableOpacity onPress={this.props.onPress}> <TouchableOpacity onPress={this.props.onPress}>
<View style={styles.symptomBox}> <View style={symptomBoxStyle}>
<Image <Icon
source={require('./assets/placeholder.png')} name='thermometer'
style={styles.symptomBoxImage} {...iconStyle}
/> />
<Text>{this.props.title}</Text> <Text style={textStyle}>{this.props.title}</Text>
<Text>{this.props.data}</Text> <Text style={textStyle}>{this.props.data}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
) )
......
...@@ -58,6 +58,12 @@ export default StyleSheet.create({ ...@@ -58,6 +58,12 @@ export default StyleSheet.create({
minWidth: 100, minWidth: 100,
minHeight: 100, minHeight: 100,
}, },
symptomBoxActive: {
backgroundColor: secondaryColor,
},
symptomTextActive: {
color: fontOnPrimaryColor
},
symptomEditRow: { symptomEditRow: {
justifyContent: 'space-between', justifyContent: 'space-between',
marginBottom: 10, marginBottom: 10,
...@@ -121,5 +127,11 @@ export const iconStyles = { ...@@ -121,5 +127,11 @@ export const iconStyles = {
navigationArrow: { navigationArrow: {
size: 45, size: 45,
color: fontOnPrimaryColor color: fontOnPrimaryColor
},
symptomBox: {
size: 40
},
symptomBoxActive: {
color: fontOnPrimaryColor
} }
} }
\ No newline at end of file
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