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
df2e2f9f
Commit
df2e2f9f
authored
May 20, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update design shopping cart
parent
44a3a512
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
59 deletions
+66
-59
ItemShopingCart.js
view/ItemShopingCart.js
+36
-33
ShoppingCart.js
view/ShoppingCart.js
+30
-26
No files found.
view/ItemShopingCart.js
View file @
df2e2f9f
...
@@ -22,40 +22,42 @@ class ItemShoping extends React.Component {
...
@@ -22,40 +22,42 @@ class ItemShoping extends React.Component {
note
:
'jangan garing'
,
note
:
'jangan garing'
,
image
:
item
.
image
,
image
:
item
.
image
,
price
:
parseInt
(
item
.
price
),
price
:
parseInt
(
item
.
price
),
}
}
this
.
props
.
changeQuantity
({
item
:
order_item
,
quantity
:
quantity
})
this
.
props
.
changeQuantity
({
item
:
order_item
,
quantity
:
quantity
})
}
}
render
()
{
render
()
{
const
{
item
}
=
this
.
props
const
{
item
}
=
this
.
props
// console.log(this.props)
// console.log(this.props)
return
(
return
(
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
key
=
{
item
.
id
}
>
<
View
style
=
{{
flex
:
1
,
margin
:
10
}}
key
=
{
item
.
id
}
>
{
/* <Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text> */
}
{
/* <Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text> */
}
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
View
style
=
{{
flexDirection
:
'row'
}}
>
<
View
>
<
View
>
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
100
,
width
:
100
,
borderRadius
:
5
,
top
:
5
}}
><
/Image
>
<
Image
source
=
{{
uri
:
item
.
image
}}
style
=
{{
height
:
100
,
width
:
100
,
borderRadius
:
5
,
top
:
5
}}
><
/Image
>
<
/View
>
<
/View
>
<
View
>
<
View
>
<
Text
style
=
{{
fontSize
:
15
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Black'
}}
>
{
item
.
name
}
<
/Text
>
<
Text
style
=
{{
fontSize
:
15
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Black'
,
color
:
'grey'
}}
>
{
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={''} /
>
<
NumberFormat
decimalScale
=
{
0
}
value
=
{
item
.
price
}
renderText
=
{
value
=>
<
Text
style
=
{{
fontSize
:
12
,
margin
:
5
,
marginRight
:
10
,
fontFamily
:
'Gotham-Light'
,
color
:
'grey'
}}
>
Rp
.
{
value
}
<
/Text>} displayType={'text'} thousandSeparator={true} prefix={''} /
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
style
=
{{
flexDirection
:
'row'
,
flex
:
1
}}
>
<
View
style
=
{
styles
.
shadowEdit
}
><
/View
>
<
View
style
=
{
styles
.
shadowEdit
}
>
<
View
style
=
{
styles
.
shadowAdd
}
>
<
Image
source
=
{(
require
(
'../assets/icon/icon-pencil.png'
))}
style
=
{{
height
:
25
,
width
:
25
,
marginLeft
:
5
}}
><
/Image
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleMin
()}
>
<
/View
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
-
<
/Text
>
<
View
style
=
{
styles
.
shadowAdd
}
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleMin
()}
>
<
TextInput
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
-
<
/Text
>
style
=
{{
height
:
25
,
padding
:
2
,
textAlign
:
'center'
,
margin
:
2
}}
<
/TouchableOpacity
>
keyboardType
=
{
'numeric'
}
<
TextInput
onChangeText
=
{(
quantity
)
=>
this
.
handleChangeQuantity
(
item
,
quantity
)}
>
{
item
.
quantity
}
<
/TextInput
>
style
=
{{
height
:
25
,
padding
:
2
,
textAlign
:
'center'
,
margin
:
2
}}
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleAdd
()}
>
keyboardType
=
{
'numeric'
}
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
+
<
/Text
>
onChangeText
=
{(
quantity
)
=>
this
.
handleChangeQuantity
(
item
,
quantity
)}
>
{
item
.
quantity
}
<
/TextInput
>
<
/TouchableOpacity
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
handleAdd
()}
>
<
/View
>
<
Text
style
=
{{
fontSize
:
20
,
margin
:
2
,
color
:
'#CFB368'
}}
>
+
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
)
)
}
}
...
@@ -77,6 +79,7 @@ const styles = StyleSheet.create({
...
@@ -77,6 +79,7 @@ const styles = StyleSheet.create({
marginLeft
:
5
,
marginLeft
:
5
,
marginRight
:
5
,
marginRight
:
5
,
marginTop
:
10
,
marginTop
:
10
,
alignItems
:
'center'
},
},
shadowAdd
:
{
shadowAdd
:
{
height
:
30
,
height
:
30
,
...
@@ -126,14 +129,14 @@ const mapStateToProps = (state) => {
...
@@ -126,14 +129,14 @@ const mapStateToProps = (state) => {
const
mapDispatchToProps
=
(
dispacth
)
=>
{
const
mapDispatchToProps
=
(
dispacth
)
=>
{
return
{
return
{
changeQuantity
:
(
params
)
=>
dispacth
({
changeQuantity
:
(
params
)
=>
dispacth
({
type
:
ActionType
.
CHANGE_QUANTITY
,
type
:
ActionType
.
CHANGE_QUANTITY
,
data
:
{
data
:
{
item
:
params
.
item
,
item
:
params
.
item
,
new_quantity
:
params
.
quantity
new_quantity
:
params
.
quantity
}
}
}),
}),
}
}
}
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
ItemShoping
)
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
ItemShoping
)
view/ShoppingCart.js
View file @
df2e2f9f
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