Commit fb0f1c10 by Giang Tran

edit moment

parent 75bb4dfc
......@@ -28,7 +28,12 @@ import {showLoading, hideLoading} from '../../actions/loadingAction';
import {connect} from 'react-redux';
import {showAlert, TYPE} from '../../components/DropdownAlert';
import CountDown from '../../components/CountDown';
import {verifyOTPApiSmart} from '../../apis/Functions/users';
import {
verifyOTPApiSmart,
getOTPApi,
verifyStoreOTPApiSmart,
getOTPApiSmartOTP,
} from '../../apis/Functions/users';
const CELL_COUNT = 4;
......@@ -45,10 +50,11 @@ const ConfirmOTPSmart = (propsa) => {
const getOTP = async () => {
propsa.showLoading();
const res = await getOTPApi({
const res = await getOTPApiSmartOTP({
platform: Platform.OS,
otp_by: propsa.route.params.email,
type: 'FORGOT_PASSWORD',
otp_by: propsa.user.email,
otp_password: '1234',
type: 'CREATE_OTP_PASSWORD',
});
propsa.hideLoading();
if (res.data.code == 200) {
......@@ -66,13 +72,14 @@ const ConfirmOTPSmart = (propsa) => {
showAlert(TYPE.WARN, I18n.t('Notification'), I18n.t('OTPInvalid'));
} else {
propsa.showLoading();
const res = await verifyOTPApiSmart({
const res = await verifyStoreOTPApiSmart({
platform: Platform.OS,
password: propsa.route.params.password,
password_confirmation: propsa.route.params.password_confirmation,
otp: value,
type: 'FORGOT_PASSWORD',
type: 'CREATE_OTP_PASSWORD',
});
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
propsa.hideLoading();
if (res.data.code == 200) {
navigate.navigate(TABNAVIGATOR);
......@@ -212,7 +219,9 @@ const styles = StyleSheet.create({
});
const mapStateToProps = (state) => {
return {};
return {
user: state.userReducer,
};
};
export default connect(mapStateToProps, {showLoading, hideLoading})(
......
......@@ -43,6 +43,7 @@ const SettingOTP = (props) => {
});
props.hideLoading();
if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
navigatiton.navigate(CONFIRMOTPSMART, {
password,
password_confirmation,
......@@ -75,7 +76,11 @@ const SettingOTP = (props) => {
onChangeText={(val) => setPassword(val)}
maxLength={4}
isNumber={true}
title={I18n.t('PassGetSmartOTP')}
title={
props.language.language == 'vi'
? 'Mật khẩu lấy Smart OTP'
: I18n.t('PassGetSmartOTP')
}
isPassWord={true}
/>
<TextField
......@@ -83,7 +88,11 @@ const SettingOTP = (props) => {
isNumber={true}
isPassWord={true}
onChangeText={(val) => setPassword_confirmation(val)}
title={I18n.t('ConfirmPassGetSmartOTP')}
title={
props.language.language == 'vi'
? 'Xác nhận mật khẩu lấy Smart OTP'
: I18n.t('ConfirmPassGetSmartOTP')
}
/>
</View>
<View>
......@@ -97,6 +106,7 @@ const SettingOTP = (props) => {
const mapStateToProps = (state) => {
return {
user: state.userReducer,
language: state.languageReducer,
};
};
......
......@@ -38,17 +38,7 @@ const SmartOTPConfig = (props) => {
</View>
<Icon name={'right'} size={20} color={R.colors.color777} />
</TouchableOpacity>
) : (
<TouchableOpacity
onPress={() => navigation.navigate(SETTINGOTP)}
style={styles.container}>
<Image style={styles.imgIcon} source={R.images.changeSmart} />
<View style={{flex: 1, justifyContent: 'center'}}>
<AppText i18nKey={'AddSmartOTP'} />
</View>
<Icon name={'right'} size={20} color={R.colors.color777} />
</TouchableOpacity>
)}
) : null}
<TouchableOpacity
onPress={() => navigation.navigate(RULESSMARTOTP)}
......
......@@ -7,7 +7,7 @@ const FAQs = (props) => {
<View style={{flex: 1}}>
<HeaderBack isWhite={true} title={'FAQs'} />
<WebView
androidHardwareAccelerationDisabled={true}
// androidHardwareAccelerationDisabled={true}
source={{
uri: 'http://api.dcvinvest.com/webview/smart-otp/faqs',
}}
......
......@@ -8,7 +8,7 @@ const RulesSmartOTP = (props) => {
<View style={{flex: 1}}>
<HeaderBack isWhite={true} title={'Rules'} />
<WebView
androidHardwareAccelerationDisabled={true}
// androidHardwareAccelerationDisabled={true}
source={{
uri: 'http://api.dcvinvest.com/webview/smart-otp/term-and-condition',
}}
......
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