Commit dee83df9 by Giang Tran

update code

parent 02afb8c4
...@@ -54,17 +54,31 @@ const MethodPayView = (props) => { ...@@ -54,17 +54,31 @@ const MethodPayView = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'SelectPaymentMethod'} /> <HeaderBack title={'SelectPaymentMethod'} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
<FlatList {data.length == 0 ? (
keyExtractor={(item) => item.id} <View
showsVerticalScrollIndicator={false} style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
numColumns={2} <AppText
columnWrapperStyle={{ i18nKey={'NoData'}
marginHorizontal: 20, style={{
justifyContent: 'space-between', fontSize: 18,
}} fontWeight: 'bold',
data={data} }}></AppText>
renderItem={({item}) => <Item userId={props.user.uid} item={item} />} </View>
/> ) : (
<FlatList
keyExtractor={(item) => item.id}
showsVerticalScrollIndicator={false}
numColumns={2}
columnWrapperStyle={{
marginHorizontal: 20,
justifyContent: 'space-between',
}}
data={data}
renderItem={({item}) => (
<Item userId={props.user.uid} item={item} />
)}
/>
)}
</View> </View>
</View> </View>
); );
......
...@@ -7,7 +7,7 @@ import {WIDTHXD} from '../../Config/Functions'; ...@@ -7,7 +7,7 @@ import {WIDTHXD} from '../../Config/Functions';
import Icon from 'react-native-vector-icons/Entypo'; import Icon from 'react-native-vector-icons/Entypo';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
import {ADDMETHODPAY} from '../../routers/ScreenNames'; import {ADDMETHODPAY} from '../../routers/ScreenNames';
import AppText from '../../components/AppText';
const MethodPayView = (props) => { const MethodPayView = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
...@@ -17,7 +17,17 @@ const MethodPayView = (props) => { ...@@ -17,7 +17,17 @@ const MethodPayView = (props) => {
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'PaymentSetting'} /> <HeaderBack title={'PaymentSetting'} />
<View style={{flex: 1}}> <View style={{flex: 1}}>
{listMethod.length > 0 ? ( {listMethod.length == 0 ? (
<View
style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<AppText
i18nKey={'NoData'}
style={{
fontSize: 18,
fontWeight: 'bold',
}}></AppText>
</View>
) : (
<FlatList <FlatList
keyExtractor={(item) => item.method} keyExtractor={(item) => item.method}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
...@@ -27,7 +37,7 @@ const MethodPayView = (props) => { ...@@ -27,7 +37,7 @@ const MethodPayView = (props) => {
data={listMethod} data={listMethod}
renderItem={({item}) => <Item item={item} />} renderItem={({item}) => <Item item={item} />}
/> />
) : null} )}
<TouchableOpacity <TouchableOpacity
onPress={() => navigate.navigate(ADDMETHODPAY)} onPress={() => navigate.navigate(ADDMETHODPAY)}
......
...@@ -38,10 +38,9 @@ const VersionChecker = (props) => { ...@@ -38,10 +38,9 @@ const VersionChecker = (props) => {
platform: Platform.OS, platform: Platform.OS,
}); });
if ((res.data.code = 200 && res.data.data)) { if ((res.data.code = 200 && res.data.data)) {
console.log(res);
if ( if (
res.data.data[0].version_name !== verCurrent || res.data.data[0].version_name !== verCurrent ||
res.data.data[0].build.toString() !== DeviceInfo.getBuildNumber res.data.data[0].build.toString() !== DeviceInfo.getBuildNumber()
) { ) {
setVersion(res.data.data[0].version_name); setVersion(res.data.data[0].version_name);
setVisible(true); setVisible(true);
......
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