40 lines
1.5 KiB
JavaScript
40 lines
1.5 KiB
JavaScript
import React from "react";
|
|
import { View } from "react-native";
|
|
import { Text, List, RadioButton } from "react-native-paper";
|
|
import i18n from "../i18nMessages.js";
|
|
import Moment from 'moment';
|
|
import 'moment/min/locales';
|
|
Moment.locale(i18n.locale);
|
|
|
|
|
|
let MenuView = ({navigation})=>{
|
|
const [value, setValue] = React.useState('es');
|
|
|
|
let changeLang = (locale) =>{
|
|
i18n.locale = locale;
|
|
Moment.locale(locale);
|
|
setValue(locale);
|
|
}
|
|
|
|
return (
|
|
<View>
|
|
<List.Section title="User Actions">
|
|
<List.Item title="Profile" onPress={()=>{navigation.navigate("ProfileSettings")}} left={props => <List.Icon {...props} icon="person" />} />
|
|
<List.Item title="Settings" left={props => <List.Icon {...props} icon="settings" />} />
|
|
<List.Item title="Sign out" left={props => <List.Icon {...props} icon="logout" />} />
|
|
</List.Section>
|
|
<List.Section title="Fellowship App">
|
|
<List.Item title="About" left={props => <List.Icon {...props} icon="more" />} />
|
|
</List.Section>
|
|
<View style={{padding: 10}}>
|
|
<Text>Lenguage:</Text>
|
|
<RadioButton.Group onValueChange={newValue => changeLang(newValue)} value={value}>
|
|
<RadioButton.Item value="es" label="Español"/>
|
|
<RadioButton.Item value="en" label="English"/>
|
|
</RadioButton.Group>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
export default MenuView; |