@riosst100/pwa-marketplace 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/i18n/en_US.json +3 -3
  2. package/i18n/id_ID.json +2 -2
  3. package/package.json +1 -1
  4. package/src/componentOverrideMapping.js +1 -0
  5. package/src/components/OrderDetail/components/itemsOrdered.js +1 -6
  6. package/src/components/RMAPage/components/productItem.js +13 -43
  7. package/src/components/SellerCoupon/index.js +1 -0
  8. package/src/components/SellerCoupon/sellerCoupon.js +41 -6
  9. package/src/components/SellerCoupon/sellerCoupon.module.css +22 -0
  10. package/src/components/SellerCoupon/sellerCouponCheckout.js +36 -19
  11. package/src/components/SellerCoupon/sellerCouponCheckout.shimmer.js +21 -0
  12. package/src/overwrites/peregrine/lib/talons/CartPage/PriceSummary/usePriceSummary.js +2 -2
  13. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +24 -27
  14. package/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.module.css +2 -0
  15. package/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.js +14 -5
  16. package/src/overwrites/venia-ui/lib/components/CartPage/cartPage.js +0 -7
  17. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderSummary/orderSummary.js +4 -0
  18. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.js +65 -57
  19. package/src/overwrites/venia-ui/lib/components/CheckoutPage/PriceAdjustments/priceAdjustments.module.css +29 -0
  20. package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.js +2 -2
  21. package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.module.css +2 -0
  22. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/Reviews/index.js +1 -0
  23. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/Reviews/reviewModal.js +316 -0
  24. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/Reviews/starInput.js +33 -0
  25. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +29 -2
  26. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +70 -34
  27. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/modalFormReview.js +8 -8
  28. package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/productReview.js +4 -27
  29. package/src/talons/ReviewModal/reviewModal.gql.js +45 -0
  30. package/src/talons/ReviewModal/useReviewModal.js +87 -0
  31. package/src/components/RMAPage/components/productItem.css +0 -15
  32. package/src/components/RMAPage/components/productItem.module.css +0 -15
package/i18n/en_US.json CHANGED
@@ -63,7 +63,7 @@
63
63
  "checkoutPage.additionalText": "You will also receive an email with the details and we will let you know when your order has shipped.",
64
64
  "checkoutPage.billingAddressSame": "Billing address same as shipping address",
65
65
  "checkoutPage.checkout": "Checkout",
66
- "checkoutPage.couponCode": "Apply Coupon Code",
66
+ "checkoutPage.couponCode": "Apply Coupon",
67
67
  "checkoutPage.createAccount": "Create Account",
68
68
  "checkoutPage.editPaymentInformation": "Edit Payment Information",
69
69
  "checkoutPage.editShippingInfo": "Edit Shipping Information",
@@ -82,7 +82,7 @@
82
82
  "checkoutPage.loadingPaymentInformation": "Fetching Payment Information",
83
83
  "checkoutPage.noPaymentAvailable": "Payment is currently unavailable.",
84
84
  "checkoutPage.orderNumber": "Order Number: {orderNumber}",
85
- "checkoutPage.orderSummary": "Summary",
85
+ "checkoutPage.orderSummary": "Order Summary",
86
86
  "checkoutPage.paymentInformation": "Payment Information",
87
87
  "checkoutPage.paymentInformationStep": "Payment Information",
88
88
  "checkoutPage.paymentLoadingError": "There was an error loading payments.",
@@ -139,7 +139,7 @@
139
139
  "country.label": "Country",
140
140
  "couponCode.apply": "Apply",
141
141
  "couponCode.couponCode": "Coupon Code",
142
- "couponCode.enterCode": "Enter code",
142
+ "couponCode.enterCode": "Enter coupon code",
143
143
  "couponCode.errorContainer": "Something went wrong. Please refresh and try again.",
144
144
  "couponCode.removeButton": "Remove",
145
145
  "createAccount.cancelText": "Cancel",
package/i18n/id_ID.json CHANGED
@@ -64,7 +64,7 @@
64
64
  "checkoutPage.additionalText": "You will also receive an email with the details and we will let you know when your order has shipped.",
65
65
  "checkoutPage.billingAddressSame": "Billing address same as shipping address",
66
66
  "checkoutPage.checkout": "Checkout",
67
- "checkoutPage.couponCode": "Apply Coupon Code",
67
+ "checkoutPage.couponCode": "Apply Coupon",
68
68
  "checkoutPage.createAccount": "Create Account",
69
69
  "checkoutPage.editPaymentInformation": "Edit Payment Information",
70
70
  "checkoutPage.editShippingInfo": "Edit Shipping Information",
@@ -140,7 +140,7 @@
140
140
  "country.label": "Country",
141
141
  "couponCode.apply": "Apply",
142
142
  "couponCode.couponCode": "Coupon Code",
143
- "couponCode.enterCode": "Enter code",
143
+ "couponCode.enterCode": "Enter coupon code",
144
144
  "couponCode.errorContainer": "Something went wrong. Please refresh and try again.",
145
145
  "couponCode.removeButton": "Remove",
146
146
  "createAccount.cancelText": "Cancel",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "3.0.3",
4
+ "version": "3.0.4",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -1,4 +1,5 @@
1
1
  module.exports = componentOverrideMapping = {
2
+ ['@magento/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js']: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js',
2
3
  ['@magento/peregrine/lib/talons/Header/useCartTrigger.js']: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/Header/useCartTrigger.js',
3
4
  ['@magento/peregrine/lib/talons/CartPage/useCartPage.js']: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/CartPage/useCartPage.js',
4
5
  [`@magento/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/CartPage/PriceSummary/priceSummary.js',
@@ -11,11 +11,6 @@ const ItemsOrdered = ({ order }) => {
11
11
  const tax = order?.total?.total_tax?.value || 0;
12
12
  const grandTotal = order?.total?.grand_total?.value || 0;
13
13
 
14
- const itemLink = useMemo(
15
- () => resourceUrl(`/${urlKey}${urlSuffix || ''}`),
16
- [urlKey, urlSuffix]
17
- );
18
-
19
14
  return (
20
15
  <>
21
16
  <div className='rounded-md border border-gray-100 pb-4'>
@@ -34,7 +29,7 @@ const ItemsOrdered = ({ order }) => {
34
29
  {items.map((item, idx) => (
35
30
  <tr key={item.id || idx} className='border-b border-gray-150'>
36
31
  <td className="col name text-left align-top py-3 px-2.5" data-th="Product Name">
37
- <Link to={itemLink} className="product name product-item-name">{item.product_name}</Link>
32
+ <strong className="product name product-item-name">{item.product_name}</strong>
38
33
  {item.selected_options && item.selected_options.length > 0 && (
39
34
  <dl className="item-options">
40
35
  {item.selected_options.map((opt, i) => (
@@ -4,9 +4,7 @@ import { Link } from 'react-router-dom';
4
4
  import Select from '@riosst100/pwa-marketplace/src/components/commons/Select';
5
5
  import TextField from '@riosst100/pwa-marketplace/src/components/commons/Textfield';
6
6
  import Checkbox from '@riosst100/pwa-marketplace/src/components/commons/Checkbox';
7
- import QuantityStepper from '@magento/venia-ui/lib/components/QuantityStepper';
8
- import defaultClasses from './productItem.module.css';
9
- import { useStyle } from '@magento/venia-ui/lib/classify';
7
+
10
8
 
11
9
  const productItem = (props) => {
12
10
  const {
@@ -43,8 +41,6 @@ const productItem = (props) => {
43
41
  // Input change handler with qty_requested validation
44
42
  const handleFieldChange = (field, value) => {
45
43
  if (field === 'qty_requested' && item && item.quantity_ordered) {
46
- console.log('value',value)
47
- console.log('item.quantity_ordered',item.quantity_ordered)
48
44
  if (value > item.quantity_ordered) {
49
45
  value = item.quantity_ordered;
50
46
  }
@@ -55,8 +51,6 @@ const productItem = (props) => {
55
51
  if (onItemChange) onItemChange(field, value);
56
52
  };
57
53
 
58
- const classes = useStyle(defaultClasses, props.classes);
59
-
60
54
  return (
61
55
  <>
62
56
  <div className='item flex flex-col lg_flex-row justify-between border border-gray-100 rounded-md p-4'>
@@ -108,47 +102,23 @@ const productItem = (props) => {
108
102
  <p className='mb-1'>
109
103
  Qty Return
110
104
  </p>
111
- <QuantityStepper
112
- classes={{
113
- root: classes.quantityRoot
114
- }}
115
- initialValue={item.quantity_ordered}
116
- // itemId={item.id}
117
- />
118
- {/* <TextField
119
- type="number"
105
+ <TextField
120
106
  value={
121
- itemState.qty_requested !== undefined
122
- ? String(itemState.qty_requested)
123
- : ''
107
+ itemState.qty_requested > item.quantity_ordered
108
+ ? item.quantity_ordered
109
+ : itemState.qty_requested || ''
124
110
  }
125
- min={1}
126
- max={item.quantity_ordered}
127
- onChange={(e) => {
128
- let val = e.target.value;
129
-
130
- // Jika kosong
131
- if (val === '') {
132
- handleFieldChange('qty_requested', '');
133
- return;
134
- }
135
-
136
- val = parseFloat(val);
137
-
138
- if (isNaN(val)) {
139
- handleFieldChange('qty_requested', '');
140
- return;
141
- }
142
-
143
- // batas maksimum
111
+ onChange={e => {
112
+ let val = parseFloat(e.target.value);
113
+ if (isNaN(val)) val = '';
144
114
  if (val > item.quantity_ordered) val = item.quantity_ordered;
145
-
146
- // batas minimum
147
- if (val < 1) val = 1;
148
-
115
+ if (val < 1 && val !== '') val = 1;
149
116
  handleFieldChange('qty_requested', val);
150
117
  }}
151
- /> */}
118
+ type="number"
119
+ min={1}
120
+ max={item.quantity_ordered}
121
+ />
152
122
  </div>
153
123
  <div className='flex flex-col mb-2.5'>
154
124
  <p className='mb-1'>
@@ -1 +1,2 @@
1
1
  export { default } from './sellerCoupon';
2
+ export { default as SellerCouponCheckoutShimmer } from './sellerCouponCheckout.shimmer';
@@ -1,5 +1,6 @@
1
- import React, { useMemo, useState } from 'react';
1
+ import React, { useMemo, useState, useCallback } from 'react';
2
2
  import classes from './sellerCoupon.module.css';
3
+ import SellerCouponCheckout from '@riosst100/pwa-marketplace/src/components/SellerCoupon/sellerCouponCheckout';
3
4
 
4
5
  const dayDiff = (toDate) => {
5
6
  if (!toDate) return null;
@@ -13,20 +14,24 @@ const dayDiff = (toDate) => {
13
14
 
14
15
  const SellerCoupon = ({ couponData, couponError, couponLoading }) => {
15
16
  if (couponLoading) {
16
- return <div className={classes.container}><p className={classes.metaText}>Loading coupons...</p></div>;
17
+ return '';
18
+ // return <div className={classes.container}><p className={classes.metaText}>Loading coupons...</p></div>;
17
19
  }
18
20
 
19
21
  if (couponError) {
20
- return <div className={classes.container}><p className={classes.metaText}>Failed to load coupons.</p></div>;
22
+ return '';
23
+ // return <div className={classes.container}><p className={classes.metaText}>Failed to load coupons.</p></div>;
21
24
  }
22
25
 
23
26
  const items = couponData?.sellerCoupons?.items || [];
24
27
 
25
28
  if (!items.length) {
26
- return <div className={classes.container}><p className={classes.metaText}>No coupons available.</p></div>;
29
+ return '';
30
+ // return <div className={classes.container}><p className={classes.metaText}>No coupons available.</p></div>;
27
31
  }
28
32
 
29
33
  const [copied, setCopied] = useState(null);
34
+ const [couponModalOpen, setCouponModalOpen] = useState(false);
30
35
 
31
36
  const handleClaim = async (code) => {
32
37
  try {
@@ -40,10 +45,14 @@ const SellerCoupon = ({ couponData, couponError, couponLoading }) => {
40
45
  setTimeout(() => setCopied(null), 2000);
41
46
  };
42
47
 
48
+ const handleViewCoupons = useCallback(() => {
49
+ setCouponModalOpen(true);
50
+ }, [setCouponModalOpen]);
51
+
43
52
  return (
44
53
  <section className={classes.container} aria-label="Seller coupons">
45
54
  <div className={classes.scroller}>
46
- {items.map(item => {
55
+ {items.slice(0, 3).map(item => {
47
56
  const key = item.couponcode_id || item.coupon_id || item.code;
48
57
  const daysLeft = dayDiff(item.to_date);
49
58
  const expiryLabel = daysLeft === null
@@ -66,7 +75,7 @@ const SellerCoupon = ({ couponData, couponError, couponLoading }) => {
66
75
  <div className={classes.actions}>
67
76
  <button
68
77
  type="button"
69
- className={classes.claimBtn}
78
+ className={copied === item.code ? classes.claimedBtn : classes.claimBtn}
70
79
  onClick={() => handleClaim(item.code)}
71
80
  aria-label={`Claim coupon ${item.code}`}
72
81
  >
@@ -76,6 +85,32 @@ const SellerCoupon = ({ couponData, couponError, couponLoading }) => {
76
85
  </div>
77
86
  );
78
87
  })}
88
+ {couponModalOpen && (
89
+ <SellerCouponCheckout
90
+ couponData={couponData}
91
+ couponLoading={couponLoading}
92
+ couponError={couponError}
93
+ autoOpen={true}
94
+ closeOnClaim={true}
95
+ couponModalOpen={couponModalOpen}
96
+ setCouponModalOpen={setCouponModalOpen}
97
+ onSelectCoupon={handleClaim}
98
+ onTriggerRender={() => null}
99
+ isCopyAction={true}
100
+ />
101
+ )}
102
+ <div className={classes.viewAllCard} role="group" aria-label="View All Coupons">
103
+ <div className={classes.actions}>
104
+ <button
105
+ type="button"
106
+ className={classes.viewAllBtn}
107
+ onClick={handleViewCoupons}
108
+ aria-label="View All Coupons"
109
+ >
110
+ View All Coupons
111
+ </button>
112
+ </div>
113
+ </div>
79
114
  </div>
80
115
  </section>
81
116
  );
@@ -19,6 +19,14 @@
19
19
  padding:8px 4px 12px;
20
20
  scroll-snap-type:x mandatory;
21
21
  }
22
+ .viewAllCard {
23
+ position:relative;
24
+ display:flex;
25
+ align-items:stretch;
26
+ padding:0 12px 0 24px;
27
+ scroll-snap-align:start;
28
+ overflow:hidden;
29
+ }
22
30
  .card{
23
31
  position:relative;
24
32
  background:#fff8f1;
@@ -90,6 +98,20 @@
90
98
  justify-content:center;
91
99
  padding:10px 0;
92
100
  }
101
+ .viewAllBtn {
102
+ color:#f76b1c;
103
+ padding:8px 18px;
104
+ font-weight:600;
105
+ cursor:pointer;
106
+ text-decoration:underline;
107
+ }
108
+ .claimedBtn {
109
+ color: #a19791;
110
+ border:none;
111
+ border-radius:6px;
112
+ padding:8px 18px;
113
+ cursor:pointer;
114
+ }
93
115
  .claimBtn{
94
116
  background: #f76b1c;
95
117
  color:#fff;
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
2
2
  import ReactDOM from 'react-dom';
3
3
  import listClasses from './sellerCoupon.module.css';
4
4
  import modalClasses from './sellerCouponCheckout.module.css';
5
+ import { SellerCouponCheckoutShimmer } from '@riosst100/pwa-marketplace/src/components/SellerCoupon';
5
6
 
6
7
  // Reuse day diff logic
7
8
  const dayDiff = (toDate) => {
@@ -28,23 +29,26 @@ const getPortalRoot = () => {
28
29
  const SellerCouponCheckout = ({
29
30
  couponData,
30
31
  couponError,
32
+ setCouponModalOpen,
33
+ couponModalOpen,
31
34
  couponLoading,
35
+ isCopyAction,
32
36
  triggerLabel = 'View Seller Coupons',
33
37
  onSelectCoupon,
34
38
  onTriggerRender, // optional custom trigger renderer
35
39
  autoOpen = false, // auto open modal when mounted
36
40
  closeOnClaim = true // close after claiming
37
41
  }) => {
38
- const [open, setOpen] = useState(false);
42
+ // const [open, setOpen] = useState(false);
39
43
  const [copied, setCopied] = useState(null);
40
44
 
41
45
  const items = couponData?.sellerCoupons?.items || [];
42
46
 
43
- const handleOpen = () => setOpen(true);
44
- const handleClose = () => setOpen(false);
47
+ const handleOpen = () => setCouponModalOpen(true);
48
+ const handleClose = () => setCouponModalOpen(false);
45
49
 
46
50
  useEffect(() => {
47
- if (!open) return;
51
+ if (!couponModalOpen) return;
48
52
  const onKey = (e) => {
49
53
  if (e.key === 'Escape') {
50
54
  handleClose();
@@ -52,7 +56,7 @@ const SellerCouponCheckout = ({
52
56
  };
53
57
  document.addEventListener('keydown', onKey);
54
58
  return () => document.removeEventListener('keydown', onKey);
55
- }, [open]);
59
+ }, [couponModalOpen]);
56
60
 
57
61
  const handleClaim = async (item) => {
58
62
  try {
@@ -62,29 +66,34 @@ const SellerCouponCheckout = ({
62
66
  } catch (_) {
63
67
  /* ignore */
64
68
  }
69
+ console.log('item.code',item.code)
65
70
  setCopied(item.code);
66
71
  setTimeout(() => setCopied(null), 2000);
67
- if (onSelectCoupon) onSelectCoupon(item);
68
- if (closeOnClaim) handleClose();
72
+ if (!isCopyAction) {
73
+ if (onSelectCoupon) onSelectCoupon(item);
74
+ if (closeOnClaim) handleClose();
75
+ }
69
76
  };
70
77
 
71
78
  // Auto open behavior
72
79
  useEffect(() => {
73
- if (autoOpen && !open) {
74
- setOpen(true);
80
+ if (autoOpen && !couponModalOpen) {
81
+ setCouponModalOpen(true);
75
82
  }
76
- }, [autoOpen, open]);
83
+ }, [autoOpen, couponModalOpen]);
84
+
85
+ console.log('copied',copied)
77
86
 
78
- const modal = open ? (
87
+ const modal = couponModalOpen ? (
79
88
  <div className={modalClasses.overlay} role="dialog" aria-modal="true" aria-label="Seller coupons list">
80
89
  <div className={modalClasses.backdrop} onClick={handleClose} />
81
90
  <div className={modalClasses.dialog}>
82
91
  <div className={modalClasses.header}>
83
- <h2 className={modalClasses.title}>Seller Coupons</h2>
92
+ <h2 className={modalClasses.title}>{isCopyAction ? 'Store Coupons' : 'Apply Coupon'}</h2>
84
93
  <button type="button" className={modalClasses.closeBtn} onClick={handleClose} aria-label="Close coupon modal">×</button>
85
94
  </div>
86
95
  <div className={modalClasses.body}>
87
- {couponLoading && <p className={listClasses.metaText}>Loading coupons...</p>}
96
+ {couponLoading && <SellerCouponCheckoutShimmer />}
88
97
  {!couponLoading && couponError && <p className={listClasses.metaText}>Failed to load coupons.</p>}
89
98
  {!couponLoading && !couponError && !items.length && <p className={listClasses.metaText}>No coupons available.</p>}
90
99
  {!couponLoading && !couponError && items.length > 0 && (
@@ -108,14 +117,22 @@ const SellerCouponCheckout = ({
108
117
  </div>
109
118
  <div className={listClasses.divider} aria-hidden="true" />
110
119
  <div className={listClasses.actions}>
111
- <button
120
+ {isCopyAction ? <button
112
121
  type="button"
113
- className={listClasses.claimBtn}
122
+ className={copied === item.code ? listClasses.claimedBtn : listClasses.claimBtn}
114
123
  onClick={() => handleClaim(item)}
115
124
  aria-label={`Claim coupon ${item.code}`}
116
125
  >
117
126
  {copied === item.code ? 'Copied' : 'Claim'}
118
- </button>
127
+ </button> :
128
+ <button
129
+ type="button"
130
+ className={copied === item.code ? listClasses.claimedBtn : listClasses.claimBtn}
131
+ onClick={() => handleClaim(item)}
132
+ aria-label={`Apply coupon ${item.code}`}
133
+ >
134
+ {copied === item.code ? 'Applied' : 'Apply'}
135
+ </button>}
119
136
  </div>
120
137
  </div>
121
138
  );
@@ -128,20 +145,20 @@ const SellerCouponCheckout = ({
128
145
  ) : null;
129
146
 
130
147
  const trigger = onTriggerRender
131
- ? onTriggerRender({ open, setOpen, handleOpen })
148
+ ? onTriggerRender({ couponModalOpen, setCouponModalOpen, handleOpen })
132
149
  : (
133
150
  <button
134
151
  type="button"
135
152
  className={modalClasses.triggerBtn}
136
153
  onClick={handleOpen}
137
154
  aria-haspopup="dialog"
138
- aria-expanded={open}
155
+ aria-expanded={couponModalOpen}
139
156
  >
140
157
  {triggerLabel}
141
158
  </button>
142
159
  );
143
160
 
144
- return <>{onTriggerRender ? trigger : trigger}{open ? ReactDOM.createPortal(modal, getPortalRoot()) : null}</>;
161
+ return <>{onTriggerRender ? trigger : trigger}{couponModalOpen ? ReactDOM.createPortal(modal, getPortalRoot()) : null}</>;
145
162
  };
146
163
 
147
164
  export default SellerCouponCheckout;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
3
+
4
+ const SellerCouponCheckout = props => {
5
+ return (
6
+ <>
7
+ <Shimmer width="100%" height="85.1px" />
8
+ <Shimmer width="100%" height="85.1px" />
9
+ <Shimmer width="100%" height="85.1px" />
10
+ <Shimmer width="100%" height="85.1px" />
11
+ <Shimmer width="100%" height="85.1px" />
12
+ <Shimmer width="100%" height="85.1px" />
13
+ <Shimmer width="100%" height="85.1px" />
14
+ <Shimmer width="100%" height="85.1px" />
15
+ <Shimmer width="100%" height="85.1px" />
16
+ <Shimmer width="100%" height="85.1px" />
17
+ </>
18
+ );
19
+ };
20
+
21
+ export default SellerCouponCheckout;
@@ -104,8 +104,6 @@ export const usePriceSummary = (props = {}) => {
104
104
  // }
105
105
  // });
106
106
 
107
- await setCheckoutState(true);
108
-
109
107
  await createSellerCart({ initCheckoutSplitCart, sellerUrl });
110
108
 
111
109
  await removeCart();
@@ -114,6 +112,8 @@ export const usePriceSummary = (props = {}) => {
114
112
  await createCart({
115
113
  fetchCartId
116
114
  });
115
+
116
+ await setCheckoutState(true);
117
117
 
118
118
  history.push('/checkout');
119
119
  }, [history, setCheckoutState, createSellerCart, fetchCartId, createCart, apolloClient, removeCart, cartId, initCheckoutSplitCart, initCheckoutSplitCartData]);
@@ -93,31 +93,31 @@ const CouponCode = props => {
93
93
  }
94
94
 
95
95
  if (data.cart.applied_coupons) {
96
- const codes = data.cart.applied_coupons.map(({ code }) => {
97
- return (
98
- <Fragment key={code}>
99
- <span>{code}</span>
100
- <LinkButton
101
- className={classes.removeButton}
102
- disabled={removingCoupon}
103
- data-cy="CouponCode-removeCouponButton"
104
- onClick={() => {
105
- handleRemoveCoupon(code);
106
- }}
107
- onKeyDown={() => {
108
- handleRemoveCouponOnEnter(code);
109
- }}
110
- >
111
- <FormattedMessage
112
- id={'couponCode.removeButton'}
113
- defaultMessage={'Remove'}
114
- />
115
- </LinkButton>
116
- </Fragment>
117
- );
118
- });
96
+ // const codes = data.cart.applied_coupons.map(({ code }) => {
97
+ // return (
98
+ // <Fragment key={code}>
99
+ // <span>{code}</span>
100
+ // <LinkButton
101
+ // className={classes.removeButton}
102
+ // disabled={removingCoupon}
103
+ // data-cy="CouponCode-removeCouponButton"
104
+ // onClick={() => {
105
+ // handleRemoveCoupon(code);
106
+ // }}
107
+ // onKeyDown={() => {
108
+ // handleRemoveCouponOnEnter(code);
109
+ // }}
110
+ // >
111
+ // <FormattedMessage
112
+ // id={'couponCode.removeButton'}
113
+ // defaultMessage={'Remove'}
114
+ // />
115
+ // </LinkButton>
116
+ // </Fragment>
117
+ // );
118
+ // });
119
119
 
120
- return <div className={classes.appliedCoupon}>{codes}</div>;
120
+ return '';
121
121
  } else {
122
122
  const errorMessage = deriveErrorMessage([
123
123
  errors.get('applyCouponMutation')
@@ -160,9 +160,6 @@ const CouponCode = props => {
160
160
  priority={'normal'}
161
161
  type={'submit'}
162
162
  onKeyDown={handleApplyCouponOnEnter}
163
- classes={{
164
- content: 'gap-1.5 grid-flow-col inline-grid items-center justify-center justify-items-center capitalize font-medium'
165
- }}
166
163
  >
167
164
  <FormattedMessage
168
165
  id={'couponCode.apply'}
@@ -2,6 +2,7 @@
2
2
  .entryForm,
3
3
  .entryFormError {
4
4
  composes: gap-x-sm from global;
5
+ composes: pb-2 from global;
5
6
  composes: grid from global;
6
7
  composes: grid-cols-autoLast from global;
7
8
  }
@@ -14,6 +15,7 @@
14
15
  /* switch to rows. */
15
16
  grid-template-columns: unset;
16
17
  grid-template-rows: 1fr 1fr;
18
+ composes: pb-2 from global;
17
19
  }
18
20
  }
19
21
 
@@ -10,6 +10,7 @@ import GiftCardSummary from './giftCardSummary';
10
10
  import GiftOptionsSummary from './giftOptionsSummary';
11
11
  import ShippingSummary from './shippingSummary';
12
12
  import TaxSummary from './taxSummary';
13
+ import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
13
14
  import cn from 'classnames';
14
15
 
15
16
  /**
@@ -74,9 +75,10 @@ const PriceSummary = props => {
74
75
 
75
76
  const isPriceUpdating = isUpdating || isLoading;
76
77
  const priceClass = isPriceUpdating ? classes.priceUpdating : classes.price;
77
- const totalPriceClass = isPriceUpdating
78
- ? classes.priceUpdating
79
- : classes.totalPrice;
78
+ const totalPriceClass = classes.totalPrice;
79
+ // const totalPriceClass = isPriceUpdating
80
+ // ? classes.priceUpdating
81
+ // : classes.totalPrice;
80
82
 
81
83
  const totalPriceLabel = isCheckout
82
84
  ? formatMessage({
@@ -88,7 +90,7 @@ const PriceSummary = props => {
88
90
  defaultMessage: 'Estimated Total'
89
91
  });
90
92
 
91
- const proceedToCheckoutButton = (
93
+ const proceedToCheckoutButton = !isCheckout && (
92
94
  <div className={cn(classes.checkoutButton_container, 'block !mt-6 !min-h-auto')}>
93
95
  <Button
94
96
  disabled={isPriceUpdating}
@@ -127,8 +129,15 @@ const PriceSummary = props => {
127
129
  );
128
130
 
129
131
  return (
130
- <div className={cn(classes.root, 'pb-6 px-3')} data-cy="PriceSummary-root">
132
+ <div className={cn(classes.root, isCheckout ? 'pb-0 px-3' : 'pb-6 px-3')} data-cy="PriceSummary-root">
131
133
  {isCheckout && (
134
+ isPriceUpdating ? <>
135
+ <Shimmer width="100%" height="20px" />
136
+ <Shimmer width="100%" height="20px" />
137
+ <Shimmer width="100%" height="20px" />
138
+ <Shimmer width="100%" height="20px" />
139
+ <Shimmer width="100%" height="20px" />
140
+ </> :
132
141
  <div>
133
142
  <ul>
134
143
  <li className={classes.lineItems}>
@@ -75,10 +75,6 @@ const CartPage = props => {
75
75
  return fullPageLoadingIndicator;
76
76
  }
77
77
 
78
- const priceSummary = hasItems ? (
79
- <PriceSummary isUpdating={isCartUpdating} />
80
- ) : null;
81
-
82
78
  const productListing = hasItems ? (
83
79
  <ProductListing
84
80
  onAddToWishlistSuccess={onAddToWishlistSuccess}
@@ -132,9 +128,6 @@ const CartPage = props => {
132
128
  {priceAdjustments}
133
129
  </div> */}
134
130
  {/* <div className={classes.summary_container}>
135
- <div className={classes.summary_contents}>
136
- {priceSummary}
137
- </div>
138
131
  </div> */}
139
132
  </div>
140
133
  </div>