Skip to content

Commit 66a9d4c

Browse files
committed
added fourth button for charges in footer
1 parent 7e5056c commit 66a9d4c

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

src/components/Footer.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,23 @@ import colours from '@res/colours';
1111
export const FooterButton = ({
1212
title,
1313
value,
14+
short = true,
1415
onPress,
1516
}: FooterButtonProps): JSX.Element => (
1617
<TouchableOpacity style={styles.footerButton} onPress={onPress}>
1718
<Text colour={colours.white}>{title}</Text>
18-
<Text colour={colours.white} H4>
19-
{value}
20-
</Text>
19+
<View style={styles.footerValue}>
20+
<Text colour={colours.white} H3={short} H5={!short}>
21+
{value}
22+
</Text>
23+
</View>
2124
</TouchableOpacity>
2225
);
2326

2427
type FooterButtonProps = {
2528
title: string;
2629
value: string;
30+
short: boolean;
2731
onPress?: () => void;
2832
};
2933

@@ -38,6 +42,7 @@ export default ({
3842
<FooterButton
3943
title="Division"
4044
value={DivisionList[division]}
45+
short={false}
4146
onPress={() => dispatch({ type: Actions.INCREMENT_DIVISION })}
4247
/>
4348
<FooterButton
@@ -55,6 +60,11 @@ export default ({
5560
})
5661
}
5762
/>
63+
<FooterButton
64+
title="Charges"
65+
value="5"
66+
onPress={() => dispatch({ type: Actions.INCREMENT_PROPORTION })}
67+
/>
5868
</Row>
5969
</View>
6070
);
@@ -69,12 +79,15 @@ type OwnProps = {
6979
const styles = StyleSheet.create({
7080
footer: {
7181
alignSelf: 'stretch',
72-
height: Platform.OS === 'android' ? 70 : 100,
82+
height: Platform.OS === 'android' ? 50 : 80,
7383
backgroundColor: colours.primaryBlue,
7484
},
7585
footerButton: {
76-
paddingHorizontal: 5,
77-
paddingVertical: 20,
86+
padding: 10,
7887
alignItems: 'center',
7988
},
89+
footerValue: {
90+
height: 30,
91+
justifyContent: 'center',
92+
},
8093
});

src/components/Text.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default ({
77
H2 = false,
88
H3 = false,
99
H4 = false,
10+
H5 = false,
1011
colour,
1112
children = [],
1213
}: OwnProps): JSX.Element => {
@@ -23,6 +24,9 @@ export default ({
2324
if (H4) {
2425
style = styles.heading4;
2526
}
27+
if (H5) {
28+
style = styles.heading5;
29+
}
2630

2731
const textStyle = colour ? [style, { color: colour }] : style;
2832
return <Text style={textStyle}>{children}</Text>;
@@ -33,6 +37,7 @@ type OwnProps = {
3337
H2?: boolean;
3438
H3?: boolean;
3539
H4?: boolean;
40+
H5?: boolean;
3641
colour?: string;
3742
children?: JSX.Element[] | JSX.Element | string;
3843
};
@@ -58,6 +63,11 @@ const styles = StyleSheet.create({
5863
fontSize: 20,
5964
color: colours.black,
6065
},
66+
heading5: {
67+
fontFamily: 'FiraSans-ExtraBold',
68+
fontSize: 16,
69+
color: colours.black,
70+
},
6171
paragraph: {
6272
fontFamily: 'FiraSans-Regular',
6373
fontSize: 14,

0 commit comments

Comments
 (0)