Commit 90242d0a by Giang Tran

push code

parent b404a8ba
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "Invest-tvOS.app"
BlueprintName = "Invest-tvOS"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
BuildableName = "Invest-tvOSTests.xctest"
BlueprintName = "Invest-tvOSTests"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "Invest-tvOS.app"
BlueprintName = "Invest-tvOS"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
BuildableName = "Invest-tvOS.app"
BlueprintName = "Invest-tvOS"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "Invest.app"
BlueprintName = "Invest"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "InvestTests.xctest"
BlueprintName = "InvestTests"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "Invest.app"
BlueprintName = "Invest"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "Invest.app"
BlueprintName = "Invest"
ReferencedContainer = "container:Invest.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -33,7 +33,7 @@ const EnterPasswordSmartOTP = (props) => {
setFourNumber(number.toString());
}
};
console.log('Pros pass', props.route.params);
const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
setFirstNumber(null);
......@@ -43,6 +43,7 @@ const EnterPasswordSmartOTP = (props) => {
navigation.navigate(CONFIRMCHANGESMARTOTP, {
pre_otp: pinCode,
old_password: props.route.params.old_password,
TYPE: props.route.params.TYPE,
});
};
const onDeletePress = () => {
......
import React, {useState, useEffect} from 'react';
import ConfirmSmartOTPView from './ConfirmSmartOTPView';
import {updateOTPApiSmart} from '../../../apis/Functions/users';
import {
updateOTPApiSmart,
getOTPApiSmartOTP,
} from '../../../apis/Functions/users';
import {showAlert, TYPE} from '../../../components/DropdownAlert';
import {connect} from 'react-redux';
import {hideLoading, showLoading} from '../../../actions/loadingAction';
import I18n from '../../../helper/i18/i18n';
import {SMARTOTPCONFIG, TABNAVIGATOR} from '../../../routers/ScreenNames';
import {
SMARTOTPCONFIG,
TABNAVIGATOR,
CONFIRMCREATEOTP,
} from '../../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native';
const ConfirmChangeSmartOTP = (props) => {
......@@ -31,29 +38,52 @@ const ConfirmChangeSmartOTP = (props) => {
}
};
console.log('Pros pass', props.route.params);
const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
props.showLoading();
const res = await updateOTPApiSmart({
platform: Platform.OS,
password: props.route.params.pre_otp,
password_confirmation: pinCode,
old_password: props.route.params.old_password,
});
props.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
navigation.navigate(SMARTOTPCONFIG);
if (props.route.params.TYPE == 'CHANGE_SMART_OTP') {
props.showLoading();
const res = await updateOTPApiSmart({
platform: Platform.OS,
password: props.route.params.pre_otp,
password_confirmation: pinCode,
old_password: props.route.params.old_password,
});
props.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
navigation.navigate(SMARTOTPCONFIG);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
}
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
props.showLoading();
const res = await getOTPApiSmartOTP({
platform: Platform.OS,
otp_by: props.user.email,
otp_password: '1234',
type: 'CREATE_OTP_PASSWORD',
});
props.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
navigation.navigate(CONFIRMCREATEOTP, {
password: props.route.params.pre_otp,
password_confirmation: pinCode,
});
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
}
};
const onDeletePress = () => {
......
import React, {useState, useEffect} from 'react';
import ConfirmCreateView from './ConfirmCreateView';
import {verifyStoreOTPApiSmart} from '../../../apis/Functions/users';
import {showAlert, TYPE} from '../../../components/DropdownAlert';
import {connect} from 'react-redux';
import {hideLoading, showLoading} from '../../../actions/loadingAction';
import I18n from '../../../helper/i18/i18n';
import {useNavigation} from '@react-navigation/native';
import {
CONFIRMCHANGESMARTOTP,
TABNAVIGATOR,
} from '../../../routers/ScreenNames';
const EnterPasswordSmartOTP = (props) => {
const navigation = useNavigation();
const [firstNumber, setFirstNumber] = useState(null);
const [secondsNumber, setSecondsNumber] = useState(null);
const [thirdNumber, setThirdNumber] = useState(null);
const [fourNumber, setFourNumber] = useState(null);
useEffect(() => {
if (fourNumber) {
onCheckPINSmartOTPPin();
}
}, [fourNumber]);
const onNumberPress = (number) => {
if (!firstNumber) {
setFirstNumber(number.toString());
} else if (!secondsNumber) {
setSecondsNumber(number.toString());
} else if (!thirdNumber) {
setThirdNumber(number.toString());
} else if (!fourNumber) {
setFourNumber(number.toString());
}
};
const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
props.showLoading();
const res = await verifyStoreOTPApiSmart({
platform: Platform.OS,
password: props.route.params.password,
password_confirmation: props.route.params.password_confirmation,
otp: pinCode,
type: 'CREATE_OTP_PASSWORD',
});
props.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
navigation.navigate(TABNAVIGATOR);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
}
};
const onDeletePress = () => {
if (fourNumber) {
setFourNumber(null);
} else if (thirdNumber) {
setThirdNumber(null);
} else if (secondsNumber) {
setSecondsNumber(null);
} else if (firstNumber) {
setFirstNumber(null);
}
};
return (
<ConfirmCreateView
firstNumber={firstNumber}
secondsNumber={secondsNumber}
thirdNumber={thirdNumber}
fourNumber={fourNumber}
onNumberPress={onNumberPress}
onDeletePress={onDeletePress}
/>
);
};
const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {showLoading, hideLoading})(
EnterPasswordSmartOTP,
);
import React from 'react';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import HeaderBack from '../../../components/Header/HeaderBack';
import {getFontXD, HEIGHTXD, WIDTHXD} from '../../../Config/Functions';
import I18n from '../../../helper/i18/i18n';
import R from '../../../assets/R';
import Icon from 'react-native-vector-icons/FontAwesome5';
const ChangeSmartOTPView = (props) => {
return (
<View style={{flex: 1, colorBackground: R.colors.white}}>
<HeaderBack title={'ChangeSmartOTP'} />
<Text style={[styles.textNormal, {marginTop: HEIGHTXD(40)}]}>
{I18n.t('EnterOTPRequest')}
</Text>
<View style={[styles.rowNumber]}>
<View
style={[
styles.indicator,
{
backgroundColor: props.firstNumber
? R.colors.main
: R.colors.white,
},
]}
/>
<View
style={[
styles.indicator,
{
backgroundColor: props.secondsNumber
? R.colors.main
: R.colors.white,
},
]}
/>
<View
style={[
styles.indicator,
{
backgroundColor: props.thirdNumber
? R.colors.main
: R.colors.white,
},
]}
/>
<View
style={[
styles.indicator,
{
backgroundColor: props.fourNumber
? R.colors.main
: R.colors.white,
},
]}
/>
</View>
<View style={[styles.rowNumber, {marginTop: HEIGHTXD(80)}]}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(1);
}}
style={styles.btnNumber}>
<Text style={styles.textNumber}>1</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(2);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>2</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(3);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>3</Text>
</TouchableOpacity>
</View>
<View style={styles.rowNumber}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(4);
}}
style={styles.btnNumber}>
<Text style={styles.textNumber}>4</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(5);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>5</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(6);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>6</Text>
</TouchableOpacity>
</View>
<View style={styles.rowNumber}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(7);
}}
style={styles.btnNumber}>
<Text style={styles.textNumber}>7</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(8);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>8</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onNumberPress(9);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(40)}]}>
<Text style={styles.textNumber}>9</Text>
</TouchableOpacity>
</View>
<View style={styles.rowNumber}>
<TouchableOpacity
onPress={() => {
props.onNumberPress(0);
}}
style={[styles.btnNumber, {marginLeft: WIDTHXD(300)}]}>
<Text style={styles.textNumber}>0</Text>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
props.onDeletePress();
}}
style={{
width: HEIGHTXD(260),
height: HEIGHTXD(260),
marginLeft: WIDTHXD(40),
justifyContent: 'center',
alignItems: 'center',
}}>
<Icon name={'backspace'} size={HEIGHTXD(80)} color={'#8E8C8C'} />
</TouchableOpacity>
</View>
</View>
);
};
export default ChangeSmartOTPView;
const styles = StyleSheet.create({
btnSend: {
height: HEIGHTXD(80),
justifyContent: 'center',
alignItems: 'center',
},
rowNumber: {
flexDirection: 'row',
justifyContent: 'center',
marginTop: HEIGHTXD(40),
},
btnNumber: {
height: HEIGHTXD(260),
width: HEIGHTXD(260),
justifyContent: 'center',
alignItems: 'center',
borderWidth: 0.3,
borderColor: R.colors.gray6,
borderRadius: HEIGHTXD(130),
},
indicator: {
height: HEIGHTXD(50),
width: HEIGHTXD(50),
borderWidth: 0.3,
borderColor: R.colors.gray6,
borderRadius: HEIGHTXD(35),
marginHorizontal: WIDTHXD(20),
},
textNormal: {
fontSize: getFontXD(39),
color: R.colors.black,
textAlign: 'center',
},
textNumber: {
fontSize: getFontXD(90),
color: R.colors.black,
textAlign: 'center',
},
txtSend: {
fontSize: getFontXD(42),
color: R.colors.main,
},
});
......@@ -10,107 +10,110 @@ import {useNavigation} from '@react-navigation/native';
import {RESET_SMART_OTP, CHANGESMARTOTP} from '../../routers/ScreenNames';
const EnterPasswordSmartOTP = (props) => {
const navigation = useNavigation();
const [firstNumber, setFirstNumber] = useState(null);
const [secondsNumber, setSecondsNumber] = useState(null);
const [thirdNumber, setThirdNumber] = useState(null);
const [fourNumber, setFourNumber] = useState(null);
useEffect(() => {
if (fourNumber) {
onCheckPINSmartOTPPin();
}
}, [fourNumber]);
const onNumberPress = (number) => {
if (!firstNumber) {
setFirstNumber(number.toString());
} else if (!secondsNumber) {
setSecondsNumber(number.toString());
} else if (!thirdNumber) {
setThirdNumber(number.toString());
} else if (!fourNumber) {
setFourNumber(number.toString());
}
};
const navigation = useNavigation();
const [firstNumber, setFirstNumber] = useState(null);
const [secondsNumber, setSecondsNumber] = useState(null);
const [thirdNumber, setThirdNumber] = useState(null);
const [fourNumber, setFourNumber] = useState(null);
useEffect(() => {
if (fourNumber) {
onCheckPINSmartOTPPin();
}
}, [fourNumber]);
const onNumberPress = (number) => {
if (!firstNumber) {
setFirstNumber(number.toString());
} else if (!secondsNumber) {
setSecondsNumber(number.toString());
} else if (!thirdNumber) {
setThirdNumber(number.toString());
} else if (!fourNumber) {
setFourNumber(number.toString());
}
};
const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
props.showLoading();
if (props.route.params.type == 'CHANGE_SMART_OTP') {
const res = await verifyOTPApiSmart({
platform: Platform.OS,
otp_password: pinCode,
type: 'VERIFY_OTP_PASSWORD',
});
if (res.data.code == 200) {
navigation.navigate(CHANGESMARTOTP, {old_password: pinCode});
clearPIN()
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
clearPIN()
}
} else {
const res = await getOTPApiSmartOTP({
platform: Platform.OS,
otp_by: props.user.email,
otp_password: pinCode,
type:
props.route.params.type == 'DEPOSIT'
? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT
: OTP_TYPE.REQUEST_WITHDRAW,
});
const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
props.showLoading();
if (props.route.params.type == 'CHANGE_SMART_OTP') {
const res = await verifyOTPApiSmart({
platform: Platform.OS,
otp_password: pinCode,
type: 'VERIFY_OTP_PASSWORD',
});
if (res.data.code == 200) {
navigation.navigate(CHANGESMARTOTP, {
old_password: pinCode,
TYPE: 'CHANGE_SMART_OTP',
});
clearPIN();
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
clearPIN();
}
} else {
const res = await getOTPApiSmartOTP({
platform: Platform.OS,
otp_by: props.user.email,
otp_password: pinCode,
type:
props.route.params.type == 'DEPOSIT'
? OTP_TYPE.CUSTOMER_REQUEST_DEPOSIT
: OTP_TYPE.REQUEST_WITHDRAW,
});
if (res.data.code == 200) {
props.route.params.onGoToSmartOTP(pinCode, res.data.data.otp);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
clearPIN()
}
}
props.hideLoading();
};
const clearPIN = () => {
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
if (res.data.code == 200) {
props.route.params.onGoToSmartOTP(pinCode, res.data.data.otp);
} else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
clearPIN();
}
}
props.hideLoading();
};
const clearPIN = () => {
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
};
const onDeletePress = () => {
if (fourNumber) {
setFourNumber(null);
} else if (thirdNumber) {
setThirdNumber(null);
} else if (secondsNumber) {
setSecondsNumber(null);
} else if (firstNumber) {
setFirstNumber(null);
}
const onDeletePress = () => {
if (fourNumber) {
setFourNumber(null);
} else if (thirdNumber) {
setThirdNumber(null);
} else if (secondsNumber) {
setSecondsNumber(null);
} else if (firstNumber) {
setFirstNumber(null);
}
};
const onReactivationSmartOTP = () => {
navigation.navigate(RESET_SMART_OTP, {title: 'ReactivationSmartOTP'});
};
};
const onReactivationSmartOTP = () => {
navigation.navigate(RESET_SMART_OTP, {title: 'ReactivationSmartOTP'});
};
const onForgotPINCode = () => {
navigation.navigate(RESET_SMART_OTP, {title: 'ForgotSmartOTP'});
};
return (
<EnterPasswordSmartOTPView
firstNumber={firstNumber}
secondsNumber={secondsNumber}
thirdNumber={thirdNumber}
fourNumber={fourNumber}
onNumberPress={onNumberPress}
onDeletePress={onDeletePress}
onForgotPINCode={onForgotPINCode}
onReactivationSmartOTP={onReactivationSmartOTP}
/>
);
const onForgotPINCode = () => {
navigation.navigate(RESET_SMART_OTP, {title: 'ForgotSmartOTP'});
};
return (
<EnterPasswordSmartOTPView
firstNumber={firstNumber}
secondsNumber={secondsNumber}
thirdNumber={thirdNumber}
fourNumber={fourNumber}
onNumberPress={onNumberPress}
onDeletePress={onDeletePress}
onForgotPINCode={onForgotPINCode}
onReactivationSmartOTP={onReactivationSmartOTP}
/>
);
};
const mapStateToProps = (state) => {
return {
user: state.userReducer,
};
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {showLoading, hideLoading})(
EnterPasswordSmartOTP,
EnterPasswordSmartOTP,
);
......@@ -93,3 +93,5 @@ export const CONFIRMCHANGESMARTOTP = 'CONFIRMCHANGESMARTOTP';
export const RULESSMARTOTP = 'RULESSMARTOTP';
export const FAQSSMARTOTP = 'FAQSSMARTOTP';
export const CONFIRMCREATEOTP = 'CONFIRMCREATEOTP';
......@@ -67,6 +67,7 @@ import ConfirmChangeSmartOTP from '../Screens/SmartOTP/ChangeSmartOTP/ConfirmCha
import FAQs from '../Screens/SmartOTP/WebView/FAQs';
import RulesSmartOTP from '../Screens/SmartOTP/WebView/RulesSmartOTP';
import ConfirmCreate from '../Screens/SmartOTP/ConfirmCreate/ConfirmCreate';
import * as ScreenName from './ScreenNames';
......@@ -86,9 +87,14 @@ function MyStack(props) {
headerMode={'none'}
initialRouteName={ScreenName.AUTHEN}>
<Stack.Screen
name={ScreenName.CONFIRMCREATEOTP}
component={ConfirmCreate}
/>
<Stack.Screen
name={ScreenName.CACULATEDDEPOSIT}
component={CaculatedDeposit}
/>
<Stack.Screen
name={ScreenName.CONFIRMOTPSMART}
component={ConfirmOTPSmart}
......@@ -172,8 +178,14 @@ function MyStack(props) {
<Stack.Screen name={ScreenName.NEWPASSWORD} component={NewPassWord} />
<Stack.Screen name={ScreenName.PRODUCTDETAIL} component={ProductDetail} />
<Stack.Screen name={ScreenName.SMARTOTP} component={SmartOTP} />
<Stack.Screen name={ScreenName.ENTER_PASSWORD_SMART_OTP} component={EnterPasswordSmartOTP} />
<Stack.Screen name={ScreenName.RESET_SMART_OTP} component={ResetSmartOTP} />
<Stack.Screen
name={ScreenName.ENTER_PASSWORD_SMART_OTP}
component={EnterPasswordSmartOTP}
/>
<Stack.Screen
name={ScreenName.RESET_SMART_OTP}
component={ResetSmartOTP}
/>
<Stack.Screen name={ScreenName.FAQSSMARTOTP} component={FAQs} />
<Stack.Screen name={ScreenName.RULESSMARTOTP} component={RulesSmartOTP} />
......
......@@ -21,6 +21,7 @@ import {
AccountVerification,
PACKETCQG,
SETTINGOTP,
CHANGESMARTOTP,
} from '../routers/ScreenNames';
import I18n, {setLocation} from '../helper/i18/i18n';
import {changeLanguage} from '../actions/language';
......@@ -104,13 +105,16 @@ const TabNavigator = (props) => {
return confirmAlert(I18n.t('PopupVerifyAccount'), () => {
navigate.navigate(AccountVerification);
});
} else if (!props.user.smart_otp_status) {
} else if (props.user.smart_otp_status) {
return confirmAlert(
props.language.language == 'vi'
? 'Bạn có muốn cài đặt Smart OTP?'
: 'Do you want setting Smart OTP?',
() => {
navigate.navigate(SETTINGOTP);
navigate.navigate(CHANGESMARTOTP, {
TYPE: 'CREATE_SMART_OTP',
old_password: null,
});
},
);
} else if (props.user.status == 3 && !props.user.contract_code) {
......
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