Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
eCartPro-Customer
Project
Project
Details
Activity
Releases
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
Dida Adams Arizona
eCartPro-Customer
Commits
b3b8fbe2
Commit
b3b8fbe2
authored
Jul 16, 2020
by
d.arizona
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update token
parent
e50f7867
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
9 deletions
+16
-9
LoginScreen.js
App/Containers/LoginScreen.js
+3
-1
OtpVerificationScreen.js
App/Containers/OtpVerificationScreen.js
+5
-1
ProfileScreen.js
App/Containers/ProfileScreen.js
+8
-7
Constants.js
App/Lib/Constants.js
+0
-0
No files found.
App/Containers/LoginScreen.js
View file @
b3b8fbe2
import
React
,
{
Component
}
from
'react'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
BackHandler
,
Alert
,
View
,
TouchableOpacity
,
Image
,
NativeModules
,
Platform
,
TextInput
}
from
'react-native'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
BackHandler
,
Alert
,
View
,
TouchableOpacity
,
Image
,
NativeModules
,
Platform
,
TextInput
,
AsyncStorage
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
FontAwesome
from
'react-native-vector-icons/FontAwesome'
import
Ionicons
from
'react-native-vector-icons/Ionicons'
import
Toast
from
'react-native-toast-message'
import
R
from
'ramda'
import
AuthAction
from
'../Redux/AuthRedux'
import
Constants
from
'../Lib/Constants'
// Add Actions - replace 'Your' with whatever your reducer is called :)
// import YourActions from '../Redux/YourRedux'
const
{
StatusBarManager
}
=
NativeModules
;
...
...
@@ -76,6 +77,7 @@ class LoginScreen extends Component {
this
.
props
.
navigation
.
navigate
(
'OtpVerificationScreen'
)
}
if
(
!
auth
.
error
)
{
AsyncStorage
.
setItem
(
Constants
.
TOKEN
,
auth
.
user
.
data
.
token
)
this
.
props
.
navigation
.
navigate
(
'HomeNavigation'
)
}
// auth.error? null : (
...
...
App/Containers/OtpVerificationScreen.js
View file @
b3b8fbe2
import
React
,
{
Component
}
from
'react'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
View
,
Image
,
TextInput
,
Keyboard
,
BackHandler
}
from
'react-native'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
View
,
Image
,
TextInput
,
Keyboard
,
BackHandler
,
AsyncStorage
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
AuthAction
from
'../Redux/AuthRedux'
// Add Actions - replace 'Your' with whatever your reducer is called :)
...
...
@@ -15,6 +15,7 @@ import BaseButton from '../Components/BaseButton'
import
{
StackActions
,
NavigationActions
}
from
'react-navigation'
import
Api
from
'../Services/Api'
import
Toast
from
'react-native-toast-message'
import
Constants
from
'../Lib/Constants'
class
OtpVerificationScreen
extends
Component
{
constructor
(
props
)
{
...
...
@@ -92,6 +93,9 @@ class OtpVerificationScreen extends Component {
// topOffset: 100,
// bottomOffset: 40,
})
if
(
auth
.
error
==
'success'
)
{
AsyncStorage
.
setItem
(
Constants
.
TOKEN
,
auth
.
user
.
data
.
token
)
}
auth
.
error
?
null
:
this
.
handleVerif
()
}
}
...
...
App/Containers/ProfileScreen.js
View file @
b3b8fbe2
import
React
,
{
Component
}
from
'react'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
Image
,
View
,
BackHandler
,
TouchableOpacity
,
StatusBar
}
from
'react-native'
import
{
ScrollView
,
Text
,
KeyboardAvoidingView
,
Image
,
View
,
BackHandler
,
TouchableOpacity
,
StatusBar
,
AsyncStorage
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
{
withNavigationFocus
,
NavigationEvents
}
from
'react-navigation'
;
// Add Actions - replace 'Your' with whatever your reducer is called :)
...
...
@@ -16,7 +16,7 @@ class ProfileScreen extends Component {
super
(
props
)
this
.
state
=
{
// activeIndex: this.props.activeIndex
data
:
this
.
props
.
auth
.
user
.
data
data
:
this
.
props
.
auth
}
}
backAction
=
()
=>
{
...
...
@@ -27,7 +27,6 @@ class ProfileScreen extends Component {
componentDidMount
()
{
BackHandler
.
addEventListener
(
"hardwareBackPress"
,
this
.
backAction
);
// console.log('auth', this.props.auth.user.data)
}
componentWillUnmount
()
{
...
...
@@ -35,11 +34,13 @@ class ProfileScreen extends Component {
}
getDataProfile
()
{
console
.
log
(
'auth'
,
this
.
props
.
auth
.
user
.
data
)
if
(
this
.
state
.
data
!==
null
)
{
console
.
log
(
'auth'
,
this
.
props
.
auth
.
user
.
data
)
this
.
setState
({
data
:
this
.
props
.
auth
.
user
.
data
})
this
.
setState
({
data
:
this
.
props
.
auth
.
user
.
data
})
}
}
render
()
{
...
...
App/Lib/Constans.js
→
App/Lib/Constan
t
s.js
View file @
b3b8fbe2
File moved
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