Merge branch '542-bug-styling' into 'master'

Resolve "Bug: Styling"

Closes #542

See merge request bloodyhealth/drip!391
This commit is contained in:
bl00dymarie
2022-04-30 16:37:49 +00:00
7 changed files with 39 additions and 42 deletions
+5 -8
View File
@@ -7,7 +7,7 @@ import AppText from '../common/app-text'
import cycleModule from '../../lib/cycle' import cycleModule from '../../lib/cycle'
import { getOrdinalSuffix } from '../helpers/home' import { getOrdinalSuffix } from '../helpers/home'
import { Containers, Typography, Sizes } from '../../styles' import { Typography, Sizes } from '../../styles'
const CycleDayLabel = ({ height, date }) => { const CycleDayLabel = ({ height, date }) => {
const cycleDayNumber = cycleModule().getCycleDayNumber(date) const cycleDayNumber = cycleModule().getCycleDayNumber(date)
@@ -24,11 +24,11 @@ const CycleDayLabel = ({ height, date }) => {
<AppText style={styles.text}> <AppText style={styles.text}>
{isFirstDayOfMonth ? momentDate.format('MMM') : dayOfMonth} {isFirstDayOfMonth ? momentDate.format('MMM') : dayOfMonth}
</AppText> </AppText>
{!isFirstDayOfMonth && {!isFirstDayOfMonth && (
<AppText style={styles.textLight}> <AppText style={styles.textLight}>
{getOrdinalSuffix(dayOfMonth)} {getOrdinalSuffix(dayOfMonth)}
</AppText> </AppText>
} )}
</View> </View>
</View> </View>
) )
@@ -45,15 +45,12 @@ const styles = StyleSheet.create({
justifyContent: 'flex-end', justifyContent: 'flex-end',
left: 4, left: 4,
}, },
containerRow: {
...Containers.rowContainer
},
text: { text: {
...Typography.label, ...Typography.label,
fontSize: Sizes.small, fontSize: Sizes.small,
}, },
textBold: { textBold: {
...Typography.labelBold ...Typography.labelBold,
}, },
textLight: { textLight: {
...Typography.labelLight, ...Typography.labelLight,
@@ -62,7 +59,7 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-around', justifyContent: 'space-around',
alignItems: 'center', alignItems: 'center',
} },
}) })
export default CycleDayLabel export default CycleDayLabel
+4 -2
View File
@@ -57,10 +57,11 @@ const styles = StyleSheet.create({
accentOrange: { accentOrange: {
...Typography.accentOrange, ...Typography.accentOrange,
fontSize: Sizes.small, fontSize: Sizes.small,
margin: Sizes.tiny,
}, },
accentPurpleBig: { accentPurpleBig: {
...Typography.accentPurpleBig, ...Typography.accentPurpleBig,
marginRight: Spacing.small, marginRight: Spacing.tiny
}, },
cellLeft: { cellLeft: {
alignItems: 'flex-end', alignItems: 'flex-end',
@@ -68,12 +69,13 @@ const styles = StyleSheet.create({
justifyContent: 'center', justifyContent: 'center',
}, },
cellRight: { cellRight: {
flex: 6, flex: 5,
justifyContent: 'center', justifyContent: 'center',
}, },
row: { row: {
flexDirection: 'row', flexDirection: 'row',
marginBottom: Spacing.tiny, marginBottom: Spacing.tiny,
marginLeft: Spacing.tiny
} }
}) })
+20 -25
View File
@@ -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)
+1 -1
View File
@@ -353,7 +353,7 @@ const label = {
}) })
.join(', ') .join(', ')
if (isNumber(mucus.value)) label += `\n => ${labels.mucusNFP[mucus.value]}` if (isNumber(mucus.value)) label += ` => ${labels.mucusNFP[mucus.value]}`
if (mucus.exclude) label = `(${label})` if (mucus.exclude) label = `(${label})`
return label return label
+4 -3
View File
@@ -5,7 +5,7 @@ import AppIcon from '../../common/app-icon'
import AppPage from '../../common/app-page' import AppPage from '../../common/app-page'
import AppSwitch from '../../common/app-switch' import AppSwitch from '../../common/app-switch'
import AppText from '../../common/app-text' import AppText from '../../common/app-text'
import TemperatureSlider from './temperature-slider' // import TemperatureSlider from './temperature-slider'
import Segment from '../../common/segment' import Segment from '../../common/segment'
import { useCervixObservable, saveUseCervix } from '../../../local-storage' import { useCervixObservable, saveUseCervix } from '../../../local-storage'
@@ -40,10 +40,11 @@ export default class Settings extends Component {
value={shouldUseCervix} value={shouldUseCervix}
/> />
</Segment> </Segment>
<Segment title={labels.tempScale.segmentTitle}> {/* disabled temporarily, TODO https://gitlab.com/bloodyhealth/drip/-/issues/545 */}
{/* <Segment title={labels.tempScale.segmentTitle}>
<AppText>{labels.tempScale.segmentExplainer}</AppText> <AppText>{labels.tempScale.segmentExplainer}</AppText>
<TemperatureSlider /> <TemperatureSlider />
</Segment> </Segment> */}
<Segment last> <Segment last>
<View style={styles.line}> <View style={styles.line}>
<AppIcon <AppIcon
+2 -2
View File
@@ -91,11 +91,11 @@ const styles = ScaledSheet.create({
}, },
columnLeft: { columnLeft: {
...column, ...column,
flex: 4, flex: 2,
}, },
columnRight: { columnRight: {
...column, ...column,
flex: 5, flex: 3,
paddingTop: Spacing.small, paddingTop: Spacing.small,
}, },
image: { image: {
+3 -1
View File
@@ -113,7 +113,9 @@ export const mood = {
} }
export const temperature = { export const temperature = {
outOfRangeWarning: 'This temperature value is out of the current range for the temperature chart. You can change the range in the settings.', // disabled temporarily, TODO https://gitlab.com/bloodyhealth/drip/-/issues/545 */}
// outOfRangeWarning: 'This temperature value is out of the current range for the temperature chart. You can change the range in the settings.',
outOfRangeWarning: 'This temperature value is too high or low to be shown on the temperature chart.',
outOfAbsoluteRangeWarning: 'This temperature value is too high or low to be shown on the temperature chart.', outOfAbsoluteRangeWarning: 'This temperature value is too high or low to be shown on the temperature chart.',
saveAnyway: 'Save anyway', saveAnyway: 'Save anyway',
temperature: { temperature: {