Commit 2fb5c01d by Giang Tran

add version

parent 64a81713
import React, {useState} from 'react';
import React, {useState, useEffect} from 'react';
import {
View,
Text,
......@@ -11,6 +11,8 @@ import R from '../../assets/R';
import {HEIGHTXD, getFontXD, WIDTHXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/MaterialIcons';
import AsyncStorage from '@react-native-community/async-storage';
import DeviceInfo from 'react-native-device-info';
import {
AccountVerification,
METHODPAY,
......@@ -34,6 +36,7 @@ import {useNavigation} from '@react-navigation/native';
import {connect} from 'react-redux';
import AppText from '../AppText';
import images from '../../assets/images';
import I18n from '../../helper/i18/i18n';
const menus = [
{
......@@ -158,10 +161,20 @@ const Drawer = (props) => {
const [imgAvatart, setImgAvatart] = useState(props.user.picture_url);
const navigate = useNavigation();
const [listMenu, setListMenu] = useState(menus);
const [version, setVersion] = useState('');
useEffect(() => {
let version = `${I18n.t(
'Version',
)}: ${DeviceInfo.getVersion()} (${DeviceInfo.getBuildNumber()})`;
setVersion(version);
}, []);
return (
<View style={styles.container}>
<View style={styles.header}>
<Image source={imgAvatart ? {uri: imgAvatart} : R.images.avartar} style={styles.imgAvatar} />
<Image
source={imgAvatart ? {uri: imgAvatart} : R.images.avartar}
style={styles.imgAvatar}
/>
<TouchableOpacity
onPress={() => {
props.toggleModal();
......@@ -250,6 +263,13 @@ const Drawer = (props) => {
<Icon name={'logout'} size={25} color={'#F81515'} />
<AppText i18nKey={'Logout'} Logout style={styles.txtTitle}></AppText>
</TouchableOpacity>
<Text
style={[
styles.txtTitle,
{textAlign: 'center', marginTop: HEIGHTXD(20)},
]}>
{version}
</Text>
</View>
);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment