Commit f56615fc authored by Fred's avatar Fred

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
parents d67d0464 3ec8a25b
...@@ -41,7 +41,8 @@ const ActionType = { ...@@ -41,7 +41,8 @@ const ActionType = {
SET_EDIT_NOTE:'SET_EDIT_NOTE', SET_EDIT_NOTE:'SET_EDIT_NOTE',
SET_HOME_ADDRESS:'SET_HOME_ADDRESS', SET_HOME_ADDRESS:'SET_HOME_ADDRESS',
SET_REEDEM :'SET_REEDEM', SET_REEDEM :'SET_REEDEM',
REMOVE_VOUCHER : 'REMOVE_VOUCHER' REMOVE_VOUCHER : 'REMOVE_VOUCHER',
SET_CHANGE_RESET_PASSWORD : 'SET_CHANGE_RESET_PASSWORD'
} }
export default ActionType; export default ActionType;
\ No newline at end of file
...@@ -86,7 +86,9 @@ const globalState = { ...@@ -86,7 +86,9 @@ const globalState = {
voucher: [], voucher: [],
value_voucher: '', value_voucher: '',
home_address: '', home_address: '',
outlet_detailadress: '' outlet_detailadress: '',
isSubmitResetPassword: false
} }
...@@ -106,6 +108,12 @@ const rootReducer = (state = globalState, action) => { ...@@ -106,6 +108,12 @@ const rootReducer = (state = globalState, action) => {
isEmailverif: action.data.isEmailverif, isEmailverif: action.data.isEmailverif,
} }
} }
case ActionType.SET_CHANGE_RESET_PASSWORD: {
return {
...state,
isSubmitResetPassword: action.data.isSubmitResetPassword,
}
}
case ActionType.SET_TYPE: { case ActionType.SET_TYPE: {
if (action.data.type_pickup) { if (action.data.type_pickup) {
delivery_amount = 0 delivery_amount = 0
......
...@@ -2,6 +2,7 @@ import React from 'react'; ...@@ -2,6 +2,7 @@ import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, Alert, TouchableOpacity, Image } from 'react-native'; import { View, Text, TextInput, StyleSheet, Button, Alert, TouchableOpacity, Image } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import ActionType from '../redux/globalActionType';
import { BASE_URL_NEW_PASSWORD } from '../model/Base_Model' import { BASE_URL_NEW_PASSWORD } from '../model/Base_Model'
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
...@@ -52,6 +53,11 @@ class NewPassword extends React.Component { ...@@ -52,6 +53,11 @@ class NewPassword extends React.Component {
} }
// console.log(params); // console.log(params);
Axios.post(BASE_URL_NEW_PASSWORD, params).then(res => { Axios.post(BASE_URL_NEW_PASSWORD, params).then(res => {
let isSubmit = {
isSubmitResetPassword: false
}
this.props.setChangeIsSubmit(isSubmit)
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
...@@ -76,7 +82,7 @@ class NewPassword extends React.Component { ...@@ -76,7 +82,7 @@ class NewPassword extends React.Component {
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}> <View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Email</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Email</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 20, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 18, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text>
...@@ -152,11 +158,23 @@ const styles = StyleSheet.create({ ...@@ -152,11 +158,23 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
console.log(JSON.stringify(state)) console.log(JSON.stringify(state))
return { return {
email: state.email email: state.email,
isSubmitResetPassword: state.isSubmitResetPassword
}
}
const mapDispatchToProps = (dispacth) => {
return {
setChangeIsSubmit: (isSubmitProps) => dispacth({
type: ActionType.SET_CHANGE_RESET_PASSWORD,
data: {
isSubmitResetPassword: isSubmitProps.isSubmitResetPassword
}
})
} }
} }
export default connect(mapStateToProps)(NewPassword); export default connect(mapStateToProps,mapDispatchToProps)(NewPassword);
......
...@@ -31,6 +31,12 @@ class ResetPassword extends React.Component { ...@@ -31,6 +31,12 @@ class ResetPassword extends React.Component {
email: this.state.email email: this.state.email
} }
this.props.setResetPassword(resetProps); this.props.setResetPassword(resetProps);
let isSubmit = {
isSubmitResetPassword: true
}
this.props.setChangeIsSubmit(isSubmit)
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
...@@ -53,7 +59,7 @@ class ResetPassword extends React.Component { ...@@ -53,7 +59,7 @@ class ResetPassword extends React.Component {
} }
handleEnterToken() { handleEnterToken() {
if (this.props.email == '') { if (this.props.isSubmitResetPassword == false) {
Alert.alert('','Harap masukan email terlebih dahulu') Alert.alert('','Harap masukan email terlebih dahulu')
} else { } else {
this.props.navigation.navigate('New Password'); this.props.navigation.navigate('New Password');
...@@ -152,7 +158,8 @@ const styles = StyleSheet.create({ ...@@ -152,7 +158,8 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
email: state.email, email: state.email,
language: state.language language: state.language,
isSubmitResetPassword: state.isSubmitResetPassword
} }
} }
...@@ -164,6 +171,12 @@ const mapDispatchToProps = (dispacth) => { ...@@ -164,6 +171,12 @@ const mapDispatchToProps = (dispacth) => {
email: registerProps.email, email: registerProps.email,
} }
}), }),
setChangeIsSubmit: (isSubmitProps) => dispacth({
type: ActionType.SET_CHANGE_RESET_PASSWORD,
data: {
isSubmitResetPassword: isSubmitProps.isSubmitResetPassword
}
})
} }
} }
......
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