Commit a76c9a92 by Nguyễn Thị Thúy

merge dev_phase2

parents da99951b c0a504d5
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
android:exported="true" android:exported="true"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="appdcvinvest" android:host="screen" android:pathPrefix="/"
/>
</intent-filter>
</activity> </activity>
<activity <activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity" android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
...@@ -43,12 +51,7 @@ ...@@ -43,12 +51,7 @@
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="dcvinvest" />
</intent-filter>
</activity> </activity>
......
<resources> <resources>
<color name="bootsplash_background">#1C6AF6</color> <color name="bootsplash_background">#1C6AF6</color>
<color name="white">#1C6AF6</color> <color name="white">#fff</color>
</resources> </resources>
...@@ -912,7 +912,7 @@ ...@@ -912,7 +912,7 @@
); );
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.6; MARKETING_VERSION = 1.7;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
...@@ -940,7 +940,7 @@ ...@@ -940,7 +940,7 @@
DEVELOPMENT_TEAM = MXZ24GRH48; DEVELOPMENT_TEAM = MXZ24GRH48;
INFOPLIST_FILE = Invest/Info.plist; INFOPLIST_FILE = Invest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.6; MARKETING_VERSION = 1.7;
OTHER_LDFLAGS = ( OTHER_LDFLAGS = (
"$(inherited)", "$(inherited)",
"-ObjC", "-ObjC",
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#import <React/RCTRootView.h> #import <React/RCTRootView.h>
@import Firebase; @import Firebase;
#import <React/RCTLinkingManager.h>
#import <AVFoundation/AVFoundation.h> #import <AVFoundation/AVFoundation.h>
#import "RNBootSplash.h" #import "RNBootSplash.h"
#if DEBUG #if DEBUG
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h> #import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
//#import <CallAppSDK/CallAppInterface.h> //#import <CallAppSDK/CallAppInterface.h>
static void InitializeFlipper(UIApplication *application) { static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient]; FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
...@@ -55,6 +56,33 @@ static void InitializeFlipper(UIApplication *application) { ...@@ -55,6 +56,33 @@ static void InitializeFlipper(UIApplication *application) {
return YES; return YES;
} }
#import <React/RCTLinkingManager.h>
// - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
// sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
// {
// return [RCTLinkingManager application:application openURL:url
// sourceApplication:sourceApplication annotation:annotation];
// }
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{ {
#if DEBUG #if DEBUG
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<string>dcv.investcustomer.vn. linking</string> <string>dcv.investcustomer.vn. linking</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>dcvinvest</string> <string>appdcvinvest</string>
</array> </array>
</dict> </dict>
</array> </array>
......
...@@ -37,6 +37,7 @@ const PacketCQG = (props) => { ...@@ -37,6 +37,7 @@ const PacketCQG = (props) => {
props.showLoading(); props.showLoading();
const res = await openCQG({packages: newList}); const res = await openCQG({packages: newList});
props.hideLoading(); props.hideLoading();
console.log(res);
if (res.data.code == 200) { if (res.data.code == 200) {
props.saveUserToRedux(res.data.data); props.saveUserToRedux(res.data.data);
setTimeout(() => { setTimeout(() => {
......
...@@ -91,7 +91,7 @@ const styles = StyleSheet.create({ ...@@ -91,7 +91,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txt: { txt: {
fontSize: getFontXD(36), fontSize: getFontXD(36),
......
...@@ -81,7 +81,7 @@ const styles = StyleSheet.create({ ...@@ -81,7 +81,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -6,6 +6,11 @@ import { ...@@ -6,6 +6,11 @@ import {
Dimensions, Dimensions,
TouchableOpacity, TouchableOpacity,
Alert, Alert,
TouchableWithoutFeedback,
Keyboard,
KeyboardAvoidingView,
Platform,
ScrollView,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
...@@ -32,7 +37,10 @@ const WalletDeposit = (props) => { ...@@ -32,7 +37,10 @@ const WalletDeposit = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
const onClick = async () => { const onClick = async () => {
const titles = [I18n.t('AmountOfMoney').toLowerCase(), I18n.t('Note').toLowerCase()]; const titles = [
I18n.t('AmountOfMoney').toLowerCase(),
I18n.t('Note').toLowerCase(),
];
const index = checkFormatArray([amount, notes]); const index = checkFormatArray([amount, notes]);
if (index === true) { if (index === true) {
...@@ -63,45 +71,64 @@ const WalletDeposit = (props) => { ...@@ -63,45 +71,64 @@ const WalletDeposit = (props) => {
} }
}; };
return ( return (
<View style={{flex: 1}}> <KeyboardAvoidingView
<HeaderBack title={'InvestmentDeposit'} /> behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
<View style={styles.container}> style={{flex: 1, backgroundColor: 'white'}}
<View style={styles.wrapTop}> keyboardVerticalOffset={-50}>
<View style={styles.itemTop}> <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text> <View style={{flex: 1}}>
<Text style={styles.txtMoney}> <HeaderBack title={'InvestmentDeposit'} />
{' '} <ScrollView showsVerticalScrollIndicator={false}>
{props.user.current_money != 0 <View style={styles.container}>
? toPriceVnd(props.user.current_money) <View style={styles.wrapTop}>
: 0}{' '} <View style={styles.itemTop}>
</Text> <Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_money != 0
? toPriceVnd(props.user.current_money)
: 0}{' '}
</Text>
</View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money)
: 0}{' '}
đ
</Text>
</View>
</View>
<View style={styles.wrapBody}>
{/* <TextDisable value={'10010101'} title={'Số tài khoản CQG'} /> */}
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti
onChangeText={(val) => setNotes(val)}
title={I18n.t('Note')}
/>
</View>
</View>
</ScrollView>
<View
style={{
paddingVertical: 10,
justifyContent: 'center',
alignItems: 'center',
}}>
<TouchableOpacity onPress={onClick} style={styles.btnSend}>
<Text style={styles.txtSend}>{I18n.t('Deposit')}</Text>
</TouchableOpacity>
</View> </View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}>
{' '}
{props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money)
: 0}{' '}
đ
</Text>
</View>
</View>
<View style={styles.wrapBody}>
{/* <TextDisable value={'10010101'} title={'Số tài khoản CQG'} /> */}
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti onChangeText={(val) => setNotes(val)} title={I18n.t('Note')} />
</View> </View>
</View> </TouchableWithoutFeedback>
<TouchableOpacity onPress={onClick} style={styles.btnSend}> </KeyboardAvoidingView>
<Text style={styles.txtSend}>{I18n.t('Deposit')}</Text>
</TouchableOpacity>
</View>
); );
}; };
...@@ -147,9 +174,6 @@ const styles = StyleSheet.create({ ...@@ -147,9 +174,6 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
}, },
btnSend: { btnSend: {
position: 'absolute',
bottom: 30,
right: width / 2 - 70,
width: 140, width: 140,
height: 40, height: 40,
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
TouchableWithoutFeedback, TouchableWithoutFeedback,
Keyboard, Keyboard,
KeyboardAvoidingView, KeyboardAvoidingView,
ScrollView,
} from 'react-native'; } from 'react-native';
import R from '../../../assets/R'; import R from '../../../assets/R';
import HeaderBack from '../../../components/Header/HeaderBack'; import HeaderBack from '../../../components/Header/HeaderBack';
...@@ -61,9 +62,8 @@ const WalletWithdraw = (props) => { ...@@ -61,9 +62,8 @@ const WalletWithdraw = (props) => {
}); });
if (res.data.code == 200 && res.data.data) { if (res.data.code == 200 && res.data.data) {
if (res.data.data.length == 0) { if (res.data.data.length == 0) {
confirmAlert( confirmAlert(I18n.t('SettingPaymentMethodConfirm'), () =>
I18n.t('SettingPaymentMethodConfirm'), navigate.navigate(ADDMETHODPAY),
() => navigate.navigate(ADDMETHODPAY),
); );
} else { } else {
const newList = res.data.data.map((e) => { const newList = res.data.data.map((e) => {
...@@ -77,7 +77,10 @@ const WalletWithdraw = (props) => { ...@@ -77,7 +77,10 @@ const WalletWithdraw = (props) => {
}; };
const onPressWithdraw = async () => { const onPressWithdraw = async () => {
const titles = [I18n.t('BeneficiaryAccount'), I18n.t('AmountOfMoney').toLowerCase()]; const titles = [
I18n.t('BeneficiaryAccount'),
I18n.t('AmountOfMoney').toLowerCase(),
];
const index = checkFormatArray([type, amount]); const index = checkFormatArray([type, amount]);
...@@ -120,78 +123,87 @@ const WalletWithdraw = (props) => { ...@@ -120,78 +123,87 @@ const WalletWithdraw = (props) => {
<TouchableWithoutFeedback onPress={Keyboard.dismiss}> <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'Withdraw'} /> <HeaderBack title={'Withdraw'} />
<View style={styles.container}> <ScrollView showsVerticalScrollIndicator={false}>
<View style={styles.wrapTop}> <View style={styles.container}>
<View style={styles.itemTop}> <View style={styles.wrapTop}>
<Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text> <View style={styles.itemTop}>
<Text style={styles.txtMoney}> <Text style={styles.txtTitle}>{I18n.t('Wallet')}</Text>
{' '} <Text style={styles.txtMoney}>
{props.user.current_money != 0 {' '}
? toPriceVnd(props.user.current_money) {props.user.current_money != 0
: 0}{' '} ? toPriceVnd(props.user.current_money)
</Text> : 0}{' '}
</View> </Text>
</View>
<View style={{width: 1, backgroundColor: '#DBDBDB'}} /> <View style={{width: 1, backgroundColor: '#DBDBDB'}} />
<View style={styles.itemTop}> <View style={styles.itemTop}>
<Text style={styles.txtTitle}>CQG</Text> <Text style={styles.txtTitle}>CQG</Text>
<Text style={styles.txtMoney}> <Text style={styles.txtMoney}>
{props.user.current_cqg_money != 0 {props.user.current_cqg_money != 0
? toPriceVnd(props.user.current_cqg_money) ? toPriceVnd(props.user.current_cqg_money)
: 0}{' '} : 0}{' '}
đ đ
</Text>
</View>
</View>
<View style={styles.wrapBody}>
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('SourceAccount')}
</Text> </Text>
{/* <View style={styles.row}> */}
<RadioForm
radio_props={radio_props}
labelStyle={{fontSize: getFontXD(42)}}
formHorizontal={true}
style={styles.row}
initial={0}
onPress={(value) => {
setSrc(value);
}}
/>
{/* </View> */}
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('ChooseBeneficiaryAccount')}
</Text>
<PickerItem
width={width - 20}
data={data}
onValueChange={(value, items) => {
setType(items);
}}
/>
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti
onChangeText={(val) => setNotes(val)}
title={I18n.t('Note')}
/>
</View> </View>
</View> </View>
<View style={styles.wrapBody}> </ScrollView>
<Text <View
style={{ style={{
fontSize: getFontXD(42), paddingVertical: 10,
color: R.colors.color777, justifyContent: 'center',
}}> alignItems: 'center',
{I18n.t('SourceAccount')} }}>
</Text> <TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
{/* <View style={styles.row}> */} <Text style={styles.txtSend}>{I18n.t('Withdraw')}</Text>
<RadioForm </TouchableOpacity>
radio_props={radio_props}
labelStyle={{fontSize: getFontXD(42)}}
formHorizontal={true}
style={styles.row}
initial={0}
onPress={(value) => {
setSrc(value);
}}
/>
{/* </View> */}
<Text
style={{
fontSize: getFontXD(42),
color: R.colors.color777,
}}>
{I18n.t('ChooseBeneficiaryAccount')}
</Text>
<PickerItem
width={width - 20}
data={data}
onValueChange={(value, items) => {
setType(items);
}}
/>
<TextMoney
onChangeText={(val) => setAmount(val)}
title={I18n.t('AmountOfMoney')}
value={amount}
/>
<TextMulti
onChangeText={(val) => setNotes(val)}
title={I18n.t('Note')}
/>
</View>
</View> </View>
<TouchableOpacity onPress={onPressWithdraw} style={styles.btnSend}>
<Text style={styles.txtSend}>{I18n.t('Withdraw')}</Text>
</TouchableOpacity>
</View> </View>
</TouchableWithoutFeedback> </TouchableWithoutFeedback>
</KeyboardAvoidingView> </KeyboardAvoidingView>
...@@ -240,9 +252,6 @@ const styles = StyleSheet.create({ ...@@ -240,9 +252,6 @@ const styles = StyleSheet.create({
fontWeight: 'bold', fontWeight: 'bold',
}, },
btnSend: { btnSend: {
position: 'absolute',
bottom: 30,
right: width / 2 - 70,
width: 140, width: 140,
height: 40, height: 40,
backgroundColor: R.colors.main, backgroundColor: R.colors.main,
......
...@@ -50,7 +50,7 @@ const ConfirmEmail = (props) => { ...@@ -50,7 +50,7 @@ const ConfirmEmail = (props) => {
<View style={styles.container}> <View style={styles.container}>
<View style={styles.wrap}> <View style={styles.wrap}>
<View style={styles.containerCode}> <View style={styles.containerCode}>
<Text style={styles.txtTitle}>`${I18n.t('EnterEmailRequest')}:`</Text> <Text style={styles.txtTitle}>{I18n.t('EnterEmailRequest')}</Text>
<TextInput <TextInput
placeholderTextColor={R.colors.placeHolder} placeholderTextColor={R.colors.placeHolder}
style={styles.txtInput} style={styles.txtInput}
......
...@@ -62,7 +62,10 @@ const Login = (props) => { ...@@ -62,7 +62,10 @@ const Login = (props) => {
}; };
const onSubmitLogin = async (email, pass) => { const onSubmitLogin = async (email, pass) => {
const titles = [I18n.t('Username').toLowerCase(), I18n.t('Password').toLowerCase()]; const titles = [
I18n.t('Username').toLowerCase(),
I18n.t('Password').toLowerCase(),
];
const index = checkFormatArray([email, pass]); const index = checkFormatArray([email, pass]);
if (index === true) { if (index === true) {
...@@ -110,14 +113,12 @@ const Login = (props) => { ...@@ -110,14 +113,12 @@ const Login = (props) => {
<InputIcon <InputIcon
icon={R.images.iconUser3} icon={R.images.iconUser3}
title={'Email'} title={'Email'}
placeholder={I18n.t('EnterEmail')}
onChangeText={(val) => setEmail(val)} onChangeText={(val) => setEmail(val)}
value={email} value={email}
/> />
<InputIcon <InputIcon
icon={R.images.iconLock} icon={R.images.iconLock}
title={'Password'} title={'Password'}
placeholder={I18n.t('EnterPassword')}
isPassWord={true} isPassWord={true}
onChangeText={(val) => setPass(val)} onChangeText={(val) => setPass(val)}
value={pass} value={pass}
......
import React, {Component, useEffect, useState} from 'react';
import {
View,
Text,
TextInput,
StyleSheet,
TouchableOpacity,
Platform,
Alert,
} from 'react-native';
import HeaderBack from '../../components/Header/HeaderBack';
import {
CodeField,
Cursor,
useBlurOnFulfill,
useClearByFocusCell,
} from 'react-native-confirmation-code-field';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../Config/Functions';
import R from '../../assets/R';
import {NEWPASSWORD} from '../../routers/ScreenNames';
import {verifyOTPApi, registorApi} from '../../apis/Functions/users';
import {useNavigation} from '@react-navigation/native';
import I18n from '../../helper/i18/i18n';
import AppText from '../../components/AppText';
import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux';
const CELL_COUNT = 4;
const ConfirmOTP = (propsa) => {
const [value, setValue] = useState('');
const navigate = useNavigation();
const ref = useBlurOnFulfill({value, cellCount: CELL_COUNT});
const [props, getCellOnLayoutHandler] = useClearByFocusCell({
value,
setValue,
});
const confirm = async () => {
if (!value) {
Alert.alert(I18n.t('Notification'), I18n.t('EnterOTPRequest'));
} else if (value.length != 4) {
Alert.alert(I18n.t('Notification'), I18n.t('OTPInvalid'));
} else {
propsa.showLoading();
const res = await verifyOTPApi({
platform: Platform.OS,
receiver_name: propsa.route.params.email,
otp: value,
});
if (res.data.code == 200) {
const {
email,
password,
password_confirmation,
phone,
sponsor_id,
} = propsa.route.params;
let res;
if (sponsor_id) {
res = await registorApi({
email,
password,
platform: Platform.OS,
password_confirmation,
sponsor_id,
phone,
});
} else {
res = await registorApi({
email,
password,
platform: Platform.OS,
password_confirmation,
phone,
});
}
propsa.hideLoading();
if (res.data.code == 200 && res.data.data) {
setTimeout(() => {
Alert.alert(
I18n.t('Notification'),
I18n.t('RegisterAccountSuccess'),
);
navigate.navigate('LOGIN');
}, 500);
} else {
setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
}
} else {
setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message);
}, 500);
}
propsa.hideLoading();
}
};
return (
<View style={{flex: 1}}>
<HeaderBack title={'VerifyOTP'} />
<View style={styles.container}>
<View style={{height: 20}} />
<View style={styles.wrap}>
<AppText i18nKey={'Verify_code'} style={styles.txtTitle} />
<View style={styles.containerCode}>
<CodeField
ref={ref}
{...props}
value={value}
onChangeText={setValue}
cellCount={CELL_COUNT}
rootStyle={styles.codeFieldRoot}
keyboardType="number-pad"
textContentType="oneTimeCode"
renderCell={({index, symbol, isFocused}) => (
<View
onLayout={getCellOnLayoutHandler(index)}
key={index}
style={[styles.cellRoot, isFocused && styles.focusCell]}>
<Text style={styles.cellText}>
{symbol || (isFocused ? <Cursor /> : null)}
</Text>
</View>
)}
/>
</View>
</View>
</View>
<View style={styles.footer}>
<TouchableOpacity onPress={confirm} style={styles.btn}>
<AppText i18nKey={'Continue'} style={styles.txtBtn} />
</TouchableOpacity>
<TouchableOpacity
style={styles.wrapFooter}
onPress={() => navigate.goBack()}>
<Text style={styles.txtNote}>{I18n.t('OTPValidFiveMinute')}</Text>
<AppText i18nKey={'Re_send'} style={styles.txtSend} />
</TouchableOpacity>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingVertical: 20,
},
footer: {
height: 200,
justifyContent: 'center',
alignItems: 'center',
},
wrap: {
flex: 1,
paddingTop: 30,
alignItems: 'center',
width: '100%',
paddingHorizontal: 50,
},
containerCode: {
height: 50,
width: '100%',
marginTop: 30,
},
codeFieldRoot: {
marginTop: 20,
},
focusCell: {
borderColor: '#000',
},
cellRoot: {
width: 40,
height: 40,
justifyContent: 'center',
alignItems: 'center',
borderBottomColor: '#ccc',
borderBottomWidth: 1,
},
cellText: {
color: '#000',
fontSize: 36,
textAlign: 'center',
},
focusCell: {
borderBottomColor: '#007AFF',
borderBottomWidth: 2,
},
txtTitle: {
fontSize: getFontXD(52),
color: '#979797',
},
btn: {
width: WIDTHXD(521),
height: HEIGHTXD(120),
borderRadius: 15,
backgroundColor: '#1C6AF6',
justifyContent: 'center',
alignItems: 'center',
},
txtBtn: {
color: R.colors.white,
fontSize: getFontXD(52),
textTransform: 'uppercase',
},
txtSend: {
fontSize: getFontXD(42),
color: '#1C6AF6',
},
wrapFooter: {
marginTop: 30,
flexDirection: 'row',
alignItems: 'center',
},
txtNote: {
color: '#A2A2A2',
fontSize: getFontXD(42),
fontStyle: 'italic',
},
});
const mapStateToProps = (state) => {
return {};
};
export default connect(mapStateToProps, {showLoading, hideLoading})(ConfirmOTP);
...@@ -13,9 +13,10 @@ import R from '../../assets/R'; ...@@ -13,9 +13,10 @@ import R from '../../assets/R';
import {checkFormatArray} from '../../Config/Functions'; import {checkFormatArray} from '../../Config/Functions';
import {showLoading, hideLoading} from '../../actions/loadingAction'; import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {registorApi} from '../../apis/Functions/users'; import {registorApi, getOTPApi} from '../../apis/Functions/users';
import I18n from '../../helper/i18/i18n'; import I18n from '../../helper/i18/i18n';
import AppText from '../../components/AppText'; import AppText from '../../components/AppText';
import {REGISTEROTP} from '../../routers/ScreenNames';
const Registor = (props) => { const Registor = (props) => {
const {navigation} = props; const {navigation} = props;
...@@ -41,34 +42,21 @@ const Registor = (props) => { ...@@ -41,34 +42,21 @@ const Registor = (props) => {
]); ]);
if (index === true) { if (index === true) {
let res;
props.showLoading(); props.showLoading();
if (sponsor_id) { const res = await getOTPApi({
res = await registorApi({ platform: Platform.OS,
email, otp_by: email,
password, });
platform: Platform.OS, props.hideLoading();
password_confirmation, console.log(res);
sponsor_id, if (res.data.code == 200) {
phone, navigation.navigate(REGISTEROTP, {
});
} else {
res = await registorApi({
email, email,
password, password,
platform: Platform.OS,
password_confirmation, password_confirmation,
phone, phone,
sponsor_id,
}); });
}
props.hideLoading();
if (res.data.code == 200 && res.data.data) {
setTimeout(() => {
Alert.alert(I18n.t('Notification'), I18n.t('RegisterAccountSuccess'));
navigation.navigate('LOGIN');
}, 500);
} else { } else {
setTimeout(() => { setTimeout(() => {
Alert.alert(I18n.t('Notification'), res.data.message); Alert.alert(I18n.t('Notification'), res.data.message);
...@@ -93,35 +81,30 @@ const Registor = (props) => { ...@@ -93,35 +81,30 @@ const Registor = (props) => {
<InputIcon <InputIcon
icon={R.images.iconEmail} icon={R.images.iconEmail}
title={'Email'} title={'Email'}
placeholder={I18n.t('EnterEmail')}
onChangeText={(val) => setEmail(val)} onChangeText={(val) => setEmail(val)}
/> />
<InputIcon <InputIcon
icon={R.images.iconLock} icon={R.images.iconLock}
title={'Password'} title={'Password'}
placeholder={I18n.t('EnterPassword')}
onChangeText={(val) => setPassword(val)} onChangeText={(val) => setPassword(val)}
isPassWord={true} isPassWord={true}
/> />
<InputIcon <InputIcon
icon={R.images.iconLock} icon={R.images.iconLock}
title={'Confirm_pass'} title={'Confirm_pass'}
placeholder={I18n.t('EnterPassword')}
onChangeText={(val) => setPasswordConfirm(val)} onChangeText={(val) => setPasswordConfirm(val)}
isPassWord={true} isPassWord={true}
/> />
<InputIcon <InputIcon
icon={R.images.iconPhone3} icon={R.images.iconPhone3}
title={'Phone'} title={'Phone'}
placeholder={I18n.t('Enter_Phone')}
onChangeText={(val) => setPhone(val)} onChangeText={(val) => setPhone(val)}
isNumber={true} isNumber={true}
/> />
<InputIcon <InputIcon
icon={R.images.iconIntroduct} icon={R.images.iconIntroduct}
title={'Code_introduce'} title={'Code_introduce'}
placeholder={I18n.t('EnterReferralCode')}
onChangeText={(val) => setSponsor_id(val)} onChangeText={(val) => setSponsor_id(val)}
/> />
......
...@@ -38,7 +38,9 @@ const Item = (props) => { ...@@ -38,7 +38,9 @@ const Item = (props) => {
<Text numberOfLines={1} style={styles.txtTitle}> <Text numberOfLines={1} style={styles.txtTitle}>
{item.note} {item.note}
</Text> </Text>
<Text style={styles.txtDate}>`${I18n.t('Date')} ${item.date}`</Text> <Text style={styles.txtDate}>
`${I18n.t('Date')} ${item.date}`
</Text>
</Block> </Block>
</Block> </Block>
</View> </View>
...@@ -76,7 +78,7 @@ const styles = StyleSheet.create({ ...@@ -76,7 +78,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(48), fontSize: getFontXD(48),
......
...@@ -89,7 +89,7 @@ const styles = StyleSheet.create({ ...@@ -89,7 +89,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txt: { txt: {
fontSize: getFontXD(36), fontSize: getFontXD(36),
......
...@@ -9,22 +9,31 @@ import I18n from '../../../../helper/i18/i18n'; ...@@ -9,22 +9,31 @@ import I18n from '../../../../helper/i18/i18n';
const Profile = (props) => { const Profile = (props) => {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.item}> {props.user.status == 3 ? (
<AppText i18nKey={'ContactCode'} style={styles.txtTitle}></AppText> <View>
<Text style={styles.txtBig}>{props.user.cqg_id}</Text> {' '}
</View> <View style={styles.item}>
<View style={styles.item}> <AppText i18nKey={'ContactCode'} style={styles.txtTitle}></AppText>
<AppText <Text style={styles.txtBig}>{props.user.cqg_id}</Text>
i18nKey={'TraddingAccountName'} </View>
style={styles.txtTitle}></AppText> <View style={styles.item}>
<Text style={styles.txtBig}>{props.user.cqg_name}</Text> <AppText
</View> i18nKey={'TraddingAccountName'}
<View style={styles.item}> style={styles.txtTitle}></AppText>
<AppText <Text style={styles.txtBig}>{props.user.cqg_name}</Text>
i18nKey={'TraddingAccountNumber'} </View>
style={styles.txtTitle}></AppText> <View style={styles.item}>
<Text style={styles.txtBig}>{props.user.account}</Text> <AppText
</View> i18nKey={'TraddingAccountNumber'}
style={styles.txtTitle}></AppText>
<Text style={styles.txtBig}>{props.user.account}</Text>
</View>
</View>
) : (
<View>
<Text>Hello</Text>
</View>
)}
</View> </View>
); );
}; };
......
...@@ -37,7 +37,9 @@ const Item = (props) => { ...@@ -37,7 +37,9 @@ const Item = (props) => {
{item.note} {item.note}
</Text> </Text>
</View> </View>
<Text style={styles.txtDate}>`${I18n.t('Date')} ${item.date}`</Text> <Text style={styles.txtDate}>
`${I18n.t('Date')} ${item.date}`
</Text>
</View> </View>
<View> <View>
<Text <Text
...@@ -86,7 +88,7 @@ const styles = StyleSheet.create({ ...@@ -86,7 +88,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -13,12 +13,6 @@ const Rose = (props) => { ...@@ -13,12 +13,6 @@ const Rose = (props) => {
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderSB title={'Rose'} /> <HeaderSB title={'Rose'} />
<TouchableOpacity onPress={() => props.changeLanguage('en')}>
<Text>Change</Text>
</TouchableOpacity>
<AppText i18nKey={'SetLanguage'}></AppText>
<View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}> <View style={{justifyContent: 'center', alignItems: 'center', flex: 1}}>
<AppText <AppText
i18nKey={'Features_develop'} i18nKey={'Features_develop'}
......
...@@ -20,9 +20,9 @@ const Item = (props) => { ...@@ -20,9 +20,9 @@ const Item = (props) => {
<Text style={styles.txtBig}>{item.title}</Text> <Text style={styles.txtBig}>{item.title}</Text>
<Block space={'between'} row flex={1}> <Block space={'between'} row flex={1}>
<Block> <Block>
<AppText style={styles.txtLeft} i18nKey={('OwnerAccount')}/> <AppText style={styles.txtLeft} i18nKey={'OwnerAccount'} />
<Text style={styles.txtLeft}>STK</Text> <Text style={styles.txtLeft}>STK</Text>
<AppText style={styles.txtLeft} i18nKey={('Branch')}/> <AppText style={styles.txtLeft} i18nKey={'Branch'} />
</Block> </Block>
<Block> <Block>
<Text style={styles.txtRight}>{item.account_name}</Text> <Text style={styles.txtRight}>{item.account_name}</Text>
...@@ -64,7 +64,7 @@ const styles = StyleSheet.create({ ...@@ -64,7 +64,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
import React from 'react'; import React from 'react';
import {View, Text, StyleSheet, TouchableOpacity, Image} from 'react-native'; import {View, Text, StyleSheet, TouchableOpacity, Image} from 'react-native';
import {getFontXD, HEIGHTXD, WIDTHXD, toPriceVnd, getWidth} from '../../Config/Functions'; import {
getFontXD,
HEIGHTXD,
WIDTHXD,
toPriceVnd,
getWidth,
} from '../../Config/Functions';
import R from '../../assets/R'; import R from '../../assets/R';
import Block from '../../components/Block'; import Block from '../../components/Block';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
...@@ -10,7 +16,11 @@ const Item = (props) => { ...@@ -10,7 +16,11 @@ const Item = (props) => {
const {item} = props; const {item} = props;
return ( return (
<TouchableOpacity onPress={() => props.onPress(item)}> <TouchableOpacity onPress={() => props.onPress(item)}>
<View style={[styles.container, {marginBottom: props.isEndItem ? HEIGHTXD(100) : HEIGHTXD(15)}]}> <View
style={[
styles.container,
{marginBottom: props.isEndItem ? HEIGHTXD(100) : HEIGHTXD(15)},
]}>
<Block flex={1} row center padding={[HEIGHTXD(10), WIDTHXD(10)]}> <Block flex={1} row center padding={[HEIGHTXD(10), WIDTHXD(10)]}>
<Image source={{uri: item.logo}} style={styles.imgIcon} /> <Image source={{uri: item.logo}} style={styles.imgIcon} />
<Block padding={[0, 10]}> <Block padding={[0, 10]}>
...@@ -55,7 +65,7 @@ const styles = StyleSheet.create({ ...@@ -55,7 +65,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -59,7 +59,7 @@ const styles = StyleSheet.create({ ...@@ -59,7 +59,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -22,7 +22,6 @@ const Item = (props) => { ...@@ -22,7 +22,6 @@ const Item = (props) => {
<View style={styles.container}> <View style={styles.container}>
<TouchableOpacity onPress={() => props.onPress(item)}> <TouchableOpacity onPress={() => props.onPress(item)}>
<Block flex={1} row> <Block flex={1} row>
<View style={styles.wrapLeft} />
<View style={styles.wrapDate}> <View style={styles.wrapDate}>
<Image source={R.images.iconRecharge} style={styles.imgIcon} /> <Image source={R.images.iconRecharge} style={styles.imgIcon} />
</View> </View>
...@@ -74,7 +73,7 @@ const styles = StyleSheet.create({ ...@@ -74,7 +73,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -72,7 +72,7 @@ const styles = StyleSheet.create({ ...@@ -72,7 +72,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -22,7 +22,6 @@ const Item = (props) => { ...@@ -22,7 +22,6 @@ const Item = (props) => {
<View style={styles.container}> <View style={styles.container}>
<TouchableOpacity onPress={() => props.onPress(item)}> <TouchableOpacity onPress={() => props.onPress(item)}>
<Block flex={1} row> <Block flex={1} row>
<View style={styles.wrapLeft} />
<View style={styles.wrapDate}> <View style={styles.wrapDate}>
<Image source={R.images.iconRecharge} style={styles.imgIcon} /> <Image source={R.images.iconRecharge} style={styles.imgIcon} />
</View> </View>
...@@ -74,7 +73,7 @@ const styles = StyleSheet.create({ ...@@ -74,7 +73,7 @@ const styles = StyleSheet.create({
}, },
wrapDate: { wrapDate: {
justifyContent: 'center', justifyContent: 'center',
paddingHorizontal: 10, paddingLeft: 10,
}, },
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
......
...@@ -106,6 +106,14 @@ const menus = [ ...@@ -106,6 +106,14 @@ const menus = [
icon: R.images.iconHistoryMenu, icon: R.images.iconHistoryMenu,
screen: HISTORY, screen: HISTORY,
}, },
{
id: '65',
title: 'PaymentSetting',
icon: R.images.iconMethodPay,
screen: METHODPAY,
active: false,
children: null,
},
], ],
}, },
{ {
...@@ -137,14 +145,6 @@ const menus = [ ...@@ -137,14 +145,6 @@ const menus = [
}, },
{ {
id: '2',
title: 'PaymentSetting',
icon: R.images.iconMethodPay,
screen: METHODPAY,
active: false,
children: null,
},
{
id: '5', id: '5',
title: 'Setting', title: 'Setting',
icon: R.images.iconSetting, icon: R.images.iconSetting,
...@@ -289,7 +289,7 @@ const styles = StyleSheet.create({ ...@@ -289,7 +289,7 @@ const styles = StyleSheet.create({
color: '#0C0D2C', color: '#0C0D2C',
}, },
txtTop: { txtTop: {
fontSize: getFontXD(42), fontSize: getFontXD(38),
color: '#1E2F70', color: '#1E2F70',
}, },
txtLink: { txtLink: {
......
...@@ -16,7 +16,6 @@ import R from '../../assets/R'; ...@@ -16,7 +16,6 @@ import R from '../../assets/R';
import {getFontXD, HEIGHT, WIDTHXD} from '../../Config/Functions'; import {getFontXD, HEIGHT, WIDTHXD} from '../../Config/Functions';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {HEIGHTXD} from '../../Config/Functions';
import Modal from 'react-native-modal'; import Modal from 'react-native-modal';
import Drawer from './Drawer'; import Drawer from './Drawer';
import SnackBar from '../SnackBar'; import SnackBar from '../SnackBar';
...@@ -108,7 +107,7 @@ const styles = StyleSheet.create({ ...@@ -108,7 +107,7 @@ const styles = StyleSheet.create({
container: { container: {
backgroundColor: 'white', backgroundColor: 'white',
height: '100%', height: '100%',
width: 300, width: WIDTHXD(780),
borderRadius: 20, borderRadius: 20,
}, },
}); });
...@@ -196,7 +196,6 @@ const HeaderHome = (props) => { ...@@ -196,7 +196,6 @@ const HeaderHome = (props) => {
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
{renderLabel(props.user.status)}
</View> </View>
</View> </View>
...@@ -252,7 +251,7 @@ export default connect(mapStateToProps, {})(HeaderHome); ...@@ -252,7 +251,7 @@ export default connect(mapStateToProps, {})(HeaderHome);
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: {}, container: {},
wrapWallet: { wrapWallet: {
height: 80, height: 70,
width: '100%', width: '100%',
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: '#EDEDF1', borderBottomColor: '#EDEDF1',
...@@ -266,7 +265,6 @@ const styles = StyleSheet.create({ ...@@ -266,7 +265,6 @@ const styles = StyleSheet.create({
}, },
containerTop: { containerTop: {
backgroundColor: 'white', backgroundColor: 'white',
height: 290,
width: '90%', width: '90%',
borderRadius: 10, borderRadius: 10,
shadowColor: '#000', shadowColor: '#000',
...@@ -296,8 +294,8 @@ const styles = StyleSheet.create({ ...@@ -296,8 +294,8 @@ const styles = StyleSheet.create({
resizeMode: 'contain', resizeMode: 'contain',
}, },
imgIconCopy: { imgIconCopy: {
width: WIDTHXD(134), width: WIDTHXD(100),
height: HEIGHTXD(134), height: HEIGHTXD(100),
resizeMode: 'contain', resizeMode: 'contain',
}, },
...@@ -319,9 +317,9 @@ const styles = StyleSheet.create({ ...@@ -319,9 +317,9 @@ const styles = StyleSheet.create({
color: '#A2A2A2', color: '#A2A2A2',
}, },
imgAvatar: { imgAvatar: {
width: WIDTHXD(240), width: WIDTHXD(180),
height: WIDTHXD(240), height: WIDTHXD(180),
borderRadius: WIDTHXD(120), borderRadius: WIDTHXD(90),
}, },
txtMoney: { txtMoney: {
fontSize: getFontXD(62), fontSize: getFontXD(62),
...@@ -338,7 +336,7 @@ const styles = StyleSheet.create({ ...@@ -338,7 +336,7 @@ const styles = StyleSheet.create({
}, },
wrapRight: { wrapRight: {
flex: 1, flex: 1,
paddingHorizontal: 20, paddingLeft: 10,
}, },
containerInfor: { containerInfor: {
flex: 1, flex: 1,
...@@ -348,6 +346,8 @@ const styles = StyleSheet.create({ ...@@ -348,6 +346,8 @@ const styles = StyleSheet.create({
borderBottomColor: '#EDEDF1', borderBottomColor: '#EDEDF1',
flexDirection: 'row', flexDirection: 'row',
paddingHorizontal: 20, paddingHorizontal: 20,
paddingVertical: 10,
}, },
row: { row: {
flexDirection: 'row', flexDirection: 'row',
...@@ -358,6 +358,7 @@ const styles = StyleSheet.create({ ...@@ -358,6 +358,7 @@ const styles = StyleSheet.create({
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
marginTop: 5,
}, },
containerWallet: { containerWallet: {
justifyContent: 'center', justifyContent: 'center',
......
...@@ -34,8 +34,8 @@ export default { ...@@ -34,8 +34,8 @@ export default {
RevenueDonors: 'Doanh thu nhà tài trợ', RevenueDonors: 'Doanh thu nhà tài trợ',
Invset: 'Đầu tư', Invset: 'Đầu tư',
Contract: 'Hợp đồng', Contract: 'Hợp đồng',
PaymentSetting: 'Cài đặt phương thức thanh toán', PaymentSetting: 'Phương thức thanh toán',
CustomerCare: 'Chăm sóc khách hàng', CustomerCare: 'Tư vấn khách hàng',
Feedback: 'Phản hồi', Feedback: 'Phản hồi',
LegalDocument: 'Giấy tờ pháp lý', LegalDocument: 'Giấy tờ pháp lý',
Setting: 'Cài đặt', Setting: 'Cài đặt',
......
...@@ -66,3 +66,4 @@ export const LEGALPARTNER = 'LEGALPARTNER'; ...@@ -66,3 +66,4 @@ export const LEGALPARTNER = 'LEGALPARTNER';
export const HISTORYDETAIL = 'HISTORYDETAIL'; export const HISTORYDETAIL = 'HISTORYDETAIL';
export const PRODUCTDETAIL = 'PRODUCTDETAIL'; export const PRODUCTDETAIL = 'PRODUCTDETAIL';
export const REGISTEROTP = 'REGISTEROTP';
...@@ -46,6 +46,7 @@ import Partner from '../Screens/LegalDocument/Partner'; ...@@ -46,6 +46,7 @@ import Partner from '../Screens/LegalDocument/Partner';
import SnackBar from '../components/SnackBar'; import SnackBar from '../components/SnackBar';
import DetailHistory from '../Screens/Action/History/DetailHistory'; import DetailHistory from '../Screens/Action/History/DetailHistory';
import ProductDetail from '../Screens/Transaction/ProductDetail/ProductDetail'; import ProductDetail from '../Screens/Transaction/ProductDetail/ProductDetail';
import RegisterOTP from '../Screens/Authen/RegisterOTP';
import * as ScreenName from './ScreenNames'; import * as ScreenName from './ScreenNames';
...@@ -67,6 +68,7 @@ function MyStack(props) { ...@@ -67,6 +68,7 @@ function MyStack(props) {
<Stack.Screen name={ScreenName.HISTORYDETAIL} component={DetailHistory} /> <Stack.Screen name={ScreenName.HISTORYDETAIL} component={DetailHistory} />
<Stack.Screen name={ScreenName.LEGALDOCUMENT} component={LegaDocument} /> <Stack.Screen name={ScreenName.LEGALDOCUMENT} component={LegaDocument} />
<Stack.Screen name={ScreenName.NOTIFICATION} component={Notification} /> <Stack.Screen name={ScreenName.NOTIFICATION} component={Notification} />
<Stack.Screen name={ScreenName.REGISTEROTP} component={RegisterOTP} />
<Stack.Screen name={ScreenName.LEGALBUSINESS} component={Business} /> <Stack.Screen name={ScreenName.LEGALBUSINESS} component={Business} />
<Stack.Screen name={ScreenName.LEGALCUSTOMER} component={Customer} /> <Stack.Screen name={ScreenName.LEGALCUSTOMER} component={Customer} />
......
import React, {useEffect} from 'react'; import React, {useEffect} from 'react';
import {View, Text} from 'react-native'; import {View, Text, Linking} from 'react-native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import Icon from 'react-native-vector-icons/FontAwesome5'; import Icon from 'react-native-vector-icons/FontAwesome5';
import Ionicons from 'react-native-vector-icons/Ionicons'; import Ionicons from 'react-native-vector-icons/Ionicons';
...@@ -22,6 +22,7 @@ import I18n from '../helper/i18/i18n'; ...@@ -22,6 +22,7 @@ import I18n from '../helper/i18/i18n';
import {changeLanguage} from '../actions/language'; import {changeLanguage} from '../actions/language';
import KEY from '../assets/AsynStorage'; import KEY from '../assets/AsynStorage';
import AsyncStorage from '@react-native-community/async-storage'; import AsyncStorage from '@react-native-community/async-storage';
import {DETAILNEW} from '../routers/ScreenNames';
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
...@@ -33,11 +34,35 @@ const TabNavigator = (props) => { ...@@ -33,11 +34,35 @@ const TabNavigator = (props) => {
const navigate = useNavigation(); const navigate = useNavigation();
useEffect(() => { useEffect(() => {
setInitLanguage(); setInitLanguage();
checkDeepking();
setTimeout(() => { setTimeout(() => {
showPopUp(); showPopUp();
}, 3000); }, 3000);
}, []); }, []);
const checkDeepking = () => {
Linking.getInitialURL().then((url) => {
if (url) deeplinkScreen(url);
});
Linking.addEventListener('url', (url) => {
if (url) handleOpenURL(url);
});
};
const handleOpenURL = (event) => {
deeplinkScreen(event.url);
};
const deeplinkScreen = (url) => {
const route = url.replace(/.*?:\/\//g, '');
const id = route.match(/\/([^\/]+)\/?$/)[1];
const root = route.split('/')[0];
// const routeName = route.split('/')[1];
if (root == 'screen') {
navigate.navigate(DETAILNEW, {id});
}
};
useEffect(() => { useEffect(() => {
checkScreenInit(); checkScreenInit();
}, [props.screenInit]); }, [props.screenInit]);
......
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