Commit 2fb5c01d by Giang Tran

add version

parent 64a81713
import React, {useState} from 'react'; import React, {useState, useEffect} from 'react';
import { import {
View, View,
Text, Text,
...@@ -11,6 +11,8 @@ import R from '../../assets/R'; ...@@ -11,6 +11,8 @@ import R from '../../assets/R';
import {HEIGHTXD, getFontXD, WIDTHXD} from '../../Config/Functions'; import {HEIGHTXD, getFontXD, WIDTHXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/MaterialIcons'; import Icon from 'react-native-vector-icons/MaterialIcons';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import DeviceInfo from 'react-native-device-info';
import { import {
AccountVerification, AccountVerification,
METHODPAY, METHODPAY,
...@@ -34,6 +36,7 @@ import {useNavigation} from '@react-navigation/native'; ...@@ -34,6 +36,7 @@ import {useNavigation} from '@react-navigation/native';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import AppText from '../AppText'; import AppText from '../AppText';
import images from '../../assets/images'; import images from '../../assets/images';
import I18n from '../../helper/i18/i18n';
const menus = [ const menus = [
{ {
...@@ -158,10 +161,20 @@ const Drawer = (props) => { ...@@ -158,10 +161,20 @@ const Drawer = (props) => {
const [imgAvatart, setImgAvatart] = useState(props.user.picture_url); const [imgAvatart, setImgAvatart] = useState(props.user.picture_url);
const navigate = useNavigation(); const navigate = useNavigation();
const [listMenu, setListMenu] = useState(menus); const [listMenu, setListMenu] = useState(menus);
const [version, setVersion] = useState('');
useEffect(() => {
let version = `${I18n.t(
'Version',
)}: ${DeviceInfo.getVersion()} (${DeviceInfo.getBuildNumber()})`;
setVersion(version);
}, []);
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <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 <TouchableOpacity
onPress={() => { onPress={() => {
props.toggleModal(); props.toggleModal();
...@@ -250,6 +263,13 @@ const Drawer = (props) => { ...@@ -250,6 +263,13 @@ const Drawer = (props) => {
<Icon name={'logout'} size={25} color={'#F81515'} /> <Icon name={'logout'} size={25} color={'#F81515'} />
<AppText i18nKey={'Logout'} Logout style={styles.txtTitle}></AppText> <AppText i18nKey={'Logout'} Logout style={styles.txtTitle}></AppText>
</TouchableOpacity> </TouchableOpacity>
<Text
style={[
styles.txtTitle,
{textAlign: 'center', marginTop: HEIGHTXD(20)},
]}>
{version}
</Text>
</View> </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