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
4b565177
Commit
4b565177
authored
Jun 12, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benerin tombol resend email
parent
311ee6b2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
56 deletions
+88
-56
EmailConfirmation.js
view/EmailConfirmation.js
+88
-56
No files found.
view/EmailConfirmation.js
View file @
4b565177
...
@@ -17,7 +17,7 @@ class EmailConfirmation extends React.Component {
...
@@ -17,7 +17,7 @@ class EmailConfirmation extends React.Component {
}
}
}
}
componentDidMount
(){
componentDidMount
()
{
// console.log("SESSION " + this.props.session_id)
// console.log("SESSION " + this.props.session_id)
}
}
...
@@ -28,13 +28,13 @@ class EmailConfirmation extends React.Component {
...
@@ -28,13 +28,13 @@ class EmailConfirmation extends React.Component {
// console.log(this.props.isEmailverif)
// console.log(this.props.isEmailverif)
if
(
this
.
props
.
isEmailverif
===
true
)
{
if
(
this
.
props
.
isEmailverif
===
true
)
{
let
pageProps
=
{
let
pageProps
=
{
pageEmailConfirmation
:
false
pageEmailConfirmation
:
false
}
}
this
.
props
.
setPage
(
pageProps
)
this
.
props
.
setPage
(
pageProps
)
// console.log('hai ini gue kalau ada device yang sama!')
// console.log('hai ini gue kalau ada device yang sama!')
let
params
=
{
let
params
=
{
"session_id"
:
this
.
props
.
session_id
,
"session_id"
:
this
.
props
.
session_id
,
"email"
:
this
.
props
.
email
,
"email"
:
this
.
props
.
email
,
"password"
:
this
.
props
.
password
,
"password"
:
this
.
props
.
password
,
"fb_token"
:
this
.
props
.
fb_token
,
"fb_token"
:
this
.
props
.
fb_token
,
...
@@ -47,7 +47,7 @@ class EmailConfirmation extends React.Component {
...
@@ -47,7 +47,7 @@ class EmailConfirmation extends React.Component {
Axios
.
post
(
BASE_URL_LOGIN
,
params
).
then
(
res
=>
{
Axios
.
post
(
BASE_URL_LOGIN
,
params
).
then
(
res
=>
{
// console.log('EMAIL CONFIRM : ' + JSON.stringify(res))
// console.log('EMAIL CONFIRM : ' + JSON.stringify(res))
let
emailConfirmProps
=
{
let
emailConfirmProps
=
{
isEmailverif
:
false
isEmailverif
:
false
}
}
let
loginProps
=
{
let
loginProps
=
{
email
:
this
.
props
.
email
,
email
:
this
.
props
.
email
,
...
@@ -81,7 +81,7 @@ class EmailConfirmation extends React.Component {
...
@@ -81,7 +81,7 @@ class EmailConfirmation extends React.Component {
}
else
{
}
else
{
let
pageProps
=
{
let
pageProps
=
{
pageEmailConfirmation
:
false
pageEmailConfirmation
:
false
}
}
this
.
props
.
setPage
(
pageProps
)
this
.
props
.
setPage
(
pageProps
)
let
paramater
=
{
let
paramater
=
{
...
@@ -92,6 +92,7 @@ class EmailConfirmation extends React.Component {
...
@@ -92,6 +92,7 @@ class EmailConfirmation extends React.Component {
this
.
setState
({
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
})
console
.
log
(
'masuk pak eko'
)
// this.props.navigation.reset("Login");
// this.props.navigation.reset("Login");
this
.
props
.
navigation
.
reset
({
this
.
props
.
navigation
.
reset
({
index
:
0
,
index
:
0
,
...
@@ -112,9 +113,9 @@ class EmailConfirmation extends React.Component {
...
@@ -112,9 +113,9 @@ class EmailConfirmation extends React.Component {
}
}
}
}
handleCancel
(){
handleCancel
()
{
let
pageProps
=
{
let
pageProps
=
{
pageEmailConfirmation
:
false
pageEmailConfirmation
:
false
}
}
this
.
props
.
setPage
(
pageProps
)
this
.
props
.
setPage
(
pageProps
)
this
.
props
.
navigation
.
navigate
(
'New Register'
);
this
.
props
.
navigation
.
navigate
(
'New Register'
);
...
@@ -124,12 +125,40 @@ class EmailConfirmation extends React.Component {
...
@@ -124,12 +125,40 @@ class EmailConfirmation extends React.Component {
this
.
setState
({
this
.
setState
({
spinner
:
true
,
spinner
:
true
,
})
})
if
(
this
.
props
.
proses
!==
'Register'
)
{
let
params
=
{
"email"
:
this
.
props
.
email
,
"password"
:
this
.
props
.
password
,
"fb_token"
:
this
.
props
.
fb_token
,
"device_id"
:
this
.
props
.
device_id
,
"os_name"
:
this
.
props
.
os_name
,
"os_version"
:
this
.
props
.
os_version
,
"app_version"
:
this
.
props
.
app_version
,
}
// console.log(params)
Axios
.
post
(
BASE_URL_LOGIN
,
params
).
then
(
res
=>
{
this
.
setState
({
spinner
:
false
,
})
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
;
Alert
.
alert
(
''
,
'Silahkan Cek Email Kembali'
);
this
.
setState
({
spinner
:
false
,
})
})
}
else
{
let
paramater
=
{
let
paramater
=
{
"email"
:
this
.
props
.
email
,
"email"
:
this
.
props
.
email
,
"registration_id"
:
this
.
props
.
registration_id
,
"registration_id"
:
this
.
props
.
registration_id
,
}
}
let
pageProps
=
{
let
pageProps
=
{
pageEmailConfirmation
:
false
pageEmailConfirmation
:
false
}
}
this
.
props
.
setPage
(
pageProps
)
this
.
props
.
setPage
(
pageProps
)
...
@@ -149,10 +178,12 @@ class EmailConfirmation extends React.Component {
...
@@ -149,10 +178,12 @@ class EmailConfirmation extends React.Component {
this
.
setState
({
this
.
setState
({
spinner
:
false
,
spinner
:
false
,
})
})
Alert
.
alert
(
response
.
msg
)
Alert
.
alert
(
''
,
response
.
msg
)
})
})
}
}
}
render
()
{
render
()
{
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
...
@@ -180,10 +211,10 @@ class EmailConfirmation extends React.Component {
...
@@ -180,10 +211,10 @@ class EmailConfirmation extends React.Component {
<
Text
style
=
{{
alignSelf
:
'center'
,
top
:
10
,
color
:
'white'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
}}
>
CANCEL
<
/Text
>
<
Text
style
=
{{
alignSelf
:
'center'
,
top
:
10
,
color
:
'white'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
}}
>
CANCEL
<
/Text
>
<
/View
>
<
/View
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{{
height
:
60
}}
onPress
=
{()
=>
this
.
handleResend
()}
>
<
TouchableOpacity
style
=
{{
height
:
60
}}
onPress
=
{()
=>
this
.
handleResend
()}
>
<
Text
style
=
{{
alignSelf
:
'center'
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
,
top
:
10
}}
>
RESEND
EMAIL
TOKEN
<
/Text
>
<
Text
style
=
{{
alignSelf
:
'center'
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
,
top
:
10
}}
>
RESEND
EMAIL
TOKEN
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
TouchableOpacity
style
=
{{
height
:
60
}}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Change Email'
)}
>
<
TouchableOpacity
style
=
{{
height
:
60
}}
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Change Email'
)}
>
<
Text
style
=
{{
alignSelf
:
'center'
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
,
}}
>
CHANGE
EMAIL
<
/Text
>
<
Text
style
=
{{
alignSelf
:
'center'
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
20
,
}}
>
CHANGE
EMAIL
<
/Text
>
<
/TouchableOpacity
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
...
@@ -262,18 +293,19 @@ const mapStateToProps = (state) => {
...
@@ -262,18 +293,19 @@ const mapStateToProps = (state) => {
os_version
:
state
.
os_version
,
os_version
:
state
.
os_version
,
os_name
:
state
.
os_name
,
os_name
:
state
.
os_name
,
app_version
:
state
.
app_version
,
app_version
:
state
.
app_version
,
page
:
state
.
page
,
page
:
state
.
page
,
registration_id
:
state
.
registration_id
,
registration_id
:
state
.
registration_id
,
pageEmailConfirmation
:
state
.
pageEmailConfirmation
pageEmailConfirmation
:
state
.
pageEmailConfirmation
,
proses
:
state
.
proses
}
}
}
}
const
mapDispatchToProps
=
(
dispacth
)
=>
{
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
return
{
setEmailConfirm
:(
emailConfirmProps
)
=>
dispacth
({
setEmailConfirm
:
(
emailConfirmProps
)
=>
dispacth
({
type
:
ActionType
.
SET_EMAIL_VERIFICATION
,
type
:
ActionType
.
SET_EMAIL_VERIFICATION
,
data
:{
data
:
{
isEmailverif
:
emailConfirmProps
.
isEmailverif
,
isEmailverif
:
emailConfirmProps
.
isEmailverif
,
}
}
}),
}),
...
@@ -301,10 +333,10 @@ const mapDispatchToProps = (dispacth) => {
...
@@ -301,10 +333,10 @@ const mapDispatchToProps = (dispacth) => {
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
EmailConfirmation
);
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
EmailConfirmation
);
{
/* <Spinner
{
/* <Spinner
visible={this.state.spinner}
visible={this.state.spinner}
textContent={'Loading...'}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
textStyle={styles.spinnerTextStyle}
...
...
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