import React from 'react'
import {Platform, StatusBar, StyleSheet, Text, View} from 'react-native'
import BaseScreen from "../BaseScreen";
import {responsiveWidth} from 'react-native-responsive-dimensions'
import {Dropdown} from 'react-native-material-dropdown-v2'
import I18n from 'react-native-i18n'
import Configuration from "../../webservice/persistences/Configuration";
import {IlinkEmitter} from "./../../utils/events"
import Icon from 'react-native-vector-icons/MaterialIcons';
import {SafeAreaView} from 'react-navigation';
const theme = require('./../../utils/theme.json');
const route = require('./../../route.json')
require("./../../utils/Translations")
export default class Configurations extends BaseScreen {
static navigationOptions = {
headerTitle: I18n.t('CONFIGURATIONS'),
drawerIcon: ({tintColor}) => (
)
};
constructor(props) {
super(props, true)
this.state = this.initState()
this.configuration = new Configuration();
}
initState() {
let language = [];
language.push({name: I18n.t('langue.english'), value: 'en'});
language.push({name: I18n.t('langue.french'), value: 'fr'});
return {
languages: language
}
}
render() {
console.log(this.state)
return (
{I18n.t("CHOOSE_LANGUAGE")}
{
I18n.locale = value
this.setState({language: value})
this.configuration.setCurrentLangue(data[index])
IlinkEmitter.emit('langueChange')
}}
valueExtractor={(value) => value.value}
labelExtractor={(value) => value.name}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
},
})