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
f25296b1
Commit
f25296b1
authored
Jul 16, 2020
by
Dida Adams Arizona
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'didam' into 'master'
Didam See merge request
!21
parents
e50f7867
aa97e368
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
10 deletions
+18
-10
LoginScreen.js
App/Containers/LoginScreen.js
+3
-1
MyAccountScreen.js
App/Containers/MyAccountScreen.js
+2
-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 @
f25296b1
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/MyAccountScreen.js
View file @
f25296b1
import
React
,
{
Component
}
from
'react'
import
{
ScrollView
,
Text
,
View
,
BackHandler
,
Image
,
TouchableOpacity
,
Alert
}
from
'react-native'
import
{
ScrollView
,
Text
,
View
,
BackHandler
,
Image
,
TouchableOpacity
,
Alert
,
AsyncStorage
}
from
'react-native'
import
{
connect
}
from
'react-redux'
import
{
NavigationActions
,
StackActions
}
from
'react-navigation'
import
AuthAction
from
'../Redux/AuthRedux'
...
...
@@ -61,6 +61,7 @@ class MyAccountScreen extends Component {
],
key
:
null
});
AsyncStorage
.
clear
()
this
.
props
.
navigation
.
dispatch
(
resetAction
);
}
else
{
...
...
App/Containers/OtpVerificationScreen.js
View file @
f25296b1
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 @
f25296b1
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 @
f25296b1
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