Skip to content
Snippets Groups Projects
Commit 646543c9 authored by emelko's avatar emelko
Browse files

Make stats look a bit more consistent with framed segment

parent ca905c6b
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ import cycleModule from '../lib/cycle' ...@@ -9,6 +9,7 @@ import cycleModule from '../lib/cycle'
import {getCycleLengthStats as getCycleInfo} from '../lib/cycle-length' import {getCycleLengthStats as getCycleInfo} from '../lib/cycle-length'
import {stats as labels} from '../i18n/en/labels' import {stats as labels} from '../i18n/en/labels'
import AppText from './app-text' import AppText from './app-text'
import FramedSegment from './framed-segment'
export default class Stats extends Component { export default class Stats extends Component {
render() { render() {
...@@ -24,8 +25,10 @@ export default class Stats extends Component { ...@@ -24,8 +25,10 @@ export default class Stats extends Component {
} }
return ( return (
<ScrollView> <ScrollView>
<View style={[styles.textWrappingView]}> <FramedSegment
<AppText style={styles.title}>{labels.cycleLengthTitle}</AppText> style={styles.framedSegmentLast}
title={labels.cycleLengthTitle}
>
<AppText style={styles.paragraph}>{labels.cycleLengthExplainer}</AppText> <AppText style={styles.paragraph}>{labels.cycleLengthExplainer}</AppText>
{!atLeastOneCycle && {!atLeastOneCycle &&
<AppText>{labels.emptyStats}</AppText> <AppText>{labels.emptyStats}</AppText>
...@@ -39,20 +42,20 @@ export default class Stats extends Component { ...@@ -39,20 +42,20 @@ export default class Stats extends Component {
} }
{atLeastOneCycle && numberOfCycles > 1 && <View> {atLeastOneCycle && numberOfCycles > 1 && <View>
<View style={styles.statsRow}> <View style={styles.statsRow}>
<AppText style={[styles.statsLabelLeft, styles.emphasis]}>{labels.averageLabel}</AppText> <AppText style={styles.emphasis}>{labels.averageLabel}</AppText>
<AppText style={[styles.statsLabelRight, styles.emphasis]}>{cycleInfo.mean + ' ' + labels.daysLabel}</AppText> <AppText style={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>{labels.minLabel}</AppText>
<AppText style={styles.statsLabelRight}>{cycleInfo.minimum + ' ' + labels.daysLabel}</AppText> <AppText>{': ' + cycleInfo.minimum + ' ' + labels.daysLabel}</AppText>
</View> </View>
<View style={styles.statsRow}> <View style={styles.statsRow}>
<AppText style={styles.statsLabelLeft}>{labels.maxLabel}</AppText> <AppText>{labels.maxLabel}</AppText>
<AppText style={styles.statsLabelRight}>{cycleInfo.maximum + ' ' + labels.daysLabel}</AppText> <AppText>{': ' + cycleInfo.maximum + ' ' + labels.daysLabel}</AppText>
</View> </View>
<View style={[styles.statsRow, styles.paragraph]}> <View style={[styles.statsRow, styles.paragraph]}>
<AppText style={styles.statsLabelLeft}>{labels.stdLabel}</AppText> <AppText>{labels.stdLabel}</AppText>
<AppText style={styles.statsLabelRight}>{cycleInfo.stdDeviation + ' ' + labels.daysLabel}</AppText> <AppText>{': ' + cycleInfo.stdDeviation + ' ' + labels.daysLabel}</AppText>
</View> </View>
<View style={styles.statsRow}> <View style={styles.statsRow}>
<AppText>{labels.basisOfStatsBeginning}</AppText> <AppText>{labels.basisOfStatsBeginning}</AppText>
...@@ -60,7 +63,7 @@ export default class Stats extends Component { ...@@ -60,7 +63,7 @@ export default class Stats extends Component {
<AppText>{labels.basisOfStatsEnd}</AppText> <AppText>{labels.basisOfStatsEnd}</AppText>
</View> </View>
</View>} </View>}
</View> </FramedSegment>
</ScrollView> </ScrollView>
) )
} }
......
...@@ -45,7 +45,8 @@ export default StyleSheet.create({ ...@@ -45,7 +45,8 @@ export default StyleSheet.create({
}, },
emphasis: { emphasis: {
fontWeight: 'bold', fontWeight: 'bold',
fontFamily: textFontBold fontFamily: textFontBold,
color: secondaryColor,
}, },
link: { link: {
color: cycleDayColor, color: cycleDayColor,
...@@ -307,16 +308,6 @@ export default StyleSheet.create({ ...@@ -307,16 +308,6 @@ export default StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
width: '100%' width: '100%'
}, },
statsLabelLeft: {
width: '60%',
textAlign: 'left',
textAlignVertical: 'center',
marginLeft: 10
},
statsLabelRight: {
textAlign: 'left',
textAlignVertical: 'center'
},
menuLabel: { menuLabel: {
fontSize: 15, fontSize: 15,
color: fontOnPrimaryColor color: fontOnPrimaryColor
......
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