|
@@ -1,8 +1,11 @@
|
1
|
1
|
import React from 'react';
|
2
|
2
|
import { StyleSheet } from 'react-native';
|
3
|
|
-import { Card, Text } from 'react-native-paper';
|
|
3
|
+import { Avatar, Button, Card, Text } from 'react-native-paper';
|
4
|
4
|
import TimeAgo from 'react-native-timeago';
|
5
|
5
|
import i18n from 'i18n-js';
|
|
6
|
+import { useNavigation } from '@react-navigation/core';
|
|
7
|
+import { MainRoutes } from '../../../navigation/MainNavigator';
|
|
8
|
+import ProxiwashConstants from '../../../constants/ProxiwashConstants';
|
6
|
9
|
|
7
|
10
|
let moment = require('moment'); //load moment module to set local language
|
8
|
11
|
require('moment/locale/fr'); // import moment local language file during the application build
|
|
@@ -14,14 +17,22 @@ type Props = {
|
14
|
17
|
};
|
15
|
18
|
|
16
|
19
|
const styles = StyleSheet.create({
|
17
|
|
- card: { marginHorizontal: 5 },
|
|
20
|
+ card: {
|
|
21
|
+ marginHorizontal: 5,
|
|
22
|
+ },
|
|
23
|
+ actions: {
|
|
24
|
+ justifyContent: 'center',
|
|
25
|
+ },
|
18
|
26
|
});
|
19
|
27
|
|
20
|
28
|
function ProximoListHeader(props: Props) {
|
|
29
|
+ const navigation = useNavigation();
|
21
|
30
|
const { date, selectedWash } = props;
|
22
|
31
|
let title = i18n.t('screens.proxiwash.washinsa.title');
|
|
32
|
+ let icon = ProxiwashConstants.washinsa.icon;
|
23
|
33
|
if (selectedWash === 'tripodeB') {
|
24
|
34
|
title = i18n.t('screens.proxiwash.tripodeB.title');
|
|
35
|
+ icon = ProxiwashConstants.tripodeB.icon;
|
25
|
36
|
}
|
26
|
37
|
return (
|
27
|
38
|
<Card style={styles.card}>
|
|
@@ -35,7 +46,17 @@ function ProximoListHeader(props: Props) {
|
35
|
46
|
</Text>
|
36
|
47
|
) : null
|
37
|
48
|
}
|
|
49
|
+ left={(iconProps) => <Avatar.Icon icon={icon} size={iconProps.size} />}
|
38
|
50
|
/>
|
|
51
|
+ <Card.Actions style={styles.actions}>
|
|
52
|
+ <Button
|
|
53
|
+ mode={'contained'}
|
|
54
|
+ onPress={() => navigation.navigate(MainRoutes.Settings)}
|
|
55
|
+ icon={'swap-horizontal'}
|
|
56
|
+ >
|
|
57
|
+ {i18n.t('screens.proxiwash.switch')}
|
|
58
|
+ </Button>
|
|
59
|
+ </Card.Actions>
|
39
|
60
|
</Card>
|
40
|
61
|
);
|
41
|
62
|
}
|