Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
new_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
new_excelso
Commits
ca55e122
Commit
ca55e122
authored
May 18, 2020
by
Wahyu Adjie Prasetyo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://repo.cs.co.id:2222/wahyu/bahanoprek
parents
7ebf6ad8
e6ff26ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
271 additions
and
62 deletions
+271
-62
App.js
App.js
+56
-3
app.json
app.json
+5
-2
notification.png
assets/icon/notification.png
+0
-0
RootNavigation.js
helper/RootNavigation.js
+7
-0
Home.js
view/Home.js
+1
-1
MenuConfirmation.js
view/MenuConfirmation.js
+175
-39
ShoppingCart.js
view/ShoppingCart.js
+27
-17
No files found.
App.js
View file @
ca55e122
...
...
@@ -12,11 +12,14 @@ import i18n from 'i18n-js';
import
en
from
'./lib/en'
;
import
id
from
'./lib/id'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Text
,
View
}
from
'react-native'
;
import
{
AppLoading
}
from
'expo'
;
import
{
Alert
,
Vibration
}
from
'react-native'
;
import
{
AppLoading
,
Notifications
}
from
'expo'
;
import
*
as
Font
from
'expo-font'
;
import
*
as
Sentry
from
'sentry-expo'
;
import
Constants
from
'expo-constants'
;
import
{
navigationRef
}
from
'./helper/RootNavigation'
;
import
*
as
RootNavigation
from
'./helper/RootNavigation'
;
Sentry
.
init
({
dsn
:
'https://ae2449ac801244d99f170140c7cd6d0a@o392471.ingest.sentry.io/5239999'
,
...
...
@@ -58,8 +61,58 @@ export default function App() {
await
Font
.
loadAsync
(
customFonts
);
};
const
routing
=
(
data
)
=>
{
if
(
data
.
action_type
==
'Rewards'
)
{
RootNavigation
.
navigate
(
'Reward Detail'
,
{
rewardId
:
data
.
data_id
});
}
else
if
(
data
.
action_type
==
'Inbox'
)
{
}
else
if
(
data
.
action_type
==
'Transaction'
)
{
RootNavigation
.
navigate
(
'Transaction Detail'
,
{
idTrans
:
data
.
data_id
});
}
else
if
(
data
.
action_type
==
'Review'
)
{
}
else
if
(
data
.
action_type
==
'WebView'
)
{
}
else
if
(
data
.
action_type
==
'Transfer Receive'
)
{
}
else
if
(
data
.
action_type
==
'Cashback'
)
{
}
}
const
handleNotification
=
notification
=>
{
// console.log('Notification Origin : ' + JSON.stringify(notification.origin))
// console.log('Notification Payload Data : ' + JSON.stringify(notification.data))
const
origin
=
notification
.
origin
;
const
data
=
notification
.
data
;
if
(
origin
==
'selected'
)
{
routing
(
data
)
}
else
{
Vibration
.
vibrate
();
Alert
.
alert
(
data
.
title
,
data
.
body
,
[
{
text
:
'Close'
,
style
:
'cancel'
,
},
{
text
:
'View'
,
onPress
:
()
=>
{
routing
(
data
)
}
},
],
{
cancelable
:
false
},
)
}
}
useEffect
(()
=>
{
console
.
log
(
'===> Did Mount'
);
this
.
_notificationSubscription
=
Notifications
.
addListener
(
handleNotification
);
loadFont
().
then
(
_
=>
{
setfontsLoaded
(
true
);
})
...
...
@@ -71,7 +124,7 @@ export default function App() {
return
(
<
Provider
store
=
{
store
}
>
<
PersistGate
loading
=
{
null
}
persistor
=
{
persistor
}
>
<
NavigationContainer
>
<
NavigationContainer
ref
=
{
navigationRef
}
>
<
Auth
/>
<
/NavigationContainer
>
<
/PersistGate
>
...
...
app.json
View file @
ca55e122
...
...
@@ -30,7 +30,7 @@
},
"android"
:
{
"package"
:
"local.ravExcelso"
,
"versionCode"
:
20
200327
"versionCode"
:
20
05151310
},
"description"
:
""
,
"hooks"
:
{
...
...
@@ -45,6 +45,9 @@
}
}
]
},
"notification"
:
{
"icon"
:
"./assets/icon/notification.png"
}
}
}
}
\ No newline at end of file
assets/icon/notification.png
0 → 100644
View file @
ca55e122
5.5 KB
helper/RootNavigation.js
0 → 100644
View file @
ca55e122
import
*
as
React
from
'react'
;
export
const
navigationRef
=
React
.
createRef
();
export
function
navigate
(
name
,
params
)
{
navigationRef
.
current
?.
navigate
(
name
,
params
);
}
\ No newline at end of file
view/Home.js
View file @
ca55e122
...
...
@@ -367,7 +367,7 @@ class Home extends React.Component {
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
TouchableOpacity
// style={styles.submitUpgradePemium}
activeOpacity
=
{.
5
}
onPress
=
{
this
.
onPress
}
>
activeOpacity
=
{.
5
}
onPress
=
{
()
=>
this
.
props
.
navigation
.
navigate
(
'TopUpInfo'
)
}
>
<
View
style
=
{
styles
.
topUseBalance
}
>
<
Text
style
=
{{
textAlign
:
'center'
,
bottom
:
5
,
color
:
'white'
,
fontFamily
:
'Gotham-Black'
}}
>
TOP
BALANCE
<
/Text
>
<
/View
>
...
...
view/MenuConfirmation.js
View file @
ca55e122
This diff is collapsed.
Click to expand it.
view/ShoppingCart.js
View file @
ca55e122
...
...
@@ -126,6 +126,17 @@ class ShoppingCart extends React.Component {
this
.
props
.
navigation
.
navigate
(
'Reward Select'
)
}
handleAddVoucher
()
{
this
.
setState
({
checkedBalance
:
false
,
checkedPoint
:
false
,
checkedBalancePoint
:
false
,
pointsused
:
0
,
balanceused
:
0
})
this
.
props
.
navigation
.
navigate
(
'Reward Select'
)
}
handleMin
(
item
,
index
)
{
this
.
setState
({
checkedBalance
:
false
,
...
...
@@ -437,7 +448,7 @@ class ShoppingCart extends React.Component {
<
/Card
>
)
:
(
<
Card
style
=
{{
margin
:
5
,
padding
:
10
}}
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
}}
>
OUR
DRIVER
WILL
DELIVER
YOU
ORDER
TO
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontFamily
:
'Gotham-Black'
,
fontSize
:
12
}}
>
OUR
DRIVER
WILL
DELIVER
YOU
R
ORDER
TO
<
/Text
>
<
Text
style
=
{{
textAlign
:
'center'
,
fontSize
:
12
,
top
:
5
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
props
.
address
}
<
/Text
>
<
/Card
>
)
...
...
@@ -466,7 +477,7 @@ class ShoppingCart extends React.Component {
<
View
style
=
{
styles
.
voucher
}
>
{
this
.
props
.
value_voucher
==
''
?
(
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigation
.
navigate
(
'Reward Select'
)}
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
handleAddVoucher
(
)}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'#CFB368'
}}
>+
ADD
VOUCHER
<
/Text
>
<
/TouchableOpacity
>
)
:
(
...
...
@@ -611,7 +622,7 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Balance
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Points
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
30
,
alignItems
:
'flex-end'
}}
>
<
View
style
=
{{
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
kasproBalance
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
this
.
state
.
kasproPoint
}
<
/Text
>
<
/View
>
...
...
@@ -621,7 +632,7 @@ class ShoppingCart extends React.Component {
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Balance
Used
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Your
Points
Used
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
30
,
marginTop
:
5
,
alignItems
:
'flex-end'
}}
>
<
View
style
=
{{
marginTop
:
5
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>-
{
this
.
state
.
balanceused
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>-
{
this
.
state
.
pointsused
}
<
/Text
>
<
/View
>
...
...
@@ -660,23 +671,22 @@ class ShoppingCart extends React.Component {
<
/View>
)
}
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
paddingLeft
:
20
,
paddingTop
:
10
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Diskon
<
/Text
>
<
/View
>
{
this
.
props
.
value_voucher
==
''
?
(
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
state
.
diskon
}
<
/Text
>
<
/View
>
)
:
(
{
this
.
props
.
value_voucher
==
''
?
(
null
)
:
(
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
paddingLeft
:
20
,
paddingTop
:
10
,
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
Diskon
<
/Text
>
<
/View
>
<
View
style
=
{{
paddingRight
:
30
,
paddingTop
:
10
,
alignItems
:
'flex-end'
}}
>
<
Text
style
=
{{
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
,
color
:
'gray'
}}
>
{
this
.
props
.
voucher
.
reward
.
value
}
<
/Text
>
<
/View
>
)
}
<
/View
>
)
}
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
marginTop
:
10
,
justifyContent
:
'space-between'
}}
>
<
View
style
=
{{
marginTop
:
15
,
paddingLeft
:
20
,
paddingTop
:
10
}}
>
<
Text
style
=
{{
fontSize
:
25
,
color
:
'#CFB368'
,
fontFamily
:
'Gotham-Black'
,
}}
>
TOTAL
<
/Text
>
...
...
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