little improvements after review

This commit is contained in:
tina
2018-09-14 12:26:11 +02:00
parent 94d991d868
commit 163f6b5738
2 changed files with 21 additions and 25 deletions
+8 -8
View File
@@ -26,23 +26,23 @@ export default class Stats extends Component {
} }
return ( return (
<ScrollView> <ScrollView>
<View style={[styles.appHorizontalMargin, styles.appVerticalMargin]}> <View style={[styles.textWrappingView]}>
<AppText style={styles.appTextTitle}>{labels.cycleLengthTitle}</AppText> <AppText style={styles.title}>{labels.cycleLengthTitle}</AppText>
<AppText style={styles.appBottomMargin}>{labels.cycleLengthExplainer}</AppText> <AppText style={styles.paragraph}>{labels.cycleLengthExplainer}</AppText>
{!atLeastOneCycle && {!atLeastOneCycle &&
<AppText>{labels.emptyStats}</AppText> <AppText>{labels.emptyStats}</AppText>
} }
{atLeastOneCycle && numberOfCycles === 1 && {atLeastOneCycle && numberOfCycles === 1 &&
<AppText> <AppText>
{labels.oneCycleStats} {labels.oneCycleStats}
<AppText style={styles.appTextEmphasis}> {cycleLengths[0]} </AppText> <AppText style={styles.emphasis}> {cycleLengths[0]} </AppText>
{labels.daysLabel + '.'} {labels.daysLabel + '.'}
</AppText> </AppText>
} }
{atLeastOneCycle && numberOfCycles > 1 && <View> {atLeastOneCycle && numberOfCycles > 1 && <View>
<View style={styles.statsRow}> <View style={styles.statsRow}>
<AppText style={[styles.statsLabelLeft, styles.appTextEmphasis]}>{labels.averageLabel}</AppText> <AppText style={[styles.statsLabelLeft, styles.emphasis]}>{labels.averageLabel}</AppText>
<AppText style={[styles.statsLabelRight, styles.appTextEmphasis]}>{cycleInfo.mean + ' ' + labels.daysLabel}</AppText> <AppText style={[styles.statsLabelRight, styles.emphasis]}>{cycleInfo.mean + ' ' + labels.daysLabel}</AppText>
</View> </View>
<View style={styles.statsRow}> <View style={styles.statsRow}>
<AppText style={styles.statsLabelLeft}>{labels.minLabel}</AppText> <AppText style={styles.statsLabelLeft}>{labels.minLabel}</AppText>
@@ -52,13 +52,13 @@ export default class Stats extends Component {
<AppText style={styles.statsLabelLeft}>{labels.maxLabel}</AppText> <AppText style={styles.statsLabelLeft}>{labels.maxLabel}</AppText>
<AppText style={styles.statsLabelRight}>{cycleInfo.maximum + ' ' + labels.daysLabel}</AppText> <AppText style={styles.statsLabelRight}>{cycleInfo.maximum + ' ' + labels.daysLabel}</AppText>
</View> </View>
<View style={[styles.statsRow, styles.appBottomMargin]}> <View style={[styles.statsRow, styles.paragraph]}>
<AppText style={styles.statsLabelLeft}>{labels.stdLabel}</AppText> <AppText style={styles.statsLabelLeft}>{labels.stdLabel}</AppText>
<AppText style={styles.statsLabelRight}>{cycleInfo.stdDeviation + ' ' + labels.daysLabel}</AppText> <AppText style={styles.statsLabelRight}>{cycleInfo.stdDeviation + ' ' + labels.daysLabel}</AppText>
</View> </View>
<AppText> <AppText>
{labels.basisOfStatsBeginning} {labels.basisOfStatsBeginning}
<AppText style={styles.appTextEmphasis}> {numberOfCycles} </AppText> <AppText style={styles.emphasis}> {numberOfCycles} </AppText>
{labels.basisOfStatsEnd} {labels.basisOfStatsEnd}
</AppText> </AppText>
</View>} </View>}
+13 -17
View File
@@ -4,26 +4,28 @@ export const primaryColor = '#ff7e5f'
export const secondaryColor = '#351c4d' export const secondaryColor = '#351c4d'
export const fontOnPrimaryColor = 'white' export const fontOnPrimaryColor = 'white'
const defaultBottomMargin = 5
const defaultIndentation = 10
const defaultTopMargin = 10
export default StyleSheet.create({ export default StyleSheet.create({
appText: { appText: {
color: 'black' color: 'black'
}, },
appTextEmphasis: { paragraph: {
marginBottom: defaultBottomMargin
},
emphasis: {
fontWeight: 'bold', fontWeight: 'bold',
}, },
appTextTitle: { title: {
fontSize: 18, fontSize: 18,
color: 'black', color: 'black',
marginBottom: 5, marginBottom: defaultBottomMargin,
}, },
appVerticalMargin: { textWrappingView: {
marginTop: 10, marginHorizontal: defaultIndentation,
}, marginTop: defaultTopMargin
appHorizontalMargin: {
marginHorizontal: 10,
},
appBottomMargin: {
marginBottom: 5
}, },
welcome: { welcome: {
fontSize: 20, fontSize: 20,
@@ -154,12 +156,6 @@ export default StyleSheet.create({
symptomEditButton: { symptomEditButton: {
width: 130 width: 130
}, },
/*statsIntro: {
fontSize: 18,
margin: 10,
textAlign: 'left',
textAlignVertical: 'center'
},*/
settingsSegment: { settingsSegment: {
backgroundColor: 'lightgrey', backgroundColor: 'lightgrey',
padding: 10, padding: 10,