@riosst100/pwa-marketplace 2.9.3 → 2.9.5

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 (37) hide show
  1. package/i18n/en_US.json +1 -0
  2. package/i18n/id_ID.json +1 -0
  3. package/package.json +1 -1
  4. package/src/componentOverrideMapping.js +2 -1
  5. package/src/components/ConfirmEmailPage/confirmEmail.js +76 -0
  6. package/src/components/ConfirmEmailPage/confirmEmail.module.css +71 -0
  7. package/src/components/ConfirmEmailPage/index.js +1 -0
  8. package/src/components/FavoriteSellerPage/favoriteSeller.js +0 -1
  9. package/src/components/FavoriteSellerPage/item.js +0 -2
  10. package/src/components/OrderDetail/components/itemsOrdered.js +94 -82
  11. package/src/components/OrderDetail/orderDetail.js +102 -86
  12. package/src/components/SubCategory/subCategory.js +1 -1
  13. package/src/components/VerifyEmailPage/verifyEmail.js +33 -10
  14. package/src/intercept.js +8 -1
  15. package/src/overwrites/peregrine/lib/talons/CartPage/PriceSummary/usePriceSummary.js +2 -2
  16. package/src/overwrites/peregrine/lib/talons/CheckoutPage/useCheckoutPage.js +43 -2
  17. package/src/overwrites/peregrine/lib/talons/FilterSidebar/useFilterSidebar.js +4 -1
  18. package/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderHistoryPage.gql.js +116 -0
  19. package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +7 -0
  20. package/src/overwrites/venia-ui/lib/components/AccountInformationPage/DeleteAccount.js +5 -37
  21. package/src/overwrites/venia-ui/lib/components/Adapter/adapter.js +3 -1
  22. package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +53 -58
  23. package/src/overwrites/venia-ui/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +68 -39
  24. package/src/overwrites/venia-ui/lib/components/CheckoutPage/checkoutPage.js +1 -1
  25. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +10 -2
  26. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +91 -78
  27. package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.module.css +3 -3
  28. package/src/overwrites/venia-ui/lib/components/StoreCodeRoute/storeCodeRoute.js +1 -1
  29. package/src/talons/AccountInformationPage/deleteAccount.gql.js +23 -0
  30. package/src/talons/AccountInformationPage/useDeleteAccount.js +98 -0
  31. package/src/talons/ConfirmEmailPage/confirmEmailPage.gql.js +20 -0
  32. package/src/talons/ConfirmEmailPage/useConfirmEmailPage.js +78 -0
  33. package/src/talons/OrderHistoryPage/useOrderHistoryPage.js +115 -0
  34. package/src/talons/ShopBy/useShopBy.js +12 -2
  35. package/src/talons/VerifyEmailPage/useVerifyEmailPage.js +73 -0
  36. package/src/talons/VerifyEmailPage/verifyEmailPage.gql.js +36 -0
  37. package/src/talons/WebsiteSwitcher/useWebsiteSwitcher.js +13 -2
package/i18n/en_US.json CHANGED
@@ -333,6 +333,7 @@
333
333
  "orderRow.processingText": "Processing",
334
334
  "orderRow.readyToShipText": "Ready to ship",
335
335
  "orderRow.shippedText": "Shipped",
336
+ "orderRow.ViewTransactionDetails": "View Order Details",
336
337
  "Our Story": "Our Story",
337
338
  "pagination.firstPage": "move to the first page",
338
339
  "pagination.lastPage": "move to the last page",
package/i18n/id_ID.json CHANGED
@@ -334,6 +334,7 @@
334
334
  "orderRow.processingText": "Processing",
335
335
  "orderRow.readyToShipText": "Ready to ship",
336
336
  "orderRow.shippedText": "Shipped",
337
+ "orderRow.ViewTransactionDetails": "Lihat Detail Order",
337
338
  "Our Story": "Our Story",
338
339
  "pagination.firstPage": "move to the first page",
339
340
  "pagination.lastPage": "move to the last page",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "2.9.3",
4
+ "version": "2.9.5",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -84,5 +84,6 @@ module.exports = componentOverrideMapping = {
84
84
  [`@magento/peregrine/lib/talons/MagentoRoute/useMagentoRoute.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/MagentoRoute/useMagentoRoute.js',
85
85
  [`@magento/peregrine/lib/talons/ProductOptions/useOption.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/ProductOptions/useOption.js',
86
86
  [`@magento/peregrine/lib/talons/ProductOptions/useTile.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/ProductOptions/useTile.js',
87
- [`@magento/peregrine/lib/talons/ProductImageCarousel/useProductImageCarousel.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/ProductImageCarousel/useProductImageCarousel.js'
87
+ [`@magento/peregrine/lib/talons/ProductImageCarousel/useProductImageCarousel.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/ProductImageCarousel/useProductImageCarousel.js',
88
+ [`@magento/peregrine/lib/talons/OrderHistoryPage/orderHistoryPage.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderHistoryPage.gql.js'
88
89
  };
@@ -0,0 +1,76 @@
1
+ import React, { useMemo, useEffect } from 'react';
2
+ import { FormattedMessage } from 'react-intl';
3
+ import { useStyle } from '@magento/venia-ui/lib/classify';
4
+ import defaultClasses from './confirmEmail.module.css';
5
+ import { useHistory, Link } from 'react-router-dom';
6
+ import { useConfirmEmailPage } from '@riosst100/pwa-marketplace/src/talons/ConfirmEmailPage/useConfirmEmailPage';
7
+
8
+ const ConfirmEmailPage = props => {
9
+ const classes = useStyle(defaultClasses, props.classes);
10
+
11
+ const { location } = globalThis;
12
+
13
+ const query = new URLSearchParams(location.search);
14
+ const key = query.get('key') || null;
15
+ const id = query.get('id') || null;
16
+
17
+ const { handleConfirmEmail, shouldShowLoadingIndicator, isSuccess } = useConfirmEmailPage({ id, key });
18
+
19
+ useEffect(() => {
20
+ handleConfirmEmail();
21
+ }, [handleConfirmEmail]);
22
+
23
+ return (
24
+ <div className={classes.root}>
25
+ <div className={classes.card}>
26
+ {shouldShowLoadingIndicator ? <><h2 className={classes.title}>
27
+ <FormattedMessage
28
+ id={'verifyEmail.titleVerified'}
29
+ defaultMessage={'Confirming Your Email Address'}
30
+ />
31
+ </h2>
32
+ <p className={classes.subtitle}>
33
+ <FormattedMessage
34
+ id={'verifyEmail.canSignIn'}
35
+ defaultMessage={'Please wait a moment while we verify your email address. This may take a few seconds.'}
36
+ />
37
+ </p>
38
+ <br /></> : (isSuccess ? <><h2 className={classes.title}>
39
+ <FormattedMessage
40
+ id={'verifyEmail.titleVerified'}
41
+ defaultMessage={'Your email has been verified'}
42
+ />
43
+ </h2>
44
+ <p className={classes.subtitle}>
45
+ <FormattedMessage
46
+ id={'verifyEmail.canSignIn'}
47
+ defaultMessage={'You can now Sign In with your account'}
48
+ />
49
+ </p>
50
+ <br />
51
+ <Link
52
+ className={classes.resendButton}
53
+ to={'/sign-in'}
54
+ >
55
+ <FormattedMessage
56
+ id={'verifyEmail.signInButton'}
57
+ defaultMessage={'Sign In'}
58
+ />
59
+ </Link></> : <><h2 className={classes.title}>
60
+ <FormattedMessage
61
+ id={'verifyEmail.titleExpired'}
62
+ defaultMessage={'Email Confirmation Failed'}
63
+ />
64
+ </h2>
65
+ <p className={classes.subtitle}>
66
+ <FormattedMessage
67
+ id={'verifyEmail.notValid'}
68
+ defaultMessage={'The email verification link has expired or is no longer valid.'}
69
+ />
70
+ </p></>)}
71
+ </div>
72
+ </div>
73
+ )
74
+ };
75
+
76
+ export default ConfirmEmailPage;
@@ -0,0 +1,71 @@
1
+ .root {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ min-height: 80vh;
7
+ background: #f8f9fa;
8
+ font-family: inherit;
9
+ }
10
+
11
+ .card {
12
+ background: #fff;
13
+ border-radius: 8px;
14
+ box-shadow: 0 2px 8px rgba(0,0,0,0.08);
15
+ padding: 32px 40px;
16
+ max-width: 700px;
17
+ width: 100%;
18
+ text-align: center;
19
+ }
20
+
21
+ .title {
22
+ margin-bottom: 16px;
23
+ color: #222;
24
+ font-size: 1.5rem;
25
+ font-weight: 600;
26
+ }
27
+
28
+ .subtitle {
29
+ margin-bottom: 8px;
30
+ color: #555;
31
+ font-size: 1rem;
32
+ }
33
+
34
+ .email {
35
+ font-weight: bold;
36
+ color: #eb5202;
37
+ }
38
+
39
+ .instructions {
40
+ margin-bottom: 16px;
41
+ color: #555;
42
+ font-size: 1rem;
43
+ }
44
+
45
+ .resendButton {
46
+ background: #eb5202;
47
+ color: #fff;
48
+ border: none;
49
+ border-radius: 4px;
50
+ padding: 10px 24px;
51
+ font-size: 16px;
52
+ cursor: pointer;
53
+ margin-bottom: 12px;
54
+ }
55
+ .resendButton:hover {
56
+ background: #ba4000;
57
+ border-color: #b84002;
58
+ box-shadow: 0 0 0 1px #b84002;
59
+ color: #fff;
60
+ text-decoration: none;
61
+
62
+ }
63
+ .contactHelp {
64
+ margin-top: 8px;
65
+ font-size: 14px;
66
+ }
67
+
68
+ .contactLink {
69
+ color: #eb5202;
70
+ text-decoration: underline;
71
+ }
@@ -0,0 +1 @@
1
+ export { default } from './confirmEmail';
@@ -6,7 +6,6 @@ import useFavoriteSellerList from '@riosst100/pwa-marketplace/src/talons/Favorit
6
6
  import defaultClasses from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/RootComponents/Category/category.module.css';
7
7
  import { useStyle } from '@magento/venia-ui/lib/classify';
8
8
  import Pagination from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Pagination';
9
- // import Pagination from 'riosst100/pwa-marketplace/src/components/CustomPagination';
10
9
  import React, { Fragment, Suspense, useMemo, useRef } from 'react';
11
10
 
12
11
  const FavoriteSeller = (props) => {
@@ -23,8 +23,6 @@ const Item = ({ sellerItem, refetchFavoriteSellerList }) => {
23
23
  const [, { addToast }] = useToasts();
24
24
  const { formatMessage } = useIntl();
25
25
 
26
- console.log(sellerItem.seller)
27
-
28
26
  const handleRemoveFromFavorite = async () => {
29
27
  try {
30
28
  await remove([sellerItem.seller.seller_id]);
@@ -2,127 +2,139 @@ import React from 'react'
2
2
  import { useIntl } from 'react-intl';
3
3
  import { Link } from 'react-router-dom';
4
4
 
5
- const itemsOrdered = () => {
5
+ const ItemsOrdered = ({ order }) => {
6
6
  const { formatMessage } = useIntl();
7
+ const items = order?.items || [];
8
+ const currency = order?.total?.grand_total?.currency || '-';
9
+ const subtotal = order?.total?.subtotal?.value || 0;
10
+ const shipping = order?.total?.total_shipping?.value || 0;
11
+ const tax = order?.total?.total_tax?.value || 0;
12
+ const grandTotal = order?.total?.grand_total?.value || 0;
7
13
 
8
14
  return (
9
15
  <>
10
16
  <div className='rounded-md border border-gray-100 pb-4'>
11
- <div class="hidden md_block table-wrapper order-items w-full">
12
- <table class="data table table-order-items w-full" id="my-orders-table" summary="Items Ordered">
17
+ <div className="hidden md_block table-wrapper order-items w-full">
18
+ <table className="data table table-order-items w-full" id="my-orders-table" summary="Items Ordered">
13
19
  <thead>
14
20
  <tr className='bg-gray-150'>
15
- <th class="col name text-left py-3 px-2.5 rounded-tl-md">Product Name</th>
16
- <th class="col sku text-left py-3 px-2.5">SKU</th>
17
- <th class="col price text-right py-3 px-2.5">Price</th>
18
- <th class="col qty text-right py-3 px-2.5">Qty</th>
19
- <th class="col subtotal text-right py-3 px-2.5 rounded-tr-md">Subtotal</th>
21
+ <th className="col name text-left py-3 px-2.5 rounded-tl-md">Product Name</th>
22
+ <th className="col sku text-left py-3 px-2.5">SKU</th>
23
+ <th className="col price text-right py-3 px-2.5">Price</th>
24
+ <th className="col qty text-right py-3 px-2.5">Qty</th>
25
+ <th className="col subtotal text-right py-3 px-2.5 rounded-tr-md">Subtotal</th>
20
26
  </tr>
21
27
  </thead>
22
28
  <tbody>
23
- <tr id="order-item-row-1" className='border-b border-gray-150'>
24
- <td class="col name text-left align-top py-3 px-2.5" data-th="Product Name">
25
- <strong class="product name product-item-name">Iris Workout Top</strong>
26
- <dl class="item-options">
27
- <dt>Size</dt>
28
- <dd>
29
- XS
30
- </dd>
31
- <dt>Color</dt>
32
- <dd>
33
- Red
34
- </dd>
35
- </dl>
36
- </td>
37
- <td class="col sku align-top py-3 px-2.5" data-th="SKU">
38
- WS03-XS-Red
39
- </td>
40
- <td class="col price text-right align-top py-3 px-2.5" data-th="Price">
41
- <span class="price-including-tax" data-label="Incl. Tax">
42
- <span class="cart-price">
43
- <span class="price">$31.39</span> </span>
44
- </span>
45
- </td>
46
- <td class="col qty text-right align-top py-3 px-2.5" data-th="Qty">
47
- <ul class="items-qty">
48
- <li class="item">
49
- <span class="content">
50
- 1
29
+ {items.map((item, idx) => (
30
+ <tr key={item.id || idx} className='border-b border-gray-150'>
31
+ <td className="col name text-left align-top py-3 px-2.5" data-th="Product Name">
32
+ <strong className="product name product-item-name">{item.product_name}</strong>
33
+ {item.selected_options && item.selected_options.length > 0 && (
34
+ <dl className="item-options">
35
+ {item.selected_options.map((opt, i) => (
36
+ <React.Fragment key={i}>
37
+ <dt>{opt.label}</dt>
38
+ <dd>{opt.value}</dd>
39
+ </React.Fragment>
40
+ ))}
41
+ </dl>
42
+ )}
43
+ </td>
44
+ <td className="col sku align-top py-3 px-2.5" data-th="SKU">
45
+ {item.product_sku}
46
+ </td>
47
+ <td className="col price text-right align-top py-3 px-2.5" data-th="Price">
48
+ <span className="price-including-tax" data-label="Incl. Tax">
49
+ <span className="cart-price">
50
+ <span className="price">{currency} {item.product_sale_price?.value?.toFixed(2)}</span>
51
51
  </span>
52
- </li>
53
- </ul>
54
- </td>
55
- <td class="col subtotal text-right align-top py-3 px-2.5" data-th="Subtotal">
56
- <span class="price-including-tax" data-label="Incl. Tax">
57
- <span class="cart-price">
58
- <span class="price">$31.39</span> </span>
59
- </span>
60
- </td>
61
- </tr>
52
+ </span>
53
+ </td>
54
+ <td className="col qty text-right align-top py-3 px-2.5" data-th="Qty">
55
+ <ul className="items-qty">
56
+ <li className="item">
57
+ <span className="content">
58
+ {item.quantity_ordered}
59
+ </span>
60
+ </li>
61
+ </ul>
62
+ </td>
63
+ <td className="col subtotal text-right align-top py-3 px-2.5" data-th="Subtotal">
64
+ <span className="price-including-tax" data-label="Incl. Tax">
65
+ <span className="cart-price">
66
+ <span className="price">{currency} {(item.product_sale_price?.value * item.quantity_ordered).toFixed(2)}</span>
67
+ </span>
68
+ </span>
69
+ </td>
70
+ </tr>
71
+ ))}
62
72
  </tbody>
63
73
  <tfoot className='text-right'>
64
- <tr class="subtotal">
65
- <th colspan="4" class="mark py-1 px-2.5 pt-2.5" scope="row">
74
+ <tr className="subtotal">
75
+ <th colSpan="4" className="mark py-1 px-2.5 pt-2.5" scope="row">
66
76
  Subtotal
67
77
  </th>
68
- <td class="amount py-1 px-2.5 pt-2.5" data-th="Subtotal">
69
- <span class="price">$31.39</span>
78
+ <td className="amount py-1 px-2.5 pt-2.5" data-th="Subtotal">
79
+ <span className="price">{currency} {subtotal.toFixed(2)}</span>
70
80
  </td>
71
81
  </tr>
72
- <tr class="shipping">
73
- <th colspan="4" class="mark py-1 px-2.5" scope="row">
82
+ <tr className="shipping">
83
+ <th colSpan="4" className="mark py-1 px-2.5" scope="row">
74
84
  Shipping &amp; Handling
75
85
  </th>
76
- <td class="amount py-1 px-2.5" data-th="Shipping &amp; Handling">
77
- <span class="price">$5.00</span>
86
+ <td className="amount py-1 px-2.5" data-th="Shipping &amp; Handling">
87
+ <span className="price">{currency} {shipping.toFixed(2)}</span>
78
88
  </td>
79
89
  </tr>
80
- <tr class="totals-tax">
81
- <th colspan="4" class="mark py-1 px-2.5" scope="row">
90
+ <tr className="totals-tax">
91
+ <th colSpan="4" className="mark py-1 px-2.5" scope="row">
82
92
  Tax
83
93
  </th>
84
- <td class="amount py-1 px-2.5" data-th="Tax">
85
- <span class="price">$2.39</span>
94
+ <td className="amount py-1 px-2.5" data-th="Tax">
95
+ <span className="price">{currency} {tax.toFixed(2)}</span>
86
96
  </td>
87
97
  </tr>
88
- <tr class="grand_total">
89
- <th colspan="4" class="mark py-1 px-2.5" scope="row">
98
+ <tr className="grand_total">
99
+ <th colSpan="4" className="mark py-1 px-2.5" scope="row">
90
100
  <strong>Grand Total</strong>
91
101
  </th>
92
- <td class="amount py-1 px-2.5" data-th="Grand Total">
93
- <strong><span class="price">$36.39</span></strong>
102
+ <td className="amount py-1 px-2.5" data-th="Grand Total">
103
+ <strong><span className="price">{currency} {grandTotal.toFixed(2)}</span></strong>
94
104
  </td>
95
105
  </tr>
96
106
  </tfoot>
97
107
  </table>
98
108
  </div>
99
109
  <div className='md_hidden'>
100
- <div class="orderDetails-orderTotalContainer-6or m-0 max-w-none min-w-none lg_m-auto lg_max-w-[25rem] lg_min-w-[22rem]">
110
+ <div className="orderDetails-orderTotalContainer-6or m-0 max-w-none min-w-none lg_m-auto lg_max-w-[25rem] lg_min-w-[22rem]">
101
111
  <div className='product-list p-4'>
102
- <div className='order-item flex flex-col gap-2 pb-4 border-b border-gray-150 even_pt-2'>
103
- <Link to="/">
104
- <span>
105
- STAR WARS The Vintage Collection Luke Skywalker (Jedi Academy), The Book of Boba Fett 3.75-Inch Collectible Action Figures, Ages 4 and Up
106
- </span>
107
- </Link>
108
- <div className='flex gap-2'>
109
- <span className='font-semibold'>
110
- 1 X SGD 15.76
111
- </span>
112
+ {items.map((item, idx) => (
113
+ <div key={item.id || idx} className='order-item flex flex-col gap-2 pb-4 border-b border-gray-150 even_pt-2'>
114
+ <Link to={"/product/" + item.product_sku}>
115
+ <span>
116
+ {item.product_name}
117
+ </span>
118
+ </Link>
119
+ <div className='flex gap-2'>
120
+ <span className='font-semibold'>
121
+ {item.quantity_ordered} X {currency} {item.product_sale_price?.value?.toFixed(2)}
122
+ </span>
123
+ </div>
112
124
  </div>
113
- </div>
125
+ ))}
114
126
  </div>
115
- <div class="p-4 pt-0 border-0 gap-xs grid py-xs rounded-none lg_border lg_border-solid lg_border-gray-100 lg_p-xs lg_rounded-md">
116
- <div class="orderTotal-subTotal-Eyf gap-xs grid grid-cols-autoLast"><span>Subtotal</span><span><span>SGD</span><span>&nbsp;</span><span>15</span><span>.</span><span>76</span></span></div>
117
- <div class="orderTotal-tax-DF0 gap-xs grid grid-cols-autoLast"><span>Tax</span><span><span>SGD</span><span>&nbsp;</span><span>0</span><span>.</span><span>00</span></span></div>
118
- <div class="orderTotal-shipping-dXC gap-xs grid grid-cols-autoLast"><span>Shipping</span><span><span>SGD</span><span>&nbsp;</span><span>5</span><span>.</span><span>00</span></span></div>
119
- <div class="orderTotal-total-s5t font-bold gap-xs grid grid-cols-autoLast"><span>Total</span><span><span>SGD</span><span>&nbsp;</span><span>20</span><span>.</span><span>76</span></span></div>
127
+ <div className="p-4 pt-0 border-0 gap-xs grid py-xs rounded-none lg_border lg_border-solid lg_border-gray-100 lg_p-xs lg_rounded-md">
128
+ <div className="orderTotal-subTotal-Eyf gap-xs grid grid-cols-autoLast"><span>Subtotal</span><span>{currency} {subtotal.toFixed(2)}</span></div>
129
+ <div className="orderTotal-tax-DF0 gap-xs grid grid-cols-autoLast"><span>Tax</span><span>{currency} {tax.toFixed(2)}</span></div>
130
+ <div className="orderTotal-shipping-dXC gap-xs grid grid-cols-autoLast"><span>Shipping</span><span>{currency} {shipping.toFixed(2)}</span></div>
131
+ <div className="orderTotal-total-s5t font-bold gap-xs grid grid-cols-autoLast"><span>Total</span><span>{currency} {grandTotal.toFixed(2)}</span></div>
120
132
  </div>
121
133
  </div>
122
134
  </div>
123
135
  </div>
124
136
  </>
125
- )
126
- }
137
+ );
138
+ };
127
139
 
128
- export default itemsOrdered
140
+ export default ItemsOrdered;