forkad från vergnet/application-amicale
Allow laundromat swwitch from header
This commit is contained in:
förälder
360023aea6
incheckning
02135d64ff
4 ändrade filer med 25 tillägg och 7 borttagningar
|
@ -41,6 +41,7 @@
|
||||||
"washer": "Washer",
|
"washer": "Washer",
|
||||||
"washers": "Washers",
|
"washers": "Washers",
|
||||||
"updated": "Updated ",
|
"updated": "Updated ",
|
||||||
|
"switch": "Switch laundromat",
|
||||||
"min": "min",
|
"min": "min",
|
||||||
"informationTab": "Information",
|
"informationTab": "Information",
|
||||||
"paymentTab": "Payment",
|
"paymentTab": "Payment",
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
"washer": "Lave-Linge",
|
"washer": "Lave-Linge",
|
||||||
"washers": "Lave-Linges",
|
"washers": "Lave-Linges",
|
||||||
"updated": "Mise à jour ",
|
"updated": "Mise à jour ",
|
||||||
|
"switch": "Changer de laverie",
|
||||||
"min": "min",
|
"min": "min",
|
||||||
"informationTab": "Informations",
|
"informationTab": "Informations",
|
||||||
"paymentTab": "Paiement",
|
"paymentTab": "Paiement",
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StyleSheet } from 'react-native';
|
import { StyleSheet } from 'react-native';
|
||||||
import { Card, Text } from 'react-native-paper';
|
import { Avatar, Button, Card, Text } from 'react-native-paper';
|
||||||
import TimeAgo from 'react-native-timeago';
|
import TimeAgo from 'react-native-timeago';
|
||||||
import i18n from 'i18n-js';
|
import i18n from 'i18n-js';
|
||||||
|
import { useNavigation } from '@react-navigation/core';
|
||||||
|
import { MainRoutes } from '../../../navigation/MainNavigator';
|
||||||
|
import ProxiwashConstants from '../../../constants/ProxiwashConstants';
|
||||||
|
|
||||||
let moment = require('moment'); //load moment module to set local language
|
let moment = require('moment'); //load moment module to set local language
|
||||||
require('moment/locale/fr'); // import moment local language file during the application build
|
require('moment/locale/fr'); // import moment local language file during the application build
|
||||||
|
@ -14,14 +17,22 @@ type Props = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
card: { marginHorizontal: 5 },
|
card: {
|
||||||
|
marginHorizontal: 5,
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
function ProximoListHeader(props: Props) {
|
function ProximoListHeader(props: Props) {
|
||||||
|
const navigation = useNavigation();
|
||||||
const { date, selectedWash } = props;
|
const { date, selectedWash } = props;
|
||||||
let title = i18n.t('screens.proxiwash.washinsa.title');
|
let title = i18n.t('screens.proxiwash.washinsa.title');
|
||||||
|
let icon = ProxiwashConstants.washinsa.icon;
|
||||||
if (selectedWash === 'tripodeB') {
|
if (selectedWash === 'tripodeB') {
|
||||||
title = i18n.t('screens.proxiwash.tripodeB.title');
|
title = i18n.t('screens.proxiwash.tripodeB.title');
|
||||||
|
icon = ProxiwashConstants.tripodeB.icon;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Card style={styles.card}>
|
<Card style={styles.card}>
|
||||||
|
@ -35,7 +46,17 @@ function ProximoListHeader(props: Props) {
|
||||||
</Text>
|
</Text>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
left={(iconProps) => <Avatar.Icon icon={icon} size={iconProps.size} />}
|
||||||
/>
|
/>
|
||||||
|
<Card.Actions style={styles.actions}>
|
||||||
|
<Button
|
||||||
|
mode={'contained'}
|
||||||
|
onPress={() => navigation.navigate(MainRoutes.Settings)}
|
||||||
|
icon={'swap-horizontal'}
|
||||||
|
>
|
||||||
|
{i18n.t('screens.proxiwash.switch')}
|
||||||
|
</Button>
|
||||||
|
</Card.Actions>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,11 +130,6 @@ function ProxiwashScreen() {
|
||||||
navigation.setOptions({
|
navigation.setOptions({
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<MaterialHeaderButtons>
|
<MaterialHeaderButtons>
|
||||||
<Item
|
|
||||||
title={'switch'}
|
|
||||||
iconName={'swap-horizontal'}
|
|
||||||
onPress={() => navigation.navigate('settings')}
|
|
||||||
/>
|
|
||||||
<Item
|
<Item
|
||||||
title={'information'}
|
title={'information'}
|
||||||
iconName={'information'}
|
iconName={'information'}
|
||||||
|
|
Laddar…
Referens i nytt ärende