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