Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
clone_excelso
Commits
3ec8a25b
Commit
3ec8a25b
authored
Jun 15, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update fixing forgot password
parent
87c1d9a7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
7 deletions
+47
-7
globalActionType.js
redux/globalActionType.js
+2
-1
globalReducer.js
redux/globalReducer.js
+9
-1
NewPassword.js
view/NewPassword.js
+21
-3
ResetPassword.js
view/ResetPassword.js
+15
-2
No files found.
redux/globalActionType.js
View file @
3ec8a25b
...
...
@@ -41,7 +41,8 @@ const ActionType = {
SET_EDIT_NOTE
:
'SET_EDIT_NOTE'
,
SET_HOME_ADDRESS
:
'SET_HOME_ADDRESS'
,
SET_REEDEM
:
'SET_REEDEM'
,
REMOVE_VOUCHER
:
'REMOVE_VOUCHER'
REMOVE_VOUCHER
:
'REMOVE_VOUCHER'
,
SET_CHANGE_RESET_PASSWORD
:
'SET_CHANGE_RESET_PASSWORD'
}
export
default
ActionType
;
\ No newline at end of file
redux/globalReducer.js
View file @
3ec8a25b
...
...
@@ -86,7 +86,9 @@ const globalState = {
voucher
:
[],
value_voucher
:
''
,
home_address
:
''
,
outlet_detailadress
:
''
outlet_detailadress
:
''
,
isSubmitResetPassword
:
false
}
...
...
@@ -106,6 +108,12 @@ const rootReducer = (state = globalState, action) => {
isEmailverif
:
action
.
data
.
isEmailverif
,
}
}
case
ActionType
.
SET_CHANGE_RESET_PASSWORD
:
{
return
{
...
state
,
isSubmitResetPassword
:
action
.
data
.
isSubmitResetPassword
,
}
}
case
ActionType
.
SET_TYPE
:
{
if
(
action
.
data
.
type_pickup
)
{
delivery_amount
=
0
...
...
view/NewPassword.js
View file @
3ec8a25b
...
...
@@ -2,6 +2,7 @@ import React from 'react';
import
{
View
,
Text
,
TextInput
,
StyleSheet
,
Button
,
Alert
,
TouchableOpacity
,
Image
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
Axios
from
'axios'
;
import
ActionType
from
'../redux/globalActionType'
;
import
{
BASE_URL_NEW_PASSWORD
}
from
'../model/Base_Model'
import
Spinner
from
'react-native-loading-spinner-overlay'
;
...
...
@@ -52,6 +53,11 @@ class NewPassword extends React.Component {
}
// console.log(params);
Axios
.
post
(
BASE_URL_NEW_PASSWORD
,
params
).
then
(
res
=>
{
let
isSubmit
=
{
isSubmitResetPassword
:
false
}
this
.
props
.
setChangeIsSubmit
(
isSubmit
)
this
.
setState
({
spinner
:
false
,
})
...
...
@@ -76,7 +82,7 @@ class NewPassword extends React.Component {
<
View
style
=
{{
flex
:
3
}}
>
<
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
:
'#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({
const
mapStateToProps
=
(
state
)
=>
{
console
.
log
(
JSON
.
stringify
(
state
))
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
);
...
...
view/ResetPassword.js
View file @
3ec8a25b
...
...
@@ -31,6 +31,12 @@ class ResetPassword extends React.Component {
email
:
this
.
state
.
email
}
this
.
props
.
setResetPassword
(
resetProps
);
let
isSubmit
=
{
isSubmitResetPassword
:
true
}
this
.
props
.
setChangeIsSubmit
(
isSubmit
)
this
.
setState
({
spinner
:
false
,
})
...
...
@@ -53,7 +59,7 @@ class ResetPassword extends React.Component {
}
handleEnterToken
()
{
if
(
this
.
props
.
email
==
''
)
{
if
(
this
.
props
.
isSubmitResetPassword
==
false
)
{
Alert
.
alert
(
''
,
'Harap masukan email terlebih dahulu'
)
}
else
{
this
.
props
.
navigation
.
navigate
(
'New Password'
);
...
...
@@ -152,7 +158,8 @@ const styles = StyleSheet.create({
const
mapStateToProps
=
(
state
)
=>
{
return
{
email
:
state
.
email
,
language
:
state
.
language
language
:
state
.
language
,
isSubmitResetPassword
:
state
.
isSubmitResetPassword
}
}
...
...
@@ -164,6 +171,12 @@ const mapDispatchToProps = (dispacth) => {
email
:
registerProps
.
email
,
}
}),
setChangeIsSubmit
:
(
isSubmitProps
)
=>
dispacth
({
type
:
ActionType
.
SET_CHANGE_RESET_PASSWORD
,
data
:
{
isSubmitResetPassword
:
isSubmitProps
.
isSubmitResetPassword
}
})
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment