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
457de09b
Commit
457de09b
authored
Jun 30, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benerin bug untuk email confirmation, di tambah logic di login
parent
c297f36b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
70 deletions
+21
-70
Login.js
view/Login.js
+21
-70
No files found.
view/Login.js
View file @
457de09b
...
...
@@ -36,12 +36,19 @@ class Login extends React.Component {
}
componentDidMount
()
{
this
.
handleCheck
()
const
{
navigation
}
=
this
.
props
console
.
log
(
this
.
props
.
BASE_URL
)
CheckVersion
(
navigation
)
this
.
_getDeviceInfo
()
}
handleCheck
()
{
if
(
this
.
props
.
pageEmailConfirmation
===
true
)
{
this
.
props
.
navigation
.
replace
(
'Email Confirmation'
);
}
}
handleSettings
()
{
if
(
this
.
state
.
clickSettings
==
3
)
{
this
.
props
.
navigation
.
navigate
(
'Setting'
)
...
...
@@ -170,7 +177,7 @@ class Login extends React.Component {
"build_number"
:
Constants
.
manifest
.
extra
.
buildNumber
}
console
.
log
(
params
)
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/auth/login'
,
params
).
then
(
res
=>
{
Axios
.
post
(
this
.
props
.
BASE_URL
+
'crm/v2/auth/login'
,
params
).
then
(
res
=>
{
const
navigation
=
this
.
props
.
navigation
...
...
@@ -219,7 +226,7 @@ class Login extends React.Component {
isEmailverif
:
true
}
let
pageProps
=
{
pageEmailConfirmation
:
true
pageEmailConfirmation
:
true
,
}
let
prosesProps
=
{
proses
:
''
...
...
@@ -271,7 +278,7 @@ class Login extends React.Component {
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'email'
)}
<
/Text
>
<
TextInput
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
style
=
{{
height
:
40
,
borderColor
:
'gray'
,
borderWidth
:
1
,
padding
:
10
,
borderRadius
:
10
,
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
13
,
fontWeight
:
'bold'
}}
onChangeText
=
{(
email
)
=>
this
.
setState
({
email
})}
autoCapitalize
=
"none"
...
...
@@ -284,7 +291,7 @@ class Login extends React.Component {
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
color
:
'#CFB368'
,
fontSize
:
20
,
textAlign
:
'center'
,
margin
:
3
}}
>
{
i18n
.
t
(
'password'
)}
<
/Text
>
<
TextInput
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
style
=
{{
height
:
40
,
borderColor
:
'gray'
,
borderWidth
:
1
,
padding
:
5
,
borderRadius
:
10
,
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
color
:
'white'
,
fontSize
:
13
,
fontWeight
:
'bold'
}}
onChangeText
=
{
password
=>
this
.
setState
({
password
})}
value
=
{
this
.
state
.
password
}
...
...
@@ -311,11 +318,11 @@ class Login extends React.Component {
<
/View
>
<
View
style
=
{{
flex
:
1
,
justifyContent
:
'center'
,
marginRight
:
60
,
marginLeft
:
60
}}
>
<
TouchableWithoutFeedback
onPress
=
{()
=>
this
.
handleSettings
()}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'#CFB368'
,
fontSize
:
13
,
textAlign
:
'center'
,
marginBottom
:
5
}}
>
{
i18n
.
t
(
'policy'
)}
<
Text
style
=
{{
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'privacy'
)}
<
/Text
>
<
/Text
>
<
/TouchableWithoutFeedback
>
<
TouchableWithoutFeedback
onPress
=
{()
=>
this
.
handleSettings
()}
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Light'
,
color
:
'#CFB368'
,
fontSize
:
13
,
textAlign
:
'center'
,
marginBottom
:
5
}}
>
{
i18n
.
t
(
'policy'
)}
<
Text
style
=
{{
fontWeight
:
'bold'
}}
>
{
i18n
.
t
(
'privacy'
)}
<
/Text
>
<
/Text
>
<
/TouchableWithoutFeedback
>
<
/View
>
<
/View
>
<
/ImageBackground
>
...
...
@@ -393,7 +400,8 @@ const mapDispatchToProps = (dispacth) => {
setPage
:
(
pageProps
)
=>
dispacth
({
type
:
ActionType
.
SET_PAGE
,
data
:
{
pageEmailConfirmation
:
pageProps
.
pageEmailConfirmation
pageEmailConfirmation
:
pageProps
.
pageEmailConfirmation
,
email_confirm
:
pageProps
.
email_confirm
}
}),
}
...
...
@@ -410,66 +418,9 @@ const mapStateToProps = (state) => {
os_name
:
state
.
os_name
,
app_version
:
state
.
app_version
,
language
:
state
.
language
,
BASE_URL
:
state
.
BASE_URL
BASE_URL
:
state
.
BASE_URL
,
pageEmailConfirmation
:
state
.
pageEmailConfirmation
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Login
);
// <Spinner
// visible={this.state.spinner}
// textContent={'Loading...'}
// textStyle={styles.spinnerTextStyle}
// />
// <View style={styles.form}>
// <View style={{ marginRight: 10, marginLeft: 10, }}>
// <Text style={{ top: 5 }}>Email</Text>
// </View>
// <View style={{ margin: 10 }}>
// <TextInput
// style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
// onChangeText={(email) => this.setState({ email })}
// autoCapitalize="none"
// value={this.state.email}
// keyboardType='email-address'
// />
// </View>
// <View style={{ marginRight: 10, marginLeft: 10 }}>
// <Text style={{ top: 5 }}>{i18n.t('password')}</Text>
// </View>
// <View style={{ margin: 10 }}>
// <TextInput
// style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
// onChangeText={password => this.setState({ password })}
// value={this.state.password}
// secureTextEntry={true}
// />
// </View>
// <View style={{ marginRight: 10, marginLeft: 10 }}>
// <Button
// title={i18n.t('login')}
// onPress={() => this.handleLoggin()}
// />
// </View>
// </View>
// <View style={styles.footer}>
// <View style={styles.container_register}>
// <View style={{ flex: 1 }}>
// <TouchableOpacity onPress={() => this.props.navigation.navigate('New Register')}>
// <Text style={{ fontSize: 20 }}>{i18n.t('register')}</Text>
// </TouchableOpacity>
// </View>
// <View style={{ flex: 1, }}>
// <TouchableOpacity onPress={() => this.props.navigation.navigate('Reset Password')}>
// <Text style={{ fontSize: 20, textAlign: 'right' }}>{i18n.t('forgotPassword')}</Text>
// </TouchableOpacity>
// </View>
// </View>
// </View>
\ No newline at end of file
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Login
);
\ No newline at end of file
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