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
a4d4b682
Commit
a4d4b682
authored
Jun 08, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
session expired, pake toast
parent
c9f770eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
16 deletions
+26
-16
Account.js
view/Account.js
+13
-9
Home.js
view/Home.js
+13
-7
No files found.
view/Account.js
View file @
a4d4b682
...
...
@@ -9,7 +9,8 @@ import {
TouchableOpacity
,
Alert
,
Button
,
ImageBackground
ImageBackground
,
ToastAndroid
}
from
'react-native'
;
import
{
StackActions
}
from
'@react-navigation/native'
;
...
...
@@ -147,9 +148,12 @@ class Account extends React.Component {
})
}).
catch
(
error
=>
{
const
{
navigation
}
=
this
.
props
// const { navigation } = this.props
// let response = error.response.data
// session(response, navigation)
let
response
=
error
.
response
.
data
session
(
response
,
navigation
)
// Alert.alert('',response.msg);
ToastAndroid
.
show
(
response
.
msg
,
ToastAndroid
.
SHORT
)
})
}
...
...
@@ -347,9 +351,9 @@ class Account extends React.Component {
<
View
style
=
{{
flex
:
1
,
flexDirection
:
'row'
,
justifyContent
:
'center'
}}
>
{
this
.
state
.
premium
===
false
?
(
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Upgrade Premium'
)}
style
=
{{
marginBottom
:
20
,
marginRight
:
5
,
marginLeft
:
5
}}
>
<
Card
style
=
{{
width
:
200
,
paddingHorizontal
:
10
,
paddingTop
:
20
,
paddingBottom
:
20
}}
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
}}
>
<
MaterialIcons
name
=
"autorenew"
size
=
{
30
}
color
=
"gray"
style
=
{{
marginBottom
:
10
}}
/
>
<
Card
style
=
{{
width
:
200
,
paddingHorizontal
:
10
,
paddingTop
:
20
,
paddingBottom
:
20
}}
>
<
View
style
=
{{
flex
:
1
,
alignItems
:
'center'
}}
>
<
MaterialIcons
name
=
"autorenew"
size
=
{
30
}
color
=
"gray"
style
=
{{
marginBottom
:
10
}}
/
>
<
Text
style
=
{{
fontFamily
:
'Gotham-Black'
,
textAlign
:
'center'
,
fontSize
:
14
,
color
:
'#838383'
}}
>
UPGRADE
PREMIUM
<
/Text
>
<
/View
>
<
/Card
>
...
...
@@ -372,9 +376,9 @@ class Account extends React.Component {
)
}
<
View
style
=
{{
flex
:
1
,
marginBottom
:
10
}}
>
<
Text
style
=
{{
color
:
'grey'
,
fontSize
:
12
,
textAlign
:
'center'
}}
>
Build
Version
:
{
Constants
.
manifest
.
version
}
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
1
,
marginBottom
:
10
}}
>
<
Text
style
=
{{
color
:
'grey'
,
fontSize
:
12
,
textAlign
:
'center'
}}
>
Build
Version
:
{
Constants
.
manifest
.
version
}
<
/Text
>
<
/View
>
<
/ScrollView
>
<
/View
>
...
...
view/Home.js
View file @
a4d4b682
...
...
@@ -4,7 +4,7 @@ import * as Device from 'expo-device';
import
*
as
Location
from
'expo-location'
;
import
*
as
Permissions
from
'expo-permissions'
;
import
*
as
React
from
'react'
;
import
{
ActivityIndicator
,
Alert
,
Dimensions
,
ScrollView
,
StyleSheet
,
Text
,
TouchableOpacity
,
View
,
SafeAreaView
,
StatusBar
}
from
'react-native'
;
import
{
ActivityIndicator
,
Alert
,
Dimensions
,
ScrollView
,
StyleSheet
,
Text
,
TouchableOpacity
,
View
,
SafeAreaView
,
StatusBar
,
ToastAndroid
}
from
'react-native'
;
import
{
SliderBox
}
from
"react-native-image-slider-box"
;
import
{
Card
}
from
'react-native-shadow-cards'
;
import
{
connect
}
from
'react-redux'
;
...
...
@@ -35,6 +35,7 @@ class Home extends React.Component {
}
componentDidMount
()
{
const
screenWidth
=
Math
.
round
(
Dimensions
.
get
(
'window'
).
width
);
this
.
setState
({
slider_height
:
screenWidth
...
...
@@ -61,10 +62,12 @@ class Home extends React.Component {
_getPermissions
=
async
()
=>
{
let
{
status
}
=
await
Permissions
.
askAsync
(
Permissions
.
LOCATION
);
if
(
status
!==
'granted'
)
{
Alert
.
alert
(
'Akses tidak dizinkan!'
)
// Alert.alert('Akses tidak dizinkan!')
ToastAndroid
.
show
(
"Akses tidak dizinkan!"
,
ToastAndroid
.
SHORT
)
}
else
if
(
Platform
.
OS
===
'android'
&&
!
Device
.
isDevice
)
{
Alert
.
alert
(
'Silahkan anda coba di real Device'
)
// Alert.alert('Silahkan anda coba di real Device')
ToastAndroid
.
show
(
"Silahkan anda coba di real Device"
,
ToastAndroid
.
SHORT
)
}
else
{
this
.
_getCurrentPosisition
()
}
...
...
@@ -138,7 +141,8 @@ class Home extends React.Component {
})
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
Alert
.
alert
(
''
,
response
.
msg
);
// Alert.alert('',response.msg);
ToastAndroid
.
show
(
response
.
msg
,
ToastAndroid
.
SHORT
)
})
}
...
...
@@ -150,7 +154,7 @@ class Home extends React.Component {
}
// console.log(params);
Axios
.
post
(
'https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_closest'
,
params
).
then
(
res
=>
{
console
.
log
(
res
.
data
.
data
)
//
console.log(res.data.data)
let
outletId
=
res
.
data
.
data
.
outlet_id
let
outletName
=
res
.
data
.
data
.
outlet_name
...
...
@@ -167,7 +171,8 @@ class Home extends React.Component {
})
}).
catch
(
error
=>
{
let
response
=
error
.
response
.
data
Alert
.
alert
(
''
,
response
.
msg
);
// Alert.alert('',response.msg);
ToastAndroid
.
show
(
response
.
msg
,
ToastAndroid
.
SHORT
)
})
}
...
...
@@ -197,7 +202,8 @@ class Home extends React.Component {
});
}
else
{
Alert
.
alert
(
'Belum dapat outlet terdekat'
)
// Alert.alert('Belum dapat outlet terdekat')
ToastAndroid
.
show
(
'Belum dapat outlet terdekat'
,
ToastAndroid
.
SHORT
)
}
}
...
...
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