@riosst100/pwa-marketplace 1.3.0 → 1.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/componentOverrideMapping.js +6 -0
- package/src/components/OperatingHours/operatingHours.js +7 -9
- package/src/components/Pagination/index.js +27 -29
- package/src/components/SellerDetail/sellerDetail.js +2 -13
- package/src/components/SellerInformation/sellerInformation.js +2 -1
- package/src/components/SellerLocation/sellerLocation.js +1 -1
- package/src/components/SellerReview/sellerReview.js +18 -10
- package/src/components/SellerReviewItem/sellerReviewItem.js +105 -20
- package/src/components/ShopByCategory/index.js +2 -0
- package/src/components/ShopByCategory/shopByCategory.js +69 -0
- package/src/components/ShopByCategory/shopByCategory.module.css +58 -0
- package/src/components/ShopByCategory/shopByCategory.shimmer.js +24 -0
- package/src/components/SubCategory/subCategory.js +31 -0
- package/src/overwrites/peregrine/lib/talons/Breadcrumbs/useBreadcrumbs.js +100 -0
- package/src/overwrites/peregrine/lib/talons/MegaMenu/megaMenu.gql.js +70 -0
- package/src/overwrites/peregrine/lib/talons/MegaMenu/useMegaMenu.js +199 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +70 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +141 -0
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +222 -0
- package/src/overwrites/venia-ui/lib/components/Adapter/adapter.js +5 -2
- package/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterDefault.js +84 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +157 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenu.js +2 -1
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +1 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.js +75 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/shopByColumn.module.css +28 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +31 -0
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenuColumn.js +1 -0
- package/src/overwrites/venia-ui/lib/components/SearchBar/searchField.js +1 -1
- package/src/talons/MegaMenu/megaMenu.gql.js +70 -0
- package/src/talons/Seller/seller.gql.js +0 -36
- package/src/talons/SellerReview/sellerReview.gql.js +53 -0
- package/src/talons/SellerReview/useSellerReview.js +49 -0
- package/src/talons/ShopByCategory/index.js +1 -0
- package/src/talons/ShopByCategory/shopByCategory.gql.js +38 -0
- package/src/talons/ShopByCategory/useShopByCategory.js +69 -0
- package/src/talons/SubCategory/subCategory.gql.js +15 -0
- package/src/talons/SubCategory/useSubCategory.js +52 -0
package/package.json
CHANGED
|
@@ -13,6 +13,12 @@ module.exports = componentOverrideMapping = {
|
|
|
13
13
|
[`@magento/peregrine/lib/talons/SignIn/signIn.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/SignIn/signIn.gql.js',
|
|
14
14
|
[`@magento/peregrine/lib/talons/SignIn/useSignIn.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/SignIn/useSignIn.js',
|
|
15
15
|
[`@magento/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/AccountMenu/useAccountMenuItems.js',
|
|
16
|
+
[`@magento/peregrine/lib/talons/MegaMenu/megaMenu.gql.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/MegaMenu/megaMenu.gql.js',
|
|
16
17
|
[`@magento/peregrine/lib/util/deriveErrorMessage.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/util/deriveErrorMessage.js',
|
|
17
18
|
[`@magento/venia-ui/lib/components/MegaMenu/megaMenu.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenu.js',
|
|
19
|
+
[`@magento/venia-ui/lib/components/FilterModal/FilterList/filterDefault.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/FilterModal/FilterList/filterDefault.js',
|
|
20
|
+
[`@magento/venia-ui/lib/RootComponents/Category/categoryContent.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js',
|
|
21
|
+
[`@magento/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js',
|
|
22
|
+
[`@magento/peregrine/lib/talons/Breadcrumbs/useBreadcrumbs.js`]: '@riosst100/pwa-marketplace/src/overwrites/peregrine/lib/talons/Breadcrumbs/useBreadcrumbs.js',
|
|
23
|
+
[`@magento/venia-ui/lib/components/FilterSidebar/filterSidebar.js`]: '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js',
|
|
18
24
|
};
|
|
@@ -10,25 +10,23 @@ const OperatingHours = ({ values }) => {
|
|
|
10
10
|
|
|
11
11
|
const Hours = ({ values }) => {
|
|
12
12
|
return values && values.map((value, index) =>
|
|
13
|
-
|
|
13
|
+
<span key={index}>
|
|
14
14
|
<tr>
|
|
15
15
|
<td style={{"verticalAlign":"top"}}>{value.day}</td>
|
|
16
16
|
<td style={{"paddingLeft":"20px"}}>{value.status == "open" && value.time ? <Time times={value.time} /> : 'Closed'}</td>
|
|
17
17
|
</tr>
|
|
18
18
|
<br />
|
|
19
|
-
|
|
19
|
+
</span>
|
|
20
20
|
)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const Time = ({ times }) => {
|
|
24
24
|
return times ? times.map((value, index) =>
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</tr>
|
|
31
|
-
</>
|
|
25
|
+
<tr key={index}>
|
|
26
|
+
<td style={{"paddingBottom": times.length > 1 && index != times.length ? "10px" : "0px"}}>
|
|
27
|
+
{value.opening_time} - {value.closing_time}
|
|
28
|
+
</td>
|
|
29
|
+
</tr>
|
|
32
30
|
) : ''
|
|
33
31
|
}
|
|
34
32
|
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ArrowLeft2, ArrowRight2 } from 'iconsax-react';
|
|
3
3
|
|
|
4
|
-
const Pagination = () => {
|
|
4
|
+
const Pagination = ({ totalPages, currentPage, pageSize }) => {
|
|
5
|
+
|
|
6
|
+
const pageNumbers = [];
|
|
7
|
+
|
|
8
|
+
// Populate the items array with numbers from 1 to maxNumber
|
|
9
|
+
if (totalPages) {
|
|
10
|
+
for (let i = 1; i < totalPages+1; i++) {
|
|
11
|
+
pageNumbers.push(i);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const activeClass = "inline-flex flex-col items-center justify-center gap-[10px] px-[15px] py-[10px] relative flex-[0_0_auto] bg-[#6243fa] rounded-[5px] border border-solid border-[#6243fa]";
|
|
16
|
+
const bgClass = "inline-flex flex-col items-center justify-center gap-[10px] px-[15px] py-[10px] relative flex-[0_0_auto] rounded-[5px] border border-solid border-[#e6e9ea]";
|
|
17
|
+
|
|
18
|
+
const activeTextClass = "relative w-fit font-normal text-white text-[16px] tracking-[0] leading-none whitespace-nowrap";
|
|
19
|
+
const textClass = "relative w-fit font-normal text-[#6243fa] text-[16px] tracking-[0] leading-none whitespace-nowrap";
|
|
20
|
+
|
|
5
21
|
return (
|
|
6
22
|
<>
|
|
7
23
|
<div className={'inline-flex items-start gap-[10px] relative'}>
|
|
@@ -10,33 +26,15 @@ const Pagination = () => {
|
|
|
10
26
|
<ArrowLeft2 size="16" color="#6243fa" variant="Outline" />
|
|
11
27
|
</div>
|
|
12
28
|
</button>
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</button>
|
|
23
|
-
<button
|
|
24
|
-
className={'inline-flex flex-col items-center justify-center gap-[10px] px-[15px] py-[10px] relative flex-[0_0_auto] bg-[#6243fa] rounded-[5px] border border-solid border-[#6243fa]'}
|
|
25
|
-
>
|
|
26
|
-
<div className="relative w-fit font-normal text-white text-[16px] tracking-[0] leading-none whitespace-nowrap">
|
|
27
|
-
3
|
|
28
|
-
</div>
|
|
29
|
-
</button>
|
|
30
|
-
<button className="inline-flex flex-col items-center justify-center gap-[10px] px-[15px] py-[10px] relative flex-[0_0_auto] rounded-[5px] border border-solid border-[#e6e9ea]">
|
|
31
|
-
<div className="relative w-fit font-normal text-[#6243fa] text-[16px] tracking-[0] leading-none whitespace-nowrap">
|
|
32
|
-
4
|
|
33
|
-
</div>
|
|
34
|
-
</button>
|
|
35
|
-
<button className="inline-flex flex-col items-center justify-center gap-[10px] px-[15px] py-[10px] relative flex-[0_0_auto] rounded-[5px] border border-solid border-[#e6e9ea]">
|
|
36
|
-
<div className="relative w-fit font-normal text-[#6243fa] text-[16px] tracking-[0] leading-none whitespace-nowrap">
|
|
37
|
-
5
|
|
38
|
-
</div>
|
|
39
|
-
</button>
|
|
29
|
+
{pageNumbers ? pageNumbers.map((num, index) => (
|
|
30
|
+
<span key={index}>
|
|
31
|
+
<button className={num == currentPage ? activeClass : bgClass}>
|
|
32
|
+
<div className={num == currentPage ? activeTextClass : textClass}>
|
|
33
|
+
{num}
|
|
34
|
+
</div>
|
|
35
|
+
</button>
|
|
36
|
+
</span>
|
|
37
|
+
)) : ''}
|
|
40
38
|
<button className="inline-flex flex-col items-center justify-center gap-[10px] px-3 py-[10px] relative flex-[0_0_auto] rounded-[5px] border border-solid border-[#e6e9ea]">
|
|
41
39
|
<div className="relative w-fit font-normal text-[#6243fa] text-[16px] tracking-[0] leading-none whitespace-nowrap">
|
|
42
40
|
<ArrowRight2 size="16" color="#6243fa" variant="Outline" />
|
|
@@ -47,4 +45,4 @@ const Pagination = () => {
|
|
|
47
45
|
)
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
export default Pagination
|
|
48
|
+
export default Pagination;
|
|
@@ -49,7 +49,7 @@ const SellerDetail = props => {
|
|
|
49
49
|
{
|
|
50
50
|
id: 'product-tab',
|
|
51
51
|
title: 'All Products',
|
|
52
|
-
content: <SellerProducts />
|
|
52
|
+
content: <SellerProducts seller={seller} />
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
id: 'store-information',
|
|
@@ -59,7 +59,7 @@ const SellerDetail = props => {
|
|
|
59
59
|
{
|
|
60
60
|
id: 'reviews',
|
|
61
61
|
title: 'Reviews',
|
|
62
|
-
content: <Reviews />
|
|
62
|
+
content: <Reviews seller={seller} />
|
|
63
63
|
}
|
|
64
64
|
];
|
|
65
65
|
|
|
@@ -123,17 +123,6 @@ const SellerDetail = props => {
|
|
|
123
123
|
</div>
|
|
124
124
|
</div>
|
|
125
125
|
<div class="flex items-center gap-[20px] px-[10px] py-[30px] relative">
|
|
126
|
-
<div class="flex flex-col items-center justify-center gap-[9px] p-[10px] relative">
|
|
127
|
-
<div class="flex items-center gap-[6px] relative">
|
|
128
|
-
<BoxTick color="#B9AEC5" variant="Outline" size={18} className='stroke-[#B9AEC5] stroke-[.5px]' />
|
|
129
|
-
<div class="[font-family:'Noto_Sans',Helvetica] font-semibold text-[#005947] text-[18px] relative w-fit tracking-[0] leading-[normal] whitespace-nowrap">
|
|
130
|
-
{seller ? seller.sale : 0}
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
<div class="relative w-fit [font-family:'Frederik-Regular',Helvetica] font-normal text-[#009a7b] text-[10px] tracking-[0] leading-[normal] whitespace-nowrap">
|
|
134
|
-
Total Sales
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
126
|
<img class="relative self-stretch w-px object-cover" alt="Line" src="https://c.animaapp.com/2pP7niVX/img/line-16.svg" />
|
|
138
127
|
<div class="flex flex-col items-center justify-center gap-[9px] p-[10px] relative">
|
|
139
128
|
<div class="flex items-center gap-[5px] relative">
|
|
@@ -16,6 +16,7 @@ const SellerInformation = ({ seller }) => {
|
|
|
16
16
|
<p class="relative mt-[-1.00px] font-normal text-[14px] tracking-[0] leading-[16px]">
|
|
17
17
|
{seller ? seller.description : ''}<br />
|
|
18
18
|
<br />
|
|
19
|
+
<br />
|
|
19
20
|
{seller ? seller.contact_number : ''}
|
|
20
21
|
</p>
|
|
21
22
|
</div>
|
|
@@ -76,7 +77,7 @@ const SellerShipTo = ({seller}) => {
|
|
|
76
77
|
<div class="flex flex-wrap items-center gap-2 px-0 py-[5px] relative flex-1 grow">
|
|
77
78
|
{shipTo && shipTo == "Domestic" ? seller.country_id : ''}
|
|
78
79
|
{shipToCountryArr && shipTo != "Domestic" ? shipToCountryArr.map((value, index) => <>
|
|
79
|
-
<div class="inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]">
|
|
80
|
+
<div key={index} class={index == shipToCountryArr.length-1 ? "inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto]" : "inline-flex items-center justify-center gap-[10px] px-[10px] py-0 relative flex-[0_0_auto] border-r [border-right-style:solid] border-[#e6e9ea]"}>
|
|
80
81
|
<div class="relative w-fit mt-[-1.00px] font-normal text-[14px] tracking-[0] leading-[normal] whitespace-nowrap">{value}</div>
|
|
81
82
|
</div>
|
|
82
83
|
</>) : ''}
|
|
@@ -8,7 +8,7 @@ const SellerLocation = ({ storeLocators }) => {
|
|
|
8
8
|
<div class="relative w-fit font-semibold text-[20px] tracking-[0] leading-[normal]">Our Store</div>
|
|
9
9
|
<div class="w-full grid xs_grid-cols-1 md_grid-cols-2 xl_grid-cols-3 gap-4">
|
|
10
10
|
{storeLocators && storeLocators.map((value, index) =>
|
|
11
|
-
<SellerLocationItem storeLocator={value} />
|
|
11
|
+
<SellerLocationItem storeLocator={value} key={index} />
|
|
12
12
|
)}
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
@@ -2,8 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import SellerReviewItem from '../SellerReviewItem';
|
|
3
3
|
import Pagination from '../Pagination';
|
|
4
4
|
import { Star1 } from 'iconsax-react';
|
|
5
|
+
import { useSellerReview } from '@riosst100/pwa-marketplace/src/talons/SellerReview/useSellerReview';
|
|
6
|
+
|
|
7
|
+
const SellerReview = ({ seller }) => {
|
|
8
|
+
const talonProps = useSellerReview({
|
|
9
|
+
sellerUrl: seller.url_key
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const { reviews, loading } = talonProps;
|
|
5
13
|
|
|
6
|
-
const SellerReview = () => {
|
|
7
14
|
return (
|
|
8
15
|
<>
|
|
9
16
|
<div className='w-full flex items-start xs_flex-col lg_flex-row gap-[30px] '>
|
|
@@ -28,7 +35,7 @@ const SellerReview = () => {
|
|
|
28
35
|
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
29
36
|
</div>
|
|
30
37
|
</div>
|
|
31
|
-
<div className="text-center text-zinc-900 text-sm font-normal leading-[18px]">(
|
|
38
|
+
<div className="text-center text-zinc-900 text-sm font-normal leading-[18px]">({reviews ? reviews.items.length : 0} Reviews)</div>
|
|
32
39
|
</div>
|
|
33
40
|
</div>
|
|
34
41
|
<div className="w-full flex-col items-start gap-2 flex">
|
|
@@ -124,16 +131,13 @@ const SellerReview = () => {
|
|
|
124
131
|
</div>
|
|
125
132
|
<div className='flex flex-col w-full'>
|
|
126
133
|
<div className='flex flex-col w-full items-start gap-[20px] relative mb-[30px]'>
|
|
127
|
-
<
|
|
128
|
-
<SellerReviewItem />
|
|
129
|
-
<SellerReviewItem />
|
|
130
|
-
<SellerReviewItem />
|
|
131
|
-
<SellerReviewItem />
|
|
132
|
-
<SellerReviewItem />
|
|
133
|
-
<SellerReviewItem />
|
|
134
|
+
<SellerReviews reviews={reviews} />
|
|
134
135
|
</div>
|
|
135
136
|
<div className='pagination-container w-full flex justify-center'>
|
|
136
|
-
<Pagination
|
|
137
|
+
{reviews && reviews.page_info ? <Pagination
|
|
138
|
+
currentPage={reviews.page_info.current_page}
|
|
139
|
+
totalPages={reviews.page_info.total_pages}
|
|
140
|
+
pageSize={reviews.page_info.page_size} /> : ''}
|
|
137
141
|
</div>
|
|
138
142
|
</div>
|
|
139
143
|
</div>
|
|
@@ -141,4 +145,8 @@ const SellerReview = () => {
|
|
|
141
145
|
)
|
|
142
146
|
}
|
|
143
147
|
|
|
148
|
+
const SellerReviews = ({ reviews }) => {
|
|
149
|
+
return reviews && reviews.items.length ? reviews.items.map((review, index) => <SellerReviewItem review={review} key={index} /> ) : ''
|
|
150
|
+
}
|
|
151
|
+
|
|
144
152
|
export default SellerReview;
|
|
@@ -1,7 +1,90 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Star1 } from 'iconsax-react';
|
|
3
3
|
|
|
4
|
-
const SellerReviewItem = () => {
|
|
4
|
+
const SellerReviewItem = ({ review }) => {
|
|
5
|
+
const rate1 = [];
|
|
6
|
+
if (review.rate1) {
|
|
7
|
+
for (let i = 1; i < review.rate1+1; i++) {
|
|
8
|
+
rate1.push({
|
|
9
|
+
'num': i,
|
|
10
|
+
'star': true
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (review.rate1 < 5) {
|
|
15
|
+
for (let i = review.rate1+1; i < 5+1; i++) {
|
|
16
|
+
rate1.push({
|
|
17
|
+
'num': i,
|
|
18
|
+
'star': false
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const rate2 = [];
|
|
25
|
+
if (review.rate2) {
|
|
26
|
+
for (let i = 1; i < review.rate2+1; i++) {
|
|
27
|
+
rate2.push({
|
|
28
|
+
'num': i,
|
|
29
|
+
'star': true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (review.rate2 < 5) {
|
|
34
|
+
for (let i = review.rate2+1; i < 5+1; i++) {
|
|
35
|
+
rate2.push({
|
|
36
|
+
'num': i,
|
|
37
|
+
'star': false
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const rate3 = [];
|
|
44
|
+
if (review.rate3) {
|
|
45
|
+
for (let i = 1; i < review.rate3+1; i++) {
|
|
46
|
+
rate3.push({
|
|
47
|
+
'num': i,
|
|
48
|
+
'star': true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (review.rate3 < 5) {
|
|
53
|
+
for (let i = review.rate3+1; i < 5+1; i++) {
|
|
54
|
+
rate3.push({
|
|
55
|
+
'num': i,
|
|
56
|
+
'star': false
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const formatDate = (date) => {
|
|
63
|
+
const isoFormattedDate = date.replace(' ', 'T');
|
|
64
|
+
const formattedDate = new Date(isoFormattedDate).toLocaleDateString(
|
|
65
|
+
undefined,
|
|
66
|
+
{
|
|
67
|
+
year: 'numeric',
|
|
68
|
+
month: 'short',
|
|
69
|
+
day: 'numeric'
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
return formattedDate;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const getInitialName = (name) => {
|
|
77
|
+
let rgx = new RegExp(/(\p{L}{1})\p{L}+/, 'gu');
|
|
78
|
+
|
|
79
|
+
let initials = [...name.matchAll(rgx)] || [];
|
|
80
|
+
|
|
81
|
+
initials = (
|
|
82
|
+
(initials.shift()?.[1] || '') + (initials.pop()?.[1] || '')
|
|
83
|
+
).toUpperCase();
|
|
84
|
+
|
|
85
|
+
return initials;
|
|
86
|
+
}
|
|
87
|
+
|
|
5
88
|
return (
|
|
6
89
|
<>
|
|
7
90
|
<div class="flex flex-col items-start gap-[10px] p-[25px] relative self-stretch w-full flex-[0_0_auto] bg-white rounded-[6px] border border-solid border-[#e6e9ea]">
|
|
@@ -9,48 +92,42 @@ const SellerReviewItem = () => {
|
|
|
9
92
|
<div class="inline-flex flex-col items-start gap-[10px] relative flex-[0_0_auto]">
|
|
10
93
|
<div class="inline-flex items-center gap-[15px] relative flex-[0_0_auto]">
|
|
11
94
|
<div class="flex w-[40px] h-[40px] items-center justify-around gap-[10px] p-[10px] relative bg-[#4e31db] rounded-[30px]">
|
|
12
|
-
<div class="relative w-fit font-semibold text-white text-[16px] text-center tracking-[0] leading-[18px] whitespace-nowrap">
|
|
95
|
+
<div class="relative w-fit font-semibold text-white text-[16px] text-center tracking-[0] leading-[18px] whitespace-nowrap">
|
|
96
|
+
{review ? getInitialName(review.nickname) : ''}
|
|
97
|
+
</div>
|
|
13
98
|
</div>
|
|
14
99
|
<div class="inline-flex flex-col items-start gap-[10px] relative flex-[0_0_auto]">
|
|
15
|
-
<div class="relative w-fit mt-[-1.00px] font-medium text-[14px] text-center tracking-[0] leading-[18px] whitespace-nowrap">
|
|
16
|
-
|
|
100
|
+
<div class="relative w-fit mt-[-1.00px] font-medium text-[14px] text-center tracking-[0] leading-[18px] whitespace-nowrap">
|
|
101
|
+
{review ? review.nickname : ''}
|
|
102
|
+
</div>
|
|
103
|
+
<div class="relative w-fit font-medium text-[#999999] text-[12px] text-center tracking-[0] leading-[18px] whitespace-nowrap">
|
|
104
|
+
{review ? formatDate(review.created_at) : ''}
|
|
105
|
+
</div>
|
|
17
106
|
</div>
|
|
18
107
|
</div>
|
|
19
108
|
<div class="flex xs_flex-col sm_flex-row items-start xs_gap-1 sm_gap-[20px] relative flex-[0_0_auto]">
|
|
20
109
|
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
21
110
|
<div class="relative w-fit font-normal text-[14px] tracking-[0] leading-[18px] whitespace-nowrap">Price</div>
|
|
22
111
|
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
23
|
-
<
|
|
24
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
25
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
26
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
27
|
-
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
112
|
+
<ReviewRating rate={rate1} />
|
|
28
113
|
</div>
|
|
29
114
|
</div>
|
|
30
115
|
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
31
116
|
<div class="relative w-[37px] font-normal text-[14px] tracking-[0] leading-[18px]">Value</div>
|
|
32
117
|
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
33
|
-
<
|
|
34
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
35
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
36
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
37
|
-
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
118
|
+
<ReviewRating rate={rate2} />
|
|
38
119
|
</div>
|
|
39
120
|
</div>
|
|
40
121
|
<div class="inline-flex items-center gap-[10px] relative flex-[0_0_auto]">
|
|
41
122
|
<div class="relative w-fit font-normal text-[14px] tracking-[0] leading-[18px] whitespace-nowrap">Quality</div>
|
|
42
123
|
<div class="inline-flex items-start gap-[6px] relative flex-[0_0_auto]">
|
|
43
|
-
<
|
|
44
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
45
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
46
|
-
<Star1 color='#F7C317' size={14} className='fill-[#F7C317]' />
|
|
47
|
-
<Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />
|
|
124
|
+
<ReviewRating rate={rate3} />
|
|
48
125
|
</div>
|
|
49
126
|
</div>
|
|
50
127
|
</div>
|
|
51
128
|
</div>
|
|
52
129
|
<p class="relative self-stretch font-normal text-[14px] tracking-[0] leading-[18px]">
|
|
53
|
-
|
|
130
|
+
{review ? review.detail : ''}
|
|
54
131
|
</p>
|
|
55
132
|
</div>
|
|
56
133
|
</div>
|
|
@@ -58,4 +135,12 @@ const SellerReviewItem = () => {
|
|
|
58
135
|
)
|
|
59
136
|
}
|
|
60
137
|
|
|
138
|
+
const ReviewRating = ({ rate }) => {
|
|
139
|
+
return rate && rate.length ? rate.map((rating, index) => <RatingStar star={rating.star} />) : '';
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const RatingStar = ({ star }) => {
|
|
143
|
+
return star ? <Star1 color='#F7C317' size={14} className='fill-[#F7C317]' /> : <Star1 color='#D9D9D9' size={14} className='fill-[#D9D9D9]' />;
|
|
144
|
+
}
|
|
145
|
+
|
|
61
146
|
export default SellerReviewItem;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
4
|
+
import defaultClasses from './shopByCategory.module.css';
|
|
5
|
+
import { useShopByCategory } from '@riosst100/pwa-marketplace/src/talons/ShopByCategory';
|
|
6
|
+
import { Link } from 'react-router-dom';
|
|
7
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
8
|
+
|
|
9
|
+
const ShopByCategory = props => {
|
|
10
|
+
const { categoryName, children, parent } = props;
|
|
11
|
+
|
|
12
|
+
const talonProps = useShopByCategory({ children, parent });
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
childrenNormalizedData,
|
|
16
|
+
parentNormalizedData
|
|
17
|
+
} = talonProps;
|
|
18
|
+
|
|
19
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
20
|
+
|
|
21
|
+
const childrenList = [];
|
|
22
|
+
|
|
23
|
+
childrenList.push(
|
|
24
|
+
<span><b>{categoryName}</b></span>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
childrenNormalizedData ? childrenNormalizedData.map(({ text, path }) => {
|
|
28
|
+
childrenList.push(
|
|
29
|
+
<Link
|
|
30
|
+
to={resourceUrl(path)}
|
|
31
|
+
>
|
|
32
|
+
<div>{text}</div>
|
|
33
|
+
</Link>
|
|
34
|
+
)
|
|
35
|
+
}) : ''
|
|
36
|
+
|
|
37
|
+
const parentList = [];
|
|
38
|
+
parentNormalizedData ? parentNormalizedData.map(({ text, path }) => {
|
|
39
|
+
parentList.push(
|
|
40
|
+
<Link
|
|
41
|
+
to={resourceUrl(path)}
|
|
42
|
+
>
|
|
43
|
+
<div>{text}</div>
|
|
44
|
+
</Link>
|
|
45
|
+
)
|
|
46
|
+
}) : ''
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<aside
|
|
50
|
+
className={classes.root}
|
|
51
|
+
data-cy="ShopByCategory-root"
|
|
52
|
+
aria-busy="false"
|
|
53
|
+
>
|
|
54
|
+
<br />
|
|
55
|
+
<br />
|
|
56
|
+
{/* <div className={classes.body}> */}
|
|
57
|
+
{/* <ul> */}
|
|
58
|
+
<li>
|
|
59
|
+
<div><b>Shop By Category</b></div>
|
|
60
|
+
{parentList}
|
|
61
|
+
<ul className={classes.blocks}>{childrenList}</ul>
|
|
62
|
+
</li>
|
|
63
|
+
{/* </ul> */}
|
|
64
|
+
{/* </div> */}
|
|
65
|
+
</aside>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default ShopByCategory;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: bg-white from global;
|
|
3
|
+
composes: bottom-0 from global;
|
|
4
|
+
composes: hidden from global;
|
|
5
|
+
composes: max-w-modal from global;
|
|
6
|
+
composes: w-full from global;
|
|
7
|
+
composes: z-foreground from global;
|
|
8
|
+
grid-template-rows: 1fr 7rem;
|
|
9
|
+
|
|
10
|
+
composes: lg_grid from global;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.body {
|
|
14
|
+
composes: overflow-auto from global;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.header {
|
|
18
|
+
composes: flex from global;
|
|
19
|
+
composes: justify-between from global;
|
|
20
|
+
composes: pb-0 from global;
|
|
21
|
+
composes: pt-5 from global;
|
|
22
|
+
composes: px-5 from global;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.headerTitle {
|
|
26
|
+
composes: flex from global;
|
|
27
|
+
composes: items-center from global;
|
|
28
|
+
composes: leading-none from global;
|
|
29
|
+
composes: text-lg from global;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.action {
|
|
33
|
+
composes: pb-0 from global;
|
|
34
|
+
composes: pt-xs from global;
|
|
35
|
+
composes: px-xs from global;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* TODO @TW: cannot compose */
|
|
39
|
+
.action button {
|
|
40
|
+
/* composes: text-sm from global; */
|
|
41
|
+
font-size: 0.875rem;
|
|
42
|
+
/* composes: no-underline from global; */
|
|
43
|
+
text-decoration: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.blocks {
|
|
47
|
+
composes: pb-0 from global;
|
|
48
|
+
composes: pt-xs from global;
|
|
49
|
+
composes: px-xs from global;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* TODO @TW: cannot compose */
|
|
53
|
+
.blocks > li:last-child {
|
|
54
|
+
/* composes: border-b-2 from global; */
|
|
55
|
+
/* composes: border-solid from global; */
|
|
56
|
+
/* composes: border-subtle from global; */
|
|
57
|
+
border-bottom: 2px solid rgb(var(--venia-global-color-border));
|
|
58
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
4
|
+
|
|
5
|
+
import Shimmer from '@magento/venia-ui/lib/components/Shimmer';
|
|
6
|
+
import defaultClasses from './shopByCategory.module.css';
|
|
7
|
+
|
|
8
|
+
const ShopByCategory = props => {
|
|
9
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<aside className={classes.root} aria-live="polite" aria-busy="true">
|
|
13
|
+
<Shimmer width="95%" height="70vh" style={{ marginBottom: 25 }} />
|
|
14
|
+
</aside>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
ShopByCategory.propTypes = {
|
|
19
|
+
classes: shape({
|
|
20
|
+
root: string
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default ShopByCategory;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useSubCategory } from '@riosst100/pwa-marketplace/src/talons/SubCategory/useSubCategory';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
5
|
+
|
|
6
|
+
const SubCategory = props => {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
|
|
9
|
+
const talonProps = useSubCategory({ children });
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
normalizedData
|
|
13
|
+
} = talonProps;
|
|
14
|
+
|
|
15
|
+
const subCategory = [];
|
|
16
|
+
|
|
17
|
+
normalizedData && normalizedData.map(({ text, path }, index) => {
|
|
18
|
+
subCategory.push(
|
|
19
|
+
<Link
|
|
20
|
+
key={index}
|
|
21
|
+
to={resourceUrl(path)}
|
|
22
|
+
>
|
|
23
|
+
<span className="filterModalOpenButton-filterButton-qRo button-root_lowPriority-Qoh button-root-MFn border-2 border-solid cursor-pointer font-bold inline-flex items-center justify-center leading-tight max-w-full min-w-[10rem] outline-none pointer-events-auto px-sm rounded-full text-center text-sm uppercase disabled_bg-gray-400 disabled_border-gray-400 disabled_opacity-50 disabled_pointer-events-none disabled_text-white focus_shadow-inputFocus bg-transparent border-gray-700 text-gray-700 active_border-gray-800 active_text-gray-800 hover_border-gray-800 hover_text-gray-800 min-w-[6.25rem]" style={{"margin":"10px"}}>{text}</span>
|
|
24
|
+
</Link>
|
|
25
|
+
)
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
return subCategory;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default SubCategory;
|