Cycle Day styling improvements
This commit is contained in:
@@ -15,7 +15,6 @@ import { Colors, Sizes, Spacing } from '../../styles'
|
|||||||
import { headerTitles as symptomTitles } from '../../i18n/en/labels'
|
import { headerTitles as symptomTitles } from '../../i18n/en/labels'
|
||||||
|
|
||||||
class SymptomBox extends Component {
|
class SymptomBox extends Component {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
date: PropTypes.string.isRequired,
|
date: PropTypes.string.isRequired,
|
||||||
isSymptomEdited: PropTypes.bool,
|
isSymptomEdited: PropTypes.bool,
|
||||||
@@ -33,7 +32,7 @@ class SymptomBox extends Component {
|
|||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
isSymptomEdited: props.isSymptomEdited
|
isSymptomEdited: props.isSymptomEdited,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,24 +57,24 @@ class SymptomBox extends Component {
|
|||||||
const iconName = `drip-icon-${symptom}`
|
const iconName = `drip-icon-${symptom}`
|
||||||
const symptomNameStyle = [
|
const symptomNameStyle = [
|
||||||
styles.symptomName,
|
styles.symptomName,
|
||||||
(isSymptomDisabled && styles.symptomNameDisabled),
|
isSymptomDisabled && styles.symptomNameDisabled,
|
||||||
(isExcluded && styles.symptomNameExcluded)
|
isExcluded && styles.symptomNameExcluded,
|
||||||
]
|
]
|
||||||
const textStyle = [
|
const textStyle = [
|
||||||
styles.text,
|
styles.text,
|
||||||
(isSymptomDisabled && styles.textDisabled),
|
isSymptomDisabled && styles.textDisabled,
|
||||||
(isExcluded && styles.textExcluded)
|
isExcluded && styles.textExcluded,
|
||||||
]
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{isSymptomEdited &&
|
{isSymptomEdited && (
|
||||||
<SymptomEditView
|
<SymptomEditView
|
||||||
symptom={symptom}
|
symptom={symptom}
|
||||||
symptomData={symptomData}
|
symptomData={symptomData}
|
||||||
onClose={this.onFinishEditing}
|
onClose={this.onFinishEditing}
|
||||||
/>
|
/>
|
||||||
}
|
)}
|
||||||
|
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
disabled={isSymptomDisabled}
|
disabled={isSymptomDisabled}
|
||||||
@@ -93,11 +92,11 @@ class SymptomBox extends Component {
|
|||||||
<AppText style={symptomNameStyle}>
|
<AppText style={symptomNameStyle}>
|
||||||
{symptomTitles[symptom].toLowerCase()}
|
{symptomTitles[symptom].toLowerCase()}
|
||||||
</AppText>
|
</AppText>
|
||||||
{symptomDataToDisplay &&
|
{symptomDataToDisplay && (
|
||||||
<AppText style={textStyle} numberOfLines={4} >
|
<AppText style={textStyle} numberOfLines={4}>
|
||||||
{symptomDataToDisplay}
|
{symptomDataToDisplay}
|
||||||
</AppText>
|
</AppText>
|
||||||
}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
@@ -112,20 +111,20 @@ const styles = StyleSheet.create({
|
|||||||
borderRadius: scale(10),
|
borderRadius: scale(10),
|
||||||
elevation: 4,
|
elevation: 4,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
height: scale(120),
|
height: scale(110),
|
||||||
marginBottom: Spacing.base,
|
marginBottom: Spacing.base,
|
||||||
paddingHorizontal: Spacing.small,
|
paddingHorizontal: Spacing.small,
|
||||||
paddingVertical: Spacing.base,
|
paddingVertical: Spacing.base,
|
||||||
width: Spacing.symptomTileWidth
|
width: Spacing.symptomTileWidth,
|
||||||
},
|
},
|
||||||
symptomName: {
|
symptomName: {
|
||||||
paddingTop: Sizes.tiny,
|
paddingTop: Sizes.tiny,
|
||||||
color: Colors.purple,
|
color: Colors.purple,
|
||||||
fontSize: Sizes.base,
|
fontSize: Sizes.base,
|
||||||
lineHeight: Sizes.base
|
lineHeight: Sizes.base,
|
||||||
},
|
},
|
||||||
symptomNameDisabled: {
|
symptomNameDisabled: {
|
||||||
color: Colors.grey
|
color: Colors.grey,
|
||||||
},
|
},
|
||||||
symptomNameExcluded: {
|
symptomNameExcluded: {
|
||||||
color: Colors.greyDark,
|
color: Colors.greyDark,
|
||||||
@@ -134,28 +133,24 @@ const styles = StyleSheet.create({
|
|||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
marginLeft: Spacing.tiny,
|
marginLeft: Spacing.tiny,
|
||||||
maxWidth: Spacing.textWidth
|
maxWidth: Spacing.textWidth,
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
fontSize: Sizes.small,
|
fontSize: Sizes.small,
|
||||||
fontStyle: 'italic',
|
fontStyle: 'italic',
|
||||||
lineHeight: Sizes.small
|
|
||||||
},
|
},
|
||||||
textDisabled: {
|
textDisabled: {
|
||||||
color: Colors.greyLight
|
color: Colors.greyLight,
|
||||||
},
|
},
|
||||||
textExcluded: {
|
textExcluded: {
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
return({
|
return {
|
||||||
date: getDate(state),
|
date: getDate(state),
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(
|
export default connect(mapStateToProps, null)(SymptomBox)
|
||||||
mapStateToProps,
|
|
||||||
null,
|
|
||||||
)(SymptomBox)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user