@riosst100/pwa-marketplace 3.3.0 → 3.3.2
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.
- package/package.json +1 -1
- package/src/components/AboutUs/aboutUs.css +111 -0
- package/src/components/AboutUs/aboutUs.js +6 -2
- package/src/components/AgeVerification/ageVerification.js +121 -0
- package/src/components/AgeVerification/index.js +1 -2
- package/src/components/AgeVerificationModal/ageVerificationModal.js +83 -0
- package/src/components/{AgeVerification → AgeVerificationModal}/ageVerificationModal.module.css +77 -10
- package/src/components/AgeVerificationModal/index.js +2 -0
- package/src/components/Messages/messages.js +0 -10
- package/src/components/PrivacyPolicy/index.js +1 -0
- package/src/components/PrivacyPolicy/privacyPolicy.css +125 -0
- package/src/components/PrivacyPolicy/privacyPolicy.js +13 -0
- package/src/components/RFQPage/quoteDetail.js +2 -3
- package/src/components/ShowMore/showMore.js +8 -5
- package/src/components/TermsOfUse/index.js +1 -0
- package/src/components/TermsOfUse/termsOfUse.css +113 -0
- package/src/components/TermsOfUse/termsOfUse.js +13 -0
- package/src/intercept.js +23 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategory.js +0 -4
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +2 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +1 -1
- package/src/overwrites/venia-ui/lib/RootComponents/Product/product.js +2 -0
- package/src/overwrites/venia-ui/lib/components/Adapter/adapter.js +0 -23
- package/src/overwrites/venia-ui/lib/components/Footer/footer.js +2 -2
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/components/productFAQ.js +82 -0
- package/src/overwrites/venia-ui/lib/components/ProductFullDetail/productFullDetail.js +49 -42
- package/src/talons/AgeVerification/ageVerification.gql.js +31 -0
- package/src/talons/AgeVerification/useAgeVerification.js +126 -0
- package/src/talons/ProductFAQ/productFaq.gql.js +39 -0
- package/src/talons/ProductFAQ/useProductFAQ.js +48 -0
- package/src/talons/RFQ/useRFQ.js +0 -2
- package/src/components/AgeVerification/ageVerificationModal.js +0 -163
- package/src/components/AgeVerification/sellerCoupon.js +0 -119
- package/src/components/AgeVerification/sellerCouponCheckout.js +0 -164
- /package/src/components/{AgeVerification → AgeVerificationModal}/ageVerificationModal.shimmer.js +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
/* Theme color variables mapped from tcg-theme-preset.js */
|
|
3
|
+
--tcg-color-text: #1B1B1B; /* textColor.colorDefault */
|
|
4
|
+
--tcg-color-link: #3d84ff; /* brand.base */
|
|
5
|
+
--tcg-color-link-hover: #f76b1c; /* brand.dark */
|
|
6
|
+
--tcg-color-border: #E6E9EA; /* gray.100 */
|
|
7
|
+
--tcg-color-table-head-bg: #F8F8F8; /* gray.50 */
|
|
8
|
+
--tcg-color-muted: #999999; /* gray.200 */
|
|
9
|
+
|
|
10
|
+
max-width: 1300px;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
padding: 0 1rem;
|
|
13
|
+
color: var(--tcg-color-text);
|
|
14
|
+
}
|
|
15
|
+
@media (min-width: 768px) {
|
|
16
|
+
.root { padding: 0; }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Ensure CMS-injected wrapper classes are styled */
|
|
20
|
+
:global(.row-content){
|
|
21
|
+
max-width: 1300px;
|
|
22
|
+
width: 100%;
|
|
23
|
+
margin: 0 auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.root h1,
|
|
27
|
+
.root h2,
|
|
28
|
+
.root h3 {
|
|
29
|
+
margin: 1.25rem 0 0.75rem;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.root p {
|
|
34
|
+
margin: 0.75rem 0;
|
|
35
|
+
line-height: 1.7;
|
|
36
|
+
color: var(--tcg-color-text);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.root ul,
|
|
40
|
+
.root ol {
|
|
41
|
+
margin: 0.75rem 0 0.75rem 1.25rem;
|
|
42
|
+
padding-left: 1.25rem;
|
|
43
|
+
}
|
|
44
|
+
.root ul { list-style: disc; }
|
|
45
|
+
.root ol { list-style: decimal; }
|
|
46
|
+
.root li { margin: 0.375rem 0; }
|
|
47
|
+
|
|
48
|
+
.root a {
|
|
49
|
+
color: var(--tcg-color-link);
|
|
50
|
+
text-decoration: underline;
|
|
51
|
+
text-underline-offset: 2px;
|
|
52
|
+
}
|
|
53
|
+
.root a:hover {
|
|
54
|
+
color: var(--tcg-color-link-hover);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.root img {
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
height: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Headings scale */
|
|
63
|
+
.root h1 {
|
|
64
|
+
text-align: center;
|
|
65
|
+
font-size: 1.5rem;
|
|
66
|
+
line-height: 1.3;
|
|
67
|
+
margin: 1.5rem 0 0.75rem;
|
|
68
|
+
}
|
|
69
|
+
@media (min-width: 768px) {
|
|
70
|
+
.root h1 { font-size: 1.75rem; }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.root h2 {
|
|
74
|
+
font-size: 1.125rem;
|
|
75
|
+
margin: 1.25rem 0 0.5rem;
|
|
76
|
+
}
|
|
77
|
+
@media (min-width: 768px) {
|
|
78
|
+
.root h2 { font-size: 1.25rem; }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.root h3 {
|
|
82
|
+
font-size: 1rem;
|
|
83
|
+
margin: 1rem 0 0.5rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.root hr {
|
|
87
|
+
border: 0;
|
|
88
|
+
border-top: 1px solid var(--tcg-color-border);
|
|
89
|
+
margin: 2rem 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.root table {
|
|
93
|
+
width: 100%;
|
|
94
|
+
border-collapse: collapse;
|
|
95
|
+
margin: 1rem 0;
|
|
96
|
+
}
|
|
97
|
+
.root th,
|
|
98
|
+
.root td {
|
|
99
|
+
border: 1px solid var(--tcg-color-border);
|
|
100
|
+
padding: 0.5rem 0.75rem;
|
|
101
|
+
text-align: left;
|
|
102
|
+
}
|
|
103
|
+
.root thead th {
|
|
104
|
+
background: var(--tcg-color-table-head-bg);
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.root blockquote {
|
|
109
|
+
border-left: 3px solid var(--tcg-color-border);
|
|
110
|
+
padding-left: 1rem;
|
|
111
|
+
color: var(--tcg-color-muted);
|
|
112
|
+
margin: 1rem 0;
|
|
113
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import CMSPage from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/RootComponents/CMS/cms';
|
|
3
|
+
import classes from './termsOfUse.css';
|
|
4
|
+
|
|
5
|
+
const TermsOfUse = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className={classes.root}>
|
|
8
|
+
<CMSPage identifier="terms-of-use" />
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default TermsOfUse;
|
package/src/intercept.js
CHANGED
|
@@ -101,6 +101,20 @@ module.exports = targets => {
|
|
|
101
101
|
path: require.resolve("./components/AboutUs/index.js"),
|
|
102
102
|
authed: false,
|
|
103
103
|
},
|
|
104
|
+
{
|
|
105
|
+
exact: true,
|
|
106
|
+
name: "PrivacyPolicy",
|
|
107
|
+
pattern: "/privacy-policy",
|
|
108
|
+
path: require.resolve("./components/PrivacyPolicy/index.js"),
|
|
109
|
+
authed: false,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
exact: true,
|
|
113
|
+
name: "TermsOfUse",
|
|
114
|
+
pattern: "/terms-of-use",
|
|
115
|
+
path: require.resolve("./components/TermsOfUse/index.js"),
|
|
116
|
+
authed: false,
|
|
117
|
+
},
|
|
104
118
|
{
|
|
105
119
|
exact: true,
|
|
106
120
|
name: "HelpCenterQuestionDetail",
|
|
@@ -185,6 +199,7 @@ module.exports = targets => {
|
|
|
185
199
|
pattern: "/favorite-seller",
|
|
186
200
|
path: require.resolve("./components/FavoriteSellerPage/index.js"),
|
|
187
201
|
authed: true,
|
|
202
|
+
redirectTo: "/sign-in"
|
|
188
203
|
},
|
|
189
204
|
{
|
|
190
205
|
exact: true,
|
|
@@ -192,6 +207,7 @@ module.exports = targets => {
|
|
|
192
207
|
pattern: "/quotes",
|
|
193
208
|
path: require.resolve("./components/RFQPage/index.js"),
|
|
194
209
|
authed: true,
|
|
210
|
+
redirectTo: "/sign-in"
|
|
195
211
|
},
|
|
196
212
|
{
|
|
197
213
|
exact: true,
|
|
@@ -199,6 +215,7 @@ module.exports = targets => {
|
|
|
199
215
|
pattern: "/quotes/:urlKey",
|
|
200
216
|
path: require.resolve("./components/RFQPage/quoteDetailPage.js"),
|
|
201
217
|
authed: true,
|
|
218
|
+
redirectTo: "/sign-in"
|
|
202
219
|
},
|
|
203
220
|
{
|
|
204
221
|
exact: true,
|
|
@@ -206,6 +223,7 @@ module.exports = targets => {
|
|
|
206
223
|
pattern: "/return",
|
|
207
224
|
path: require.resolve("./components/RMAPage/index.js"),
|
|
208
225
|
authed: true,
|
|
226
|
+
redirectTo: "/sign-in"
|
|
209
227
|
},
|
|
210
228
|
{
|
|
211
229
|
exact: true,
|
|
@@ -213,6 +231,7 @@ module.exports = targets => {
|
|
|
213
231
|
pattern: "/return/select",
|
|
214
232
|
path: require.resolve("./components/RMAPage/RMASelectPage.js"),
|
|
215
233
|
authed: true,
|
|
234
|
+
redirectTo: "/sign-in"
|
|
216
235
|
},
|
|
217
236
|
{
|
|
218
237
|
exact: true,
|
|
@@ -220,6 +239,7 @@ module.exports = targets => {
|
|
|
220
239
|
pattern: "/return/view/:urlKey",
|
|
221
240
|
path: require.resolve("./components/RMAPage/RMADetailPage.js"),
|
|
222
241
|
authed: true,
|
|
242
|
+
redirectTo: "/sign-in"
|
|
223
243
|
},
|
|
224
244
|
{
|
|
225
245
|
exact: true,
|
|
@@ -227,6 +247,7 @@ module.exports = targets => {
|
|
|
227
247
|
pattern: "/return/create/:urlKey",
|
|
228
248
|
path: require.resolve("./components/RMAPage/RMACreatePage.js"),
|
|
229
249
|
authed: true,
|
|
250
|
+
redirectTo: "/sign-in"
|
|
230
251
|
},
|
|
231
252
|
{
|
|
232
253
|
exact: true,
|
|
@@ -234,6 +255,7 @@ module.exports = targets => {
|
|
|
234
255
|
pattern: "/order-history/view/:urlKey",
|
|
235
256
|
path: require.resolve("./components/OrderDetail/orderDetailPage.js"),
|
|
236
257
|
authed: true,
|
|
258
|
+
redirectTo: "/sign-in"
|
|
237
259
|
},
|
|
238
260
|
{
|
|
239
261
|
exact: true,
|
|
@@ -241,6 +263,7 @@ module.exports = targets => {
|
|
|
241
263
|
pattern: "/messages",
|
|
242
264
|
path: require.resolve("./components/MessagesPage/index.js"),
|
|
243
265
|
authed: true,
|
|
266
|
+
redirectTo: "/sign-in"
|
|
244
267
|
}
|
|
245
268
|
];
|
|
246
269
|
|
|
@@ -107,10 +107,6 @@ export const useCategory = props => {
|
|
|
107
107
|
loading: introspectionLoading
|
|
108
108
|
} = useQuery(getFilterInputsQuery);
|
|
109
109
|
|
|
110
|
-
// console.log(introspectionCalled)
|
|
111
|
-
// console.log(introspectionLoading)
|
|
112
|
-
// console.log(introspectionData)
|
|
113
|
-
|
|
114
110
|
// Create a type map we can reference later to ensure we pass valid args
|
|
115
111
|
// to the graphql query.
|
|
116
112
|
// For example: { category_id: 'FilterEqualTypeInput', price: 'FilterRangeTypeInput' }
|
|
@@ -21,6 +21,7 @@ import TrainsSets from '@riosst100/pwa-marketplace/src/components/TrainsSets/tra
|
|
|
21
21
|
import SetsData from '@riosst100/pwa-marketplace/src/components/SetsData/setsData';
|
|
22
22
|
import FilterContent from '@riosst100/pwa-marketplace/src/components/FilterContent/filterContent';
|
|
23
23
|
import ShowMore from '@riosst100/pwa-marketplace/src/components/ShowMore/showMore';
|
|
24
|
+
import AgeVerification from '@riosst100/pwa-marketplace/src/components/AgeVerification'
|
|
24
25
|
|
|
25
26
|
const MESSAGES = new Map().set(
|
|
26
27
|
'NOT_FOUND',
|
|
@@ -205,6 +206,7 @@ const Category = props => {
|
|
|
205
206
|
return (
|
|
206
207
|
<Fragment>
|
|
207
208
|
<Meta name="description" content={metaDescription} />
|
|
209
|
+
<AgeVerification pageType="CATEGORY" />
|
|
208
210
|
{categoryContent}
|
|
209
211
|
</Fragment>
|
|
210
212
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { Fragment, Suspense, useMemo, useRef, useState } from 'react';
|
|
1
|
+
import React, { Fragment, useEffect, Suspense, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { FormattedMessage } from 'react-intl';
|
|
3
3
|
import { array, number, shape, string } from 'prop-types';
|
|
4
4
|
|
|
@@ -8,6 +8,7 @@ import { StoreTitle, Meta } from '@magento/venia-ui/lib/components/Head';
|
|
|
8
8
|
import ProductFullDetail from '@magento/venia-ui/lib/components/ProductFullDetail';
|
|
9
9
|
import mapProduct from '@magento/venia-ui/lib/util/mapProduct';
|
|
10
10
|
import ProductShimmer from '@magento/venia-ui/lib/RootComponents/Product/product.shimmer';
|
|
11
|
+
import AgeVerification from '@riosst100/pwa-marketplace/src/components/AgeVerification'
|
|
11
12
|
|
|
12
13
|
/*
|
|
13
14
|
* As of this writing, there is no single Product query type in the M2.3 schema.
|
|
@@ -46,6 +47,7 @@ const Product = props => {
|
|
|
46
47
|
<Fragment>
|
|
47
48
|
<StoreTitle>{product.name}</StoreTitle>
|
|
48
49
|
<Meta name="description" content={product.meta_description} />
|
|
50
|
+
<AgeVerification pageType="PRODUCT" product={product} />
|
|
49
51
|
<ProductFullDetail product={product} />
|
|
50
52
|
</Fragment>
|
|
51
53
|
);
|
|
@@ -31,29 +31,6 @@ const Adapter = props => {
|
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
// console.log('isMaintenance',isMaintenance)
|
|
35
|
-
|
|
36
|
-
// useEffect(() => {
|
|
37
|
-
// const fetchData = async () => {
|
|
38
|
-
// axios.get(apiBase).then((response) => {
|
|
39
|
-
// // setIsMaintenance(false)
|
|
40
|
-
// }).catch((error) => {
|
|
41
|
-
// const status = error.response.status;
|
|
42
|
-
// if (status != 200) {
|
|
43
|
-
// console.log('status',status)
|
|
44
|
-
// return <MaintenancePage />;
|
|
45
|
-
// // setIsMaintenance(true)
|
|
46
|
-
// }
|
|
47
|
-
// });
|
|
48
|
-
// };
|
|
49
|
-
|
|
50
|
-
// fetchData();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// if (isMaintenance) {
|
|
54
|
-
// return <MaintenancePage />;
|
|
55
|
-
// }
|
|
56
|
-
|
|
57
34
|
const websiteCodes = [];
|
|
58
35
|
const websiteStores = useMemo(() => ({}), []);
|
|
59
36
|
const storeCurrencies = useMemo(() => ({}), []);
|
|
@@ -130,7 +130,7 @@ const Footer = props => {
|
|
|
130
130
|
<p className="text-colorDefault">{copyrightText || null}</p>
|
|
131
131
|
<ul className="flex flex-row gap-x-2.5">
|
|
132
132
|
<li data-cy="Footer-terms" className={classes.terms}>
|
|
133
|
-
<Link to="/" className="text-colorDefault underline">
|
|
133
|
+
<Link to="/terms-of-use" className="text-colorDefault underline">
|
|
134
134
|
<FormattedMessage
|
|
135
135
|
id={'footer.termsText'}
|
|
136
136
|
defaultMessage={'Terms of Use'}
|
|
@@ -139,7 +139,7 @@ const Footer = props => {
|
|
|
139
139
|
</li>
|
|
140
140
|
<Divider className="w-[1px] !h-[20px]" />
|
|
141
141
|
<li data-cy="Footer-privacy" className={classes.privacy}>
|
|
142
|
-
<Link to="/" className="text-colorDefault underline">
|
|
142
|
+
<Link to="/privacy-policy" className="text-colorDefault underline">
|
|
143
143
|
<FormattedMessage
|
|
144
144
|
id={'footer.privacyText'}
|
|
145
145
|
defaultMessage={'Privacy Policy'}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { useEffect, useMemo } from 'react';
|
|
2
|
+
import Collapsible from '@riosst100/pwa-marketplace/src/components/commons/Collapsible';
|
|
3
|
+
|
|
4
|
+
import useProductFAQ from '@riosst100/pwa-marketplace/src/talons/ProductFAQ/useProductFAQ';
|
|
5
|
+
|
|
6
|
+
const ProductFAQ = ({ productId }) => {
|
|
7
|
+
const { loadProductFaqList, productFaqListState } = useProductFAQ();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (productId) {
|
|
11
|
+
loadProductFaqList({ productId });
|
|
12
|
+
}
|
|
13
|
+
}, [productId, loadProductFaqList]);
|
|
14
|
+
|
|
15
|
+
const { data, loading, error } = productFaqListState || {};
|
|
16
|
+
const items = useMemo(() => {
|
|
17
|
+
const list = data?.productFaqList || [];
|
|
18
|
+
// Show only active items if status provided (1 = active)
|
|
19
|
+
return list.filter(it => it?.status === 1 || it?.status === '1' || it?.status === true || it?.status === 'true' || it?.status === undefined);
|
|
20
|
+
}, [data]);
|
|
21
|
+
|
|
22
|
+
if (loading) {
|
|
23
|
+
return <div className="p-4 text-sm text-gray-600">Loading FAQs…</div>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (error) {
|
|
27
|
+
return (
|
|
28
|
+
<div className="p-4 text-sm text-red-600">
|
|
29
|
+
Failed to load FAQs. Please try again.
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!items.length) {
|
|
35
|
+
return (
|
|
36
|
+
<div className="p-4 text-sm text-gray-600">
|
|
37
|
+
No FAQs available for this product.
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="space-y-2">
|
|
44
|
+
{items.map((faq, idx) => {
|
|
45
|
+
const headerStyle = {
|
|
46
|
+
color: faq?.title_color || undefined,
|
|
47
|
+
background: faq?.title_background || undefined,
|
|
48
|
+
fontSize: faq?.title_size ? `${faq.title_size}px` : undefined,
|
|
49
|
+
borderColor: faq?.border_color || undefined,
|
|
50
|
+
borderWidth: faq?.border_width ? `${faq.border_width}px` : undefined,
|
|
51
|
+
borderRadius: faq?.border_radius ? `${faq.border_radius}px` : undefined,
|
|
52
|
+
marginBottom: faq?.margin_bottom ? `${faq.margin_bottom}px` : undefined,
|
|
53
|
+
marginLeft: faq?.margin_left ? `${faq.margin_left}px` : undefined
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const bodyStyle = {
|
|
57
|
+
color: faq?.body_color || undefined,
|
|
58
|
+
background: faq?.body_background || undefined
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const title = faq?.title || `Question ${idx + 1}`;
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Collapsible
|
|
65
|
+
key={`${faq?.question_id || idx}`}
|
|
66
|
+
title={title}
|
|
67
|
+
rootClassName="border-b border-gray-100"
|
|
68
|
+
contentWrapperClassName="!mt-0"
|
|
69
|
+
titleStyle={headerStyle}
|
|
70
|
+
>
|
|
71
|
+
<div style={bodyStyle} className="p-3 text-sm leading-relaxed">
|
|
72
|
+
{faq?.answer || 'No answer provided.'}
|
|
73
|
+
</div>
|
|
74
|
+
</Collapsible>
|
|
75
|
+
);
|
|
76
|
+
})}
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default ProductFAQ;
|
|
82
|
+
|
|
@@ -30,6 +30,7 @@ import { Star1, Verify, Sms, Message, Shop, ArrowUp2 } from 'iconsax-react';
|
|
|
30
30
|
import { Link } from "react-router-dom";
|
|
31
31
|
import Divider from '@riosst100/pwa-marketplace/src/components/Divider';
|
|
32
32
|
import { GET_PAYMENT_TYPES } from '@riosst100/pwa-marketplace/src/talons/ProductContent/productContent.gql.js';
|
|
33
|
+
import ProductFAQ from './components/productFAQ';
|
|
33
34
|
|
|
34
35
|
const WishlistButton = React.lazy(() => import('@magento/venia-ui/lib/components/Wishlist/AddToListButton'));
|
|
35
36
|
const Options = React.lazy(() => import('@magento/venia-ui/lib/components/ProductOptions'));
|
|
@@ -47,8 +48,7 @@ import MessagesModal from '@riosst100/pwa-marketplace/src/components/LiveChat/Me
|
|
|
47
48
|
import SellerOperations from '@riosst100/pwa-marketplace/src/talons/Seller/seller.gql';
|
|
48
49
|
|
|
49
50
|
import { useLocation, useHistory } from 'react-router-dom';
|
|
50
|
-
|
|
51
|
-
import AgeVerificationModal from '@riosst100/pwa-marketplace/src/components/AgeVerification/ageVerificationModal';
|
|
51
|
+
import AgeVerification from '@riosst100/pwa-marketplace/src/components/AgeVerification'
|
|
52
52
|
|
|
53
53
|
import { totalListings, lowestPrice } from '@riosst100/pwa-marketplace/src/components/CrossSeller/crossSellerBuy';
|
|
54
54
|
|
|
@@ -87,7 +87,7 @@ const ProductDetailsCollapsible = (props) => {
|
|
|
87
87
|
|
|
88
88
|
const ProductFullDetail = props => {
|
|
89
89
|
const { product } = props;
|
|
90
|
-
|
|
90
|
+
|
|
91
91
|
const history = useHistory();
|
|
92
92
|
|
|
93
93
|
const { search } = useLocation();
|
|
@@ -119,7 +119,7 @@ const ProductFullDetail = props => {
|
|
|
119
119
|
errorAddingProductToCart,
|
|
120
120
|
isAddProductLoading,
|
|
121
121
|
} = talonProps;
|
|
122
|
-
|
|
122
|
+
|
|
123
123
|
const [, { addToast }] = useToasts();
|
|
124
124
|
const [{ isSignedIn }] = useUserContext();
|
|
125
125
|
|
|
@@ -349,7 +349,7 @@ const ProductFullDetail = props => {
|
|
|
349
349
|
pagebuilder: pagebuilder
|
|
350
350
|
};
|
|
351
351
|
}, [productDetailsAttributes, productDetails.sku, formatMessage]);
|
|
352
|
-
|
|
352
|
+
|
|
353
353
|
const shortDescription = productDetails.shortDescription ? (
|
|
354
354
|
<RichText
|
|
355
355
|
rootClassName="px-0"
|
|
@@ -410,7 +410,7 @@ const ProductFullDetail = props => {
|
|
|
410
410
|
}, []),
|
|
411
411
|
[customAttributesDetails.list]
|
|
412
412
|
);
|
|
413
|
-
|
|
413
|
+
|
|
414
414
|
const ProductTNC = () => (
|
|
415
415
|
<div className={cn(contentContainerClass, classes.contentContainerTabOverride)}>
|
|
416
416
|
<p>{customAttributesList.map((data, index) => {
|
|
@@ -441,21 +441,7 @@ const ProductFullDetail = props => {
|
|
|
441
441
|
</div>
|
|
442
442
|
)
|
|
443
443
|
|
|
444
|
-
|
|
445
|
-
<div className={cn(contentContainerClass, classes.contentContainerTabOverride)}>
|
|
446
|
-
{customAttributesList.map((data, index) => {
|
|
447
|
-
if (data.code == "faq") {
|
|
448
|
-
return (
|
|
449
|
-
<RichText
|
|
450
|
-
rootClassName="px-0"
|
|
451
|
-
content={data.value}
|
|
452
|
-
/>
|
|
453
|
-
);
|
|
454
|
-
}
|
|
455
|
-
})}
|
|
456
|
-
|
|
457
|
-
</div>
|
|
458
|
-
)
|
|
444
|
+
|
|
459
445
|
|
|
460
446
|
|
|
461
447
|
const getAttributeValue = (customAttributesDetails, key, useSuffix = false) => {
|
|
@@ -475,11 +461,13 @@ const ProductFullDetail = props => {
|
|
|
475
461
|
return attr.entered_attribute_value?.value || "";
|
|
476
462
|
};
|
|
477
463
|
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
const
|
|
481
|
-
const
|
|
482
|
-
const
|
|
464
|
+
// Prefer preorder info from product props; fallback to productDetails if present
|
|
465
|
+
const preorderData = (product && product.preorder) || (productDetails && productDetails.preorder) || null;
|
|
466
|
+
const preOrder = preorderData;
|
|
467
|
+
const preOrderDate = preorderData?.pre_order_date || "";
|
|
468
|
+
const preOrderDeposite = preorderData?.pre_order_deposit || "";
|
|
469
|
+
const preOrderNote = preorderData?.pre_order_notes || "";
|
|
470
|
+
const preOrderPaymentType = preorderData?.pre_order_payment_type || "";
|
|
483
471
|
const releaseDate = getAttributeValue(productCardDetailsAttributes, "release_date", true);
|
|
484
472
|
const setNameValue = getAttributeValue(productCardDetailsAttributes, "card_set", true);
|
|
485
473
|
const cardNameValue = getAttributeValue(productCardDetailsAttributes, "card_name", true);
|
|
@@ -510,6 +498,17 @@ const ProductFullDetail = props => {
|
|
|
510
498
|
preOrderClosingDateObj !== null &&
|
|
511
499
|
new Date().getTime() > preOrderClosingDateObj.getTime();
|
|
512
500
|
|
|
501
|
+
// Ensure payment type is only set for preorder products
|
|
502
|
+
useEffect(() => {
|
|
503
|
+
if (isPreOrderProduct) {
|
|
504
|
+
if (preOrderPaymentType) {
|
|
505
|
+
setSelectedPaymentType(preOrderPaymentType);
|
|
506
|
+
}
|
|
507
|
+
} else {
|
|
508
|
+
setSelectedPaymentType(null);
|
|
509
|
+
}
|
|
510
|
+
}, [isPreOrderProduct, preOrderPaymentType]);
|
|
511
|
+
|
|
513
512
|
const cartCallToActionText =
|
|
514
513
|
isPreOrderClosed
|
|
515
514
|
? (
|
|
@@ -681,7 +680,11 @@ const ProductFullDetail = props => {
|
|
|
681
680
|
{
|
|
682
681
|
id: 'product-faq',
|
|
683
682
|
title: 'FAQ',
|
|
684
|
-
content:
|
|
683
|
+
content: (
|
|
684
|
+
<div className={cn(contentContainerClass, classes.contentContainerTabOverride)}>
|
|
685
|
+
<ProductFAQ productId={product?.id} />
|
|
686
|
+
</div>
|
|
687
|
+
)
|
|
685
688
|
},
|
|
686
689
|
{
|
|
687
690
|
id: 'product-reviews',
|
|
@@ -741,7 +744,7 @@ const ProductFullDetail = props => {
|
|
|
741
744
|
};
|
|
742
745
|
|
|
743
746
|
let preorderPayload;
|
|
744
|
-
if (selectedPaymentType) {
|
|
747
|
+
if (isPreOrderProduct && selectedPaymentType) {
|
|
745
748
|
preorderPayload = {
|
|
746
749
|
pre_order_payment_type: selectedPaymentType
|
|
747
750
|
};
|
|
@@ -754,9 +757,11 @@ const ProductFullDetail = props => {
|
|
|
754
757
|
}
|
|
755
758
|
|
|
756
759
|
const nextValues = {
|
|
757
|
-
...formValues
|
|
758
|
-
preorder: preorderPayload
|
|
760
|
+
...formValues
|
|
759
761
|
};
|
|
762
|
+
if (preorderPayload) {
|
|
763
|
+
nextValues.preorder = preorderPayload;
|
|
764
|
+
}
|
|
760
765
|
await originalHandleAddToCart(nextValues);
|
|
761
766
|
} catch (e) {
|
|
762
767
|
addToast({
|
|
@@ -818,7 +823,7 @@ const ProductFullDetail = props => {
|
|
|
818
823
|
<Fragment>
|
|
819
824
|
{breadcrumbs}
|
|
820
825
|
{productPreviewMessages}
|
|
821
|
-
|
|
826
|
+
<AgeVerification />
|
|
822
827
|
<Form
|
|
823
828
|
className={classes.root}
|
|
824
829
|
data-cy="ProductFullDetail-root"
|
|
@@ -949,17 +954,19 @@ const ProductFullDetail = props => {
|
|
|
949
954
|
/>
|
|
950
955
|
</Suspense>
|
|
951
956
|
</div>
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
957
|
+
{isPreOrderProduct && (
|
|
958
|
+
<PreorderDetail
|
|
959
|
+
preOrder={preOrder}
|
|
960
|
+
preOrderDate={preOrderDate}
|
|
961
|
+
preOrderDeposite={preOrderDeposite}
|
|
962
|
+
preOrderNote={preOrderNote}
|
|
963
|
+
preOrderPaymentType={preOrderPaymentType}
|
|
964
|
+
releaseDate={releaseDate}
|
|
965
|
+
className={'preorder_detail-container'}
|
|
966
|
+
paymentTypeOptions={paymentTypeOptions}
|
|
967
|
+
onPaymentTypeChange={setSelectedPaymentType}
|
|
968
|
+
/>
|
|
969
|
+
)}
|
|
963
970
|
<div className='product_actions-wrapper'>
|
|
964
971
|
{cartActionContent}
|
|
965
972
|
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
|
|
3
|
+
export const GET_AGE_VERIFICATION_CONFIG_QUERY = gql`
|
|
4
|
+
query GetAgeVerificationConfig(
|
|
5
|
+
$attributeCode: String
|
|
6
|
+
$attributeOption: String
|
|
7
|
+
) {
|
|
8
|
+
getAgeVerificationConfig(
|
|
9
|
+
attribute_code: $attributeCode
|
|
10
|
+
attribute_option: $attributeOption
|
|
11
|
+
) {
|
|
12
|
+
status
|
|
13
|
+
minimum_age
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export const GET_CATALOG_CONFIG_DATA_QUERY = gql`
|
|
19
|
+
query getStoreConfigData {
|
|
20
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
21
|
+
storeConfig {
|
|
22
|
+
store_code
|
|
23
|
+
marketplace_menu_topfilters_attributes
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
getAgeVerificationConfigQuery: GET_AGE_VERIFICATION_CONFIG_QUERY,
|
|
30
|
+
getMenuTopFiltersAttributesConfigDataQuery: GET_CATALOG_CONFIG_DATA_QUERY
|
|
31
|
+
};
|