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
44a3a512
Commit
44a3a512
authored
May 20, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tambah pemisah ribuan di shopping cart, dan tampilkan 'No data' jika data kosong di reward select
parent
b7ef3356
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
36 deletions
+61
-36
ItemShopingCart.js
view/ItemShopingCart.js
+3
-2
RewardSelect.js
view/RewardSelect.js
+26
-20
ShoppingCart.js
view/ShoppingCart.js
+32
-14
No files found.
view/ItemShopingCart.js
View file @
44a3a512
...
...
@@ -2,6 +2,7 @@ import React from 'react';
import
{
View
,
Text
,
StyleSheet
,
ScrollView
,
TouchableOpacity
,
Image
,
TextInput
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
;
import
ActionType
from
'../redux/globalActionType'
;
import
NumberFormat
from
'react-number-format'
;
class
ItemShoping
extends
React
.
Component
{
...
...
@@ -36,8 +37,8 @@ class ItemShoping extends React.Component {
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
100
,
width
:
100
,
borderRadius
:
5
,
top
:
5
}}
><
/Image
>
<
/View
>
<
View
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
15
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Light'
}}
>
Rp
.
{
item
.
price
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
15
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
name
}
<
/Text
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
item
.
price
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
style
=
{
styles
.
shadowEdit
}
><
/View
>
<
View
style
=
{
styles
.
shadowAdd
}
>
...
...
view/RewardSelect.js
View file @
44a3a512
...
...
@@ -89,30 +89,36 @@ class RewardSelect extends React.Component {
</View> */
}
<
ScrollView
style
=
{
styles
.
body
}
>
{
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
handleSelect
(
item
)}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
this
.
state
.
rewardsList
.
length
?
(
this
.
state
.
rewardsList
.
map
((
item
,
key
)
=>
(
<
TouchableOpacity
key
=
{
key
}
onPress
=
{()
=>
this
.
handleSelect
(
item
)}
>
<
View
style
=
{{
alignItems
:
'center'
}}
>
<
Card
style
=
{{
padding
:
5
,
margin
:
10
}}
>
<
View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
Image
source
=
{{
uri
:
item
.
reward
.
title_image
}}
resizeMethod
=
"resize"
resizeMode
=
'cover'
style
=
{{
height
:
100
,
width
:
'100%'
}}
/
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
View
style
=
{{
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
padding
:
10
}}
>
<
View
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
reward
.
title
}
<
/Text
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
reward
.
subtitle
}
<
/Text
>
<
/View
>
<
View
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
Expired
<
/Text
>
<
Text
style
=
{{
textAlign
:
'right'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
{
item
.
expire_time
}
<
/Text
>
<
/View
>
<
/View
>
<
/View
>
<
/Card
>
<
/Card
>
<
/View
>
<
/TouchableOpacity
>
))
)
:
(
<
View
style
=
{{
justifyContent
:
'center'
,
alignItems
:
'center'
,
height
:
100
}}
>
<
Text
style
=
{{
textAlign
:
'left'
,
fontSize
:
12
,
fontFamily
:
'Gotham-Light'
}}
>
No
data
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
))
)
}
{
/* <TouchableOpacity>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
...
...
view/ShoppingCart.js
View file @
44a3a512
This diff is collapsed.
Click to expand it.
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