File tree Expand file tree Collapse file tree 9 files changed +76
-29
lines changed Expand file tree Collapse file tree 9 files changed +76
-29
lines changed Original file line number Diff line number Diff line change @@ -152,15 +152,14 @@ export const submitUpdateUser = user => dispatch => {
152
152
} ) => {
153
153
dispatch ( updateCurrentUser ( data ) ) ;
154
154
dispatch ( setUpdatingCurrentUser ( false ) ) ;
155
+ return data ;
155
156
} )
156
- . catch ( ( {
157
- response
158
- } ) => {
159
- const {
160
- error
161
- } = response . data ;
157
+ . catch ( ( err ) => {
158
+ const error =
159
+ err . response && err . response . data ? err . response . data . error : err ;
162
160
dispatch ( setUserError ( error ) ) ;
163
161
dispatch ( setUpdatingCurrentUser ( false ) ) ;
162
+ return error ;
164
163
} ) ;
165
164
} ;
166
165
@@ -172,11 +171,13 @@ export const submitUpdateUserAddress = address => dispatch => {
172
171
data
173
172
} ) => {
174
173
dispatch ( setUpdatingCurrentUserAddress ( false ) ) ;
174
+ return data ;
175
175
} )
176
176
. catch ( err => {
177
177
const error =
178
178
err . response && err . response . data ? err . response . data . error : err ;
179
179
dispatch ( setUserError ( error ) ) ;
180
180
dispatch ( setUpdatingCurrentUserAddress ( false ) ) ;
181
+ return error
181
182
} ) ;
182
183
} ;
Original file line number Diff line number Diff line change @@ -119,13 +119,13 @@ export class Header extends Component {
119
119
</ div >
120
120
121
121
< div className = "is-flex items-center is-hidden-mobile" >
122
- < Link to = "/items " className = "navbar-item" >
122
+ < Link to = "# " className = "navbar-item" >
123
123
Daily Deals
124
124
</ Link >
125
- < Link to = "/items " className = "navbar-item" >
125
+ < Link to = "# " className = "navbar-item" >
126
126
Sell
127
127
</ Link >
128
- < Link to = "/items " className = "navbar-item" >
128
+ < Link to = "# " className = "navbar-item" >
129
129
Help & Contact
130
130
</ Link >
131
131
</ div >
Original file line number Diff line number Diff line change @@ -12,12 +12,22 @@ const ItemCard = ({ item, addToCart }) => (
12
12
/>
13
13
< div className = "item-card__name" > { item . name } </ div >
14
14
< div className = "item-card__bottom" >
15
+
16
+ < p className = "item-card__bottom__prices" >
17
+ < span className = { `item-card__bottom__price ${ item . discounted_price > 0 && 'has-discount' } ` } > ${ item . price } </ span >
18
+ { item . discounted_price > 0 ?
19
+ < span className = "item-card__bottom__discount" >
20
+ ${ item . discounted_price }
21
+ </ span >
22
+ : null
23
+ }
24
+ </ p >
15
25
< button
16
26
data-test = "buy-btn"
17
27
className = { `item-card__bottom__buy-btn ${ item . adding ? 'loading' : '' } ` }
18
28
onClick = { ( ) => addToCart ( item . product_id , item ) }
19
29
>
20
- Add to cart
30
+ Buy now
21
31
</ button >
22
32
</ div >
23
33
< div className = "item-card__hover" >
Original file line number Diff line number Diff line change 49
49
text-overflow : ellipsis ;
50
50
}
51
51
& __bottom {
52
- height : 60 px ;
52
+ height : 100 px ;
53
53
display : flex ;
54
54
align-items : center ;
55
+ flex-direction : column ;
56
+ & __prices {
57
+ font-size : 1.8rem ;
58
+ color : $color-red ;
59
+ margin-bottom : 10px ;
60
+ }
61
+ & __price {
62
+ & .has-discount {
63
+ text-decoration : line-through ;
64
+ font-size : 1.5rem ;
65
+ margin-right : 10px ;
66
+ }
67
+ }
55
68
& __buy-btn {
56
69
@include item-button ;
57
70
}
63
76
top : 0 ;
64
77
left : 0 ;
65
78
right : 0 ;
66
- bottom : 80 px ;
79
+ bottom : 110 px ;
67
80
display : flex ;
68
81
justify-content : center ;
69
82
align-items : center ;
Original file line number Diff line number Diff line change @@ -85,17 +85,12 @@ export class MyCartModal extends Component {
85
85
</ tr >
86
86
) ) }
87
87
</ tbody >
88
- {
89
- cartProducts . length > 0 ?
90
- ( < tfoot >
91
- < tr >
92
- < td colSpan = "3" > < h4 className = "title is-4" > Total</ h4 > </ td >
93
- < td colSpan = "2" > < h4 className = "title is-4 color-red has-text-right" > ${ cartTotalAmount } </ h4 > </ td >
94
- </ tr >
95
- </ tfoot > )
96
- : null
97
- }
98
-
88
+ < tfoot >
89
+ < tr >
90
+ < td colSpan = "3" > < h4 className = "title is-4" > Total</ h4 > </ td >
91
+ < td colSpan = "2" > < h4 className = "title is-4 color-red has-text-right" > ${ cartProducts . length === 0 ? 0 : cartTotalAmount } </ h4 > </ td >
92
+ </ tr >
93
+ </ tfoot >
99
94
</ table >
100
95
) ;
101
96
} ;
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export class OrderDelivery extends Component {
18
18
} ;
19
19
20
20
render = ( ) => {
21
- const { cartProducts, user } = this . props ;
21
+ const { cartProducts, user, cartTotalAmount } = this . props ;
22
22
return (
23
23
< div className = "columns" >
24
24
< div className = "column is-8" >
@@ -44,6 +44,14 @@ export class OrderDelivery extends Component {
44
44
</ tr >
45
45
) ) }
46
46
</ tbody >
47
+ < tfoot >
48
+ < tr >
49
+ < td > < h5 className = "title is-5" > Total</ h5 > </ td >
50
+ < td colSpan = "2" >
51
+ < h5 className = "title is-5 has-text-right color-red" > ${ cartTotalAmount } </ h5 >
52
+ </ td >
53
+ </ tr >
54
+ </ tfoot >
47
55
</ table >
48
56
</ div >
49
57
< div className = "column is-4" >
@@ -74,7 +82,7 @@ export const mapStateToProps = ({
74
82
submittingOrder,
75
83
} ,
76
84
shipping : { regions, region } ,
77
- cart : { cartProducts } ,
85
+ cart : { cartProducts, cartTotalAmount } ,
78
86
} ) => ( {
79
87
orders,
80
88
cartId,
@@ -86,6 +94,7 @@ export const mapStateToProps = ({
86
94
regions,
87
95
region,
88
96
cartProducts,
97
+ cartTotalAmount
89
98
} ) ;
90
99
91
100
export const mapDispatchToProps = dispatch => ( {
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
2
import propTypes from 'prop-types' ;
3
3
import { connect } from 'react-redux' ;
4
+ import Notification from 'react-bulma-notification' ;
4
5
import './Settings.scss' ;
5
6
import Layout from '../../containers/Layout/Layout' ;
6
-
7
7
import {
8
8
setCurrentUserField ,
9
9
submitUpdateUser ,
@@ -37,7 +37,11 @@ export class Settings extends Component {
37
37
eve_phone : user . eve_phone ,
38
38
mob_phone : user . mob_phone ,
39
39
password : user . password || undefined ,
40
- } ) ;
40
+ } ) . then ( ( res ) => {
41
+ if ( res && res . email ) {
42
+ Notification . success ( 'Information updated' , { duration : 3 } )
43
+ }
44
+ } )
41
45
} ;
42
46
43
47
_submitAddress = e => {
@@ -60,7 +64,11 @@ export class Settings extends Component {
60
64
postal_code : user . postal_code ,
61
65
country : user . country ,
62
66
shipping_region_id : user . shipping_region_id ,
63
- } ) ;
67
+ } ) . then ( ( res ) => {
68
+ if ( res && res . email ) {
69
+ Notification . success ( 'Address updated' , { duration : 3 } )
70
+ }
71
+ } )
64
72
} ;
65
73
66
74
_renderProfile = ( ) => {
Original file line number Diff line number Diff line change @@ -170,7 +170,14 @@ export class SingleItem extends Component {
170
170
return (
171
171
< div className = "product" >
172
172
< h3 className = "product__name" > { item . name } </ h3 >
173
- < h3 className = "product__price" > $ { item . price } </ h3 >
173
+ < h3 className = { `product__price ${ item . discounted_price > 0 && 'has-discount' } ` } > $ { item . price } </ h3 >
174
+ {
175
+ item . discounted_price > 0 ?
176
+ < h3 className = "product__price" >
177
+ $ { item . discounted_price }
178
+ </ h3 >
179
+ : null
180
+ }
174
181
175
182
{ this . _renderColors ( ) }
176
183
Original file line number Diff line number Diff line change 47
47
& __price {
48
48
color : $color-red ;
49
49
font-size : 2rem ;
50
+ & .has-discount {
51
+ text-decoration : line-through ;
52
+ font-size : 1.5rem ;
53
+ }
50
54
}
51
55
& __info {
52
56
font-size : 1.3rem ;
You can’t perform that action at this time.
0 commit comments