@riosst100/pwa-marketplace 3.1.2 → 3.1.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.
- package/package.json +1 -1
- package/src/components/BrandLandingPage/brandLanding.js +0 -5
- package/src/components/CheckoutHeader/accountTrigger.js +104 -0
- package/src/components/CheckoutHeader/cartTrigger.js +110 -0
- package/src/components/CheckoutHeader/cartTrigger.module.css +47 -0
- package/src/components/CheckoutHeader/storeSwitcher.js +119 -0
- package/src/components/CheckoutHeader/storeSwitcher.module.css +107 -0
- package/src/components/CheckoutHeader/switcherItem.js +47 -0
- package/src/components/CheckoutHeader/wishlistTrigger.js +23 -0
- package/src/components/FilterListContent/filterListPage.js +0 -25
- package/src/components/FilterTop/filterTop.js +1 -1
- package/src/components/HelpCenter/helpCenter.js +151 -0
- package/src/components/HelpCenter/helpcenter.module.css +225 -0
- package/src/components/HelpCenter/index.js +1 -0
- package/src/components/HelpCenter/questionDetail.js +89 -0
- package/src/components/ProductContent/productContent.js +1 -1
- package/src/components/RMAPage/components/productItem.css +15 -0
- package/src/components/RMAPage/components/productItem.module.css +15 -0
- package/src/components/RelatedProducts/index.js +1 -0
- package/src/components/RelatedProducts/relatedProducts.js +44 -0
- package/src/components/SellerMegaMenu/__tests__/MegaMenu.spec.js +91 -0
- package/src/components/SellerMegaMenu/__tests__/MegaMenuItem.spec.js +123 -0
- package/src/components/SellerMegaMenu/__tests__/Submenu.spec.js +61 -0
- package/src/components/SellerMegaMenu/__tests__/SubmenuColumn.spec.js +50 -0
- package/src/components/SellerMegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +114 -0
- package/src/components/SellerMegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +71 -0
- package/src/components/SellerMegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +59 -0
- package/src/components/SellerMegaMenu/__tests__/__snapshots__/SubmenuColumn.spec.js.snap +34 -0
- package/src/components/SellerMegaMenu/customSubmenuColumn.js +75 -0
- package/src/components/SellerMegaMenu/customSubmenuColumn.module.css +29 -0
- package/src/components/SellerMegaMenu/shopByColumn.js +121 -0
- package/src/components/SellerProducts/productContent.js +2 -4
- package/src/components/SetsData/setsData.js +0 -25
- package/src/components/ShopBy/shopBy.js +3 -78
- package/src/components/ShopBySets/shopBySets.js +2 -2
- package/src/components/ShowMore/showMore.js +3 -49
- package/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderHistoryPage.gql.js +1 -15
- package/src/overwrites/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js +0 -11
- package/src/overwrites/peregrine/lib/talons/RelatedProducts/productReview.gql.js +89 -0
- package/src/overwrites/peregrine/lib/talons/RelatedProducts/useRelatedProducts.js +833 -0
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/categoryContent.gql.js +0 -16
- package/src/overwrites/peregrine/lib/talons/RootComponents/Category/useCategoryContent.js +1 -5
- package/src/overwrites/venia-ui/lib/RootComponents/Category/category.js +118 -62
- package/src/overwrites/venia-ui/lib/RootComponents/Category/categoryContent.js +3 -50
- package/src/overwrites/venia-ui/lib/components/Breadcrumbs/breadcrumbs.js +1 -7
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/editModal.js +41 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/index.js +1 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productDetail.js +80 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productDetail.module.css +33 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productForm.js +153 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/EditModal/productForm.module.css +52 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/errorMessage.js +31 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/errorMessage.module.css +13 -0
- package/src/overwrites/venia-ui/lib/components/CartPage/ProductListingBySeller/quantity.js +40 -0
- package/src/overwrites/venia-ui/lib/components/FilterSidebar/filterSidebar.js +21 -92
- package/src/overwrites/venia-ui/lib/components/MegaMenu/megaMenuItem.js +6 -2
- package/src/overwrites/venia-ui/lib/components/MegaMenu/submenu.js +0 -21
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/Reviews/reviewModal.js +8 -0
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderHistoryPage.js +3 -3
- package/src/overwrites/venia-ui/lib/components/OrderHistoryPage/orderRow.js +4 -85
- package/src/talons/HelpCenter/helpCenter.gql.js +93 -0
- package/src/talons/HelpCenter/useHelpCenter.js +59 -0
- package/src/talons/ProductContent/productContent.gql.js +0 -16
- package/src/talons/ProductContent/useProductContent.js +0 -4
- package/src/talons/RelatedProducts/relatedProducts.gql.js +209 -0
- package/src/talons/RelatedProducts/useRelatedProducts.js +112 -0
- package/src/talons/SellerProducts/productContent.gql.js +1 -17
- package/src/talons/SellerProducts/useProductContent.js +1 -36
- package/src/components/AttributesBlock/attributesBlock.js +0 -54
- package/src/components/AttributesBlock/attributesBlock.module.css +0 -28
- package/src/components/ShopBy/shopBy copy.js +0 -172
- package/src/components/SubCategory/customSubCategory.js +0 -45
- package/src/components/SubCategory/customSubCategory.module.css +0 -22
- package/src/talons/AttributesBlock/attributesBlock.gql.js +0 -15
- package/src/talons/AttributesBlock/useAttributesBlock.js +0 -38
- package/src/talons/SubCategory/useCustomSubCategory.js +0 -50
package/package.json
CHANGED
|
@@ -6,7 +6,6 @@ import { useIsInViewport } from '@magento/peregrine/lib/hooks/useIsInViewport';
|
|
|
6
6
|
import { useCategoryContent } from '@magento/peregrine/lib/talons/RootComponents/Category';
|
|
7
7
|
|
|
8
8
|
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
9
|
-
import Breadcrumbs from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Breadcrumbs';
|
|
10
9
|
import FilterModalOpenButton, {
|
|
11
10
|
FilterModalOpenButtonShimmer
|
|
12
11
|
} from '@magento/venia-ui/lib/components/FilterModalOpenButton';
|
|
@@ -24,8 +23,6 @@ import defaultClasses from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/l
|
|
|
24
23
|
import NoProductsFound from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/RootComponents/Category/NoProductsFound';
|
|
25
24
|
import cn from 'classnames';
|
|
26
25
|
import ProductListTab, { ProductListTabShimmer } from '@riosst100/pwa-marketplace/src/components/ProductListTab';
|
|
27
|
-
import SubCategory from '@riosst100/pwa-marketplace/src/components/SubCategory/subCategory';
|
|
28
|
-
import AttributesBlock from '@riosst100/pwa-marketplace/src/components/AttributesBlock/attributesBlock';
|
|
29
26
|
|
|
30
27
|
import ProductLineSlider from '@riosst100/pwa-marketplace/src/components/ProductLineSlider';
|
|
31
28
|
import BrandMenu from './menu';
|
|
@@ -62,7 +59,6 @@ const CategoryContent = props => {
|
|
|
62
59
|
children,
|
|
63
60
|
totalCount,
|
|
64
61
|
totalPagesFromData,
|
|
65
|
-
attributesBlock,
|
|
66
62
|
category
|
|
67
63
|
} = talonProps;
|
|
68
64
|
|
|
@@ -187,7 +183,6 @@ const CategoryContent = props => {
|
|
|
187
183
|
<BrandInfo />
|
|
188
184
|
</section>
|
|
189
185
|
{/* <SubCategory children={children} /> */}
|
|
190
|
-
<AttributesBlock category={category} attributesBlock={attributesBlock} />
|
|
191
186
|
<section
|
|
192
187
|
className={cn(
|
|
193
188
|
'category_brand-slider my-5 before_absolute before_bg-[#F8F8F8]',
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React, { Fragment, Suspense } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { shape, string } from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { useAccountTrigger } from '@magento/peregrine/lib/talons/Header/useAccountTrigger';
|
|
6
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
7
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
8
|
+
// import AccountChip from '../AccountChip';
|
|
9
|
+
import { User as UserIcon } from 'react-feather';
|
|
10
|
+
import { darkBlue } from '@riosst100/pwa-marketplace/src/theme/vars';
|
|
11
|
+
import cn from 'classnames';
|
|
12
|
+
|
|
13
|
+
import defaultClasses from '@magento/venia-ui/lib/components/Header/accountTrigger.module.css';
|
|
14
|
+
|
|
15
|
+
const AccountMenu = React.lazy(() => import('@magento/venia-ui/lib/components/AccountMenu'));
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The AccountTrigger component is the call to action in the site header
|
|
20
|
+
* that toggles the AccountMenu dropdown.
|
|
21
|
+
*
|
|
22
|
+
* @param {Object} props
|
|
23
|
+
* @param {Object} props.classes - CSS classes to override element styles.
|
|
24
|
+
*/
|
|
25
|
+
const AccountTrigger = props => {
|
|
26
|
+
const talonProps = useAccountTrigger();
|
|
27
|
+
const {
|
|
28
|
+
accountMenuIsOpen,
|
|
29
|
+
accountMenuRef,
|
|
30
|
+
accountMenuTriggerRef,
|
|
31
|
+
setAccountMenuIsOpen,
|
|
32
|
+
handleTriggerClick,
|
|
33
|
+
isUserSignedIn
|
|
34
|
+
} = talonProps;
|
|
35
|
+
|
|
36
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
37
|
+
const rootClassName = accountMenuIsOpen ? classes.root_open : classes.root;
|
|
38
|
+
const { formatMessage } = useIntl();
|
|
39
|
+
|
|
40
|
+
const ariaLabelMyMenu = formatMessage({
|
|
41
|
+
id: 'accountTrigger.ariaLabelMyMenu',
|
|
42
|
+
defaultMessage: 'Toggle My Account Menu'
|
|
43
|
+
});
|
|
44
|
+
const ariaLabelSignIn = formatMessage({
|
|
45
|
+
id: 'accountTrigger.ariaLabelSignIn',
|
|
46
|
+
defaultMessage: 'Sign In'
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const ariaLabel = isUserSignedIn ? ariaLabelMyMenu : ariaLabelSignIn;
|
|
50
|
+
return (
|
|
51
|
+
<Fragment>
|
|
52
|
+
<div className={cn(rootClassName, '!h-auto')} ref={accountMenuTriggerRef}>
|
|
53
|
+
<button
|
|
54
|
+
aria-label={ariaLabel}
|
|
55
|
+
aria-expanded={accountMenuIsOpen}
|
|
56
|
+
className={cn(
|
|
57
|
+
classes.trigger,
|
|
58
|
+
'gap-[5px] !min-h-[30px] !h-auto !justify-between !min-w-min !w-fit',
|
|
59
|
+
)}
|
|
60
|
+
onClick={handleTriggerClick}
|
|
61
|
+
data-cy="AccountTrigger-trigger"
|
|
62
|
+
>
|
|
63
|
+
{/* <AccountChip
|
|
64
|
+
fallbackText={formatMessage({
|
|
65
|
+
id: 'accountTrigger.buttonFallback',
|
|
66
|
+
defaultMessage: 'Sign In'
|
|
67
|
+
})}
|
|
68
|
+
shouldIndicateLoading={true}
|
|
69
|
+
/> */}
|
|
70
|
+
<Icon src={UserIcon} attrs={{ width: 20 }} />
|
|
71
|
+
{isUserSignedIn ? <span className='text-base font-medium'>
|
|
72
|
+
{formatMessage({
|
|
73
|
+
id: 'accountTrigger.myAccount',
|
|
74
|
+
defaultMessage: 'My Account'
|
|
75
|
+
})}
|
|
76
|
+
</span> : <span className='text-base font-medium'>
|
|
77
|
+
{formatMessage({
|
|
78
|
+
id: 'accountTrigger.buttonFallback',
|
|
79
|
+
defaultMessage: 'Sign In'
|
|
80
|
+
})}
|
|
81
|
+
</span>}
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
<Suspense fallback={null}>
|
|
85
|
+
<AccountMenu
|
|
86
|
+
handleTriggerClick={handleTriggerClick}
|
|
87
|
+
ref={accountMenuRef}
|
|
88
|
+
accountMenuIsOpen={accountMenuIsOpen}
|
|
89
|
+
setAccountMenuIsOpen={setAccountMenuIsOpen}
|
|
90
|
+
/>
|
|
91
|
+
</Suspense>
|
|
92
|
+
</Fragment>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export default AccountTrigger;
|
|
97
|
+
|
|
98
|
+
AccountTrigger.propTypes = {
|
|
99
|
+
classes: shape({
|
|
100
|
+
root: string,
|
|
101
|
+
root_open: string,
|
|
102
|
+
trigger: string
|
|
103
|
+
})
|
|
104
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React, { Fragment, Suspense } from 'react';
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
import { ShoppingBag as ShoppingCartIcon } from 'react-feather';
|
|
4
|
+
import { useIntl } from 'react-intl';
|
|
5
|
+
|
|
6
|
+
import { useCartTrigger } from '@magento/peregrine/lib/talons/Header/useCartTrigger';
|
|
7
|
+
|
|
8
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
9
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
10
|
+
import defaultClasses from './cartTrigger.module.css';
|
|
11
|
+
import { GET_ITEM_COUNT_QUERY } from '@magento/venia-ui/lib/components/Header/cartTrigger.gql';
|
|
12
|
+
import cn from 'classnames';
|
|
13
|
+
import { ShoppingCart } from 'react-feather';
|
|
14
|
+
import { darkBlue } from '@riosst100/pwa-marketplace/src/theme/vars';
|
|
15
|
+
import { Link } from 'react-router-dom';
|
|
16
|
+
|
|
17
|
+
const CartTrigger = props => {
|
|
18
|
+
const {
|
|
19
|
+
handleLinkClick,
|
|
20
|
+
handleTriggerClick,
|
|
21
|
+
itemCount,
|
|
22
|
+
miniCartRef,
|
|
23
|
+
miniCartIsOpen,
|
|
24
|
+
hideCartTrigger,
|
|
25
|
+
setMiniCartIsOpen,
|
|
26
|
+
miniCartTriggerRef
|
|
27
|
+
} = useCartTrigger({
|
|
28
|
+
queries: {
|
|
29
|
+
getItemCountQuery: GET_ITEM_COUNT_QUERY
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
34
|
+
const { formatMessage } = useIntl();
|
|
35
|
+
const buttonAriaLabel = formatMessage(
|
|
36
|
+
{
|
|
37
|
+
id: 'cartTrigger.ariaLabel',
|
|
38
|
+
defaultMessage:
|
|
39
|
+
'Toggle mini cart. You have {count} items in your cart.'
|
|
40
|
+
},
|
|
41
|
+
{ count: itemCount }
|
|
42
|
+
);
|
|
43
|
+
const itemCountDisplay = itemCount > 99 ? '99+' : itemCount;
|
|
44
|
+
const triggerClassName = miniCartIsOpen
|
|
45
|
+
? classes.triggerContainer_open
|
|
46
|
+
: classes.triggerContainer;
|
|
47
|
+
|
|
48
|
+
const maybeItemCounter = itemCount ? (
|
|
49
|
+
<span
|
|
50
|
+
className={cn(
|
|
51
|
+
classes.counter,
|
|
52
|
+
'bg-[#f76b1c] min-w-[18px] min-h-[18px] text-[10px] font-regular leading-[18px] top-[-5px]',
|
|
53
|
+
'!left-auto right-[-4px] absolute p-0 bg'
|
|
54
|
+
)}
|
|
55
|
+
data-cy="CartTrigger-counter"
|
|
56
|
+
>
|
|
57
|
+
{itemCountDisplay}
|
|
58
|
+
</span>
|
|
59
|
+
) : null;
|
|
60
|
+
|
|
61
|
+
// const ShoppingCartIcon = <Icon src={ShoppingCart} attrs={{ width: 20 }} />;
|
|
62
|
+
|
|
63
|
+
const cartTrigger = hideCartTrigger ? null : (
|
|
64
|
+
// Because this button behaves differently on desktop and mobile
|
|
65
|
+
// we render two buttons that differ only in their click handler
|
|
66
|
+
// and control which one displays via CSS.
|
|
67
|
+
<Fragment>
|
|
68
|
+
<div className={cn(triggerClassName, '!h-auto')} ref={miniCartTriggerRef}>
|
|
69
|
+
<Link
|
|
70
|
+
className={cn(
|
|
71
|
+
classes.trigger,
|
|
72
|
+
'gap-[5px] !min-h-[30px] !h-auto !min-w-[35px] !w-fit',
|
|
73
|
+
)}
|
|
74
|
+
to='/cart'
|
|
75
|
+
>
|
|
76
|
+
<span>
|
|
77
|
+
{/* <Icon src={ShoppingCartIcon} /> */}
|
|
78
|
+
{/* <ShoppingCart size="20" color={darkBlue} className={cn('stroke-0')} variant="Outline" /> */}
|
|
79
|
+
<Icon src={ShoppingCart} attrs={{ width: 20 }} />
|
|
80
|
+
{maybeItemCounter}
|
|
81
|
+
</span>
|
|
82
|
+
</Link>
|
|
83
|
+
</div>
|
|
84
|
+
<button
|
|
85
|
+
aria-expanded={miniCartIsOpen}
|
|
86
|
+
aria-label={buttonAriaLabel}
|
|
87
|
+
className={classes.link}
|
|
88
|
+
onClick={handleLinkClick}
|
|
89
|
+
>
|
|
90
|
+
<Icon src={ShoppingCart} attrs={{ width: 20 }} />
|
|
91
|
+
{maybeItemCounter}
|
|
92
|
+
</button>
|
|
93
|
+
</Fragment>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
return cartTrigger;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default CartTrigger;
|
|
100
|
+
|
|
101
|
+
CartTrigger.propTypes = {
|
|
102
|
+
classes: shape({
|
|
103
|
+
counter: string,
|
|
104
|
+
link: string,
|
|
105
|
+
openIndicator: string,
|
|
106
|
+
root: string,
|
|
107
|
+
trigger: string,
|
|
108
|
+
triggerContainer: string
|
|
109
|
+
})
|
|
110
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.counter {
|
|
2
|
+
/* composes: absolute from global; */
|
|
3
|
+
composes: bg-brand-dark from global;
|
|
4
|
+
composes: font-medium from global;
|
|
5
|
+
composes: leading-tight from global;
|
|
6
|
+
composes: left-sm from global;
|
|
7
|
+
composes: min-w-[1.25rem] from global;
|
|
8
|
+
composes: px-1 from global;
|
|
9
|
+
composes: py-0 from global;
|
|
10
|
+
composes: rounded-full from global;
|
|
11
|
+
composes: text-white from global;
|
|
12
|
+
composes: top-1.5 from global;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.trigger {
|
|
16
|
+
composes: root from '@magento/venia-ui/lib/components/clickable.module.css';
|
|
17
|
+
|
|
18
|
+
composes: content-center from global;
|
|
19
|
+
composes: flex from global;
|
|
20
|
+
composes: h-[3rem] from global;
|
|
21
|
+
composes: justify-center from global;
|
|
22
|
+
composes: min-w-[3rem] from global;
|
|
23
|
+
composes: relative from global;
|
|
24
|
+
composes: z-foreground from global;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.triggerContainer {
|
|
28
|
+
composes: hidden from global;
|
|
29
|
+
composes: items-center from global;
|
|
30
|
+
composes: h-lg from global;
|
|
31
|
+
|
|
32
|
+
composes: lg_grid from global;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.triggerContainer_open {
|
|
36
|
+
composes: triggerContainer;
|
|
37
|
+
|
|
38
|
+
composes: shadow-headerTrigger from global;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.link {
|
|
42
|
+
composes: trigger;
|
|
43
|
+
|
|
44
|
+
composes: flex from global;
|
|
45
|
+
|
|
46
|
+
composes: lg_hidden from global;
|
|
47
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import { useStoreSwitcher } from '@magento/peregrine/lib/talons/Header/useStoreSwitcher';
|
|
5
|
+
import { availableRoutes } from '@magento/venia-ui/lib/components/Routes/routes';
|
|
6
|
+
|
|
7
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
8
|
+
import defaultClasses from '@riosst100/pwa-marketplace/src/overwrites/venia-ui/lib/components/Header/storeSwitcher.module.css';
|
|
9
|
+
import SwitcherItem from '@magento/venia-ui/lib/components/Header/switcherItem';
|
|
10
|
+
import Shimmer from '@magento/venia-ui/lib/components/Header/storeSwitcher.shimmer';
|
|
11
|
+
import cn from 'classnames';
|
|
12
|
+
import { ArrowUp2 } from 'iconsax-react';
|
|
13
|
+
import { darkBlue } from '@riosst100/pwa-marketplace/src/theme/vars';
|
|
14
|
+
|
|
15
|
+
const StoreSwitcher = props => {
|
|
16
|
+
const {
|
|
17
|
+
availableStores,
|
|
18
|
+
currentGroupName,
|
|
19
|
+
currentStoreName,
|
|
20
|
+
handleSwitchStore,
|
|
21
|
+
storeGroups,
|
|
22
|
+
storeMenuRef,
|
|
23
|
+
storeMenuTriggerRef,
|
|
24
|
+
storeMenuIsOpen,
|
|
25
|
+
handleTriggerClick
|
|
26
|
+
} = useStoreSwitcher({ availableRoutes });
|
|
27
|
+
|
|
28
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
29
|
+
const menuClassName = storeMenuIsOpen ? classes.menu_open : classes.menu;
|
|
30
|
+
|
|
31
|
+
if (!availableStores) return <Shimmer />;
|
|
32
|
+
|
|
33
|
+
const groups = [];
|
|
34
|
+
|
|
35
|
+
const hasOnlyOneStore = availableStores.size === 1;
|
|
36
|
+
|
|
37
|
+
storeGroups.forEach((group, key) => {
|
|
38
|
+
const stores = [];
|
|
39
|
+
group.forEach(({ storeName, isCurrent, storeCode, websiteCode }) => {
|
|
40
|
+
let label = `${storeName}`;
|
|
41
|
+
|
|
42
|
+
stores.push(
|
|
43
|
+
<li
|
|
44
|
+
aria-selected={currentStoreName}
|
|
45
|
+
role="option"
|
|
46
|
+
key={storeCode}
|
|
47
|
+
className={classes.menuItem}
|
|
48
|
+
data-cy="StoreSwitcher-view"
|
|
49
|
+
>
|
|
50
|
+
<SwitcherItem
|
|
51
|
+
active={isCurrent}
|
|
52
|
+
onClick={handleSwitchStore}
|
|
53
|
+
option={storeCode}
|
|
54
|
+
option2={websiteCode}
|
|
55
|
+
>
|
|
56
|
+
{label}
|
|
57
|
+
</SwitcherItem>
|
|
58
|
+
</li>
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
groups.push(
|
|
63
|
+
<ul
|
|
64
|
+
role="listbox"
|
|
65
|
+
className={cn(classes.groupList, 'text-base')}
|
|
66
|
+
key={key}
|
|
67
|
+
data-cy="StoreSwitcher-group"
|
|
68
|
+
>
|
|
69
|
+
{stores}
|
|
70
|
+
</ul>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div className={cn(classes.root, 'leading-[16px]')} data-cy="StoreSwitcher-root">
|
|
76
|
+
<button
|
|
77
|
+
data-cy="StoreSwitcher-triggerButton"
|
|
78
|
+
className={cn(classes.trigger, 'text-base')}
|
|
79
|
+
aria-label={currentStoreName || ''}
|
|
80
|
+
onClick={handleTriggerClick}
|
|
81
|
+
ref={storeMenuTriggerRef}
|
|
82
|
+
aria-expanded={storeMenuIsOpen}
|
|
83
|
+
>
|
|
84
|
+
<span className='flex flex-row gap-[5px] items-center leading-[16px]'>
|
|
85
|
+
{currentStoreName || ''}
|
|
86
|
+
{!hasOnlyOneStore ? (
|
|
87
|
+
<ArrowUp2 size="12" color={darkBlue} className={cn(storeMenuIsOpen ? 'rotate-0 ' : 'rotate-180', 'transition-all stroke-current')} variant="Outline" />
|
|
88
|
+
) : null}
|
|
89
|
+
</span>
|
|
90
|
+
</button>
|
|
91
|
+
<div
|
|
92
|
+
ref={storeMenuRef}
|
|
93
|
+
className={menuClassName}
|
|
94
|
+
data-cy="StoreSwitcher-menu"
|
|
95
|
+
>
|
|
96
|
+
<div className={classes.groups}>
|
|
97
|
+
<span className='flex font-medium px-4 py-1 w-full text-base'>
|
|
98
|
+
Language
|
|
99
|
+
</span>
|
|
100
|
+
{groups}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export default StoreSwitcher;
|
|
108
|
+
|
|
109
|
+
StoreSwitcher.propTypes = {
|
|
110
|
+
classes: shape({
|
|
111
|
+
groupList: string,
|
|
112
|
+
groups: string,
|
|
113
|
+
menu: string,
|
|
114
|
+
menu_open: string,
|
|
115
|
+
menuItem: string,
|
|
116
|
+
root: string,
|
|
117
|
+
trigger: string
|
|
118
|
+
})
|
|
119
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
composes: grid from global;
|
|
3
|
+
composes: items-center from global;
|
|
4
|
+
composes: justify-items-start from global;
|
|
5
|
+
composes: mx-auto from global;
|
|
6
|
+
composes: my-0 from global;
|
|
7
|
+
composes: relative from global;
|
|
8
|
+
composes: sm_justify-items-end from global;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.trigger {
|
|
12
|
+
composes: max-w-[15rem] from global;
|
|
13
|
+
composes: overflow-ellipsis from global;
|
|
14
|
+
composes: overflow-hidden from global;
|
|
15
|
+
composes: whitespace-nowrap from global;
|
|
16
|
+
|
|
17
|
+
composes: sm_max-w-full from global;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.menu {
|
|
21
|
+
composes: absolute from global;
|
|
22
|
+
composes: bg-white from global;
|
|
23
|
+
composes: border from global;
|
|
24
|
+
composes: border-solid from global;
|
|
25
|
+
composes: border-subtle from global;
|
|
26
|
+
composes: bottom-md from global;
|
|
27
|
+
composes: left-xs from global;
|
|
28
|
+
composes: max-w-[90vw] from global;
|
|
29
|
+
composes: opacity-0 from global;
|
|
30
|
+
composes: pb-2xs from global;
|
|
31
|
+
composes: pt-2xs from global;
|
|
32
|
+
composes: right-auto from global;
|
|
33
|
+
composes: rounded from global;
|
|
34
|
+
composes: shadow-menu from global;
|
|
35
|
+
composes: top-auto from global;
|
|
36
|
+
composes: w-max from global;
|
|
37
|
+
composes: z-menu from global;
|
|
38
|
+
transform: translate3d(0, -8px, 0);
|
|
39
|
+
transition-duration: 192ms;
|
|
40
|
+
transition-timing-function: var(--venia-global-anim-out);
|
|
41
|
+
transition-property: opacity, transform, visibility;
|
|
42
|
+
|
|
43
|
+
/* TODO @TW: review (B6) */
|
|
44
|
+
/* composes: invisible from global; */
|
|
45
|
+
visibility: hidden;
|
|
46
|
+
|
|
47
|
+
composes: sm_bottom-auto from global;
|
|
48
|
+
composes: sm_left-auto from global;
|
|
49
|
+
composes: sm_right-xs from global;
|
|
50
|
+
composes: sm_top-md from global;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.menu_open {
|
|
54
|
+
composes: menu;
|
|
55
|
+
|
|
56
|
+
composes: opacity-100 from global;
|
|
57
|
+
transform: translate3d(0, 4px, 0);
|
|
58
|
+
transition-duration: 224ms;
|
|
59
|
+
transition-timing-function: var(--venia-global-anim-in);
|
|
60
|
+
|
|
61
|
+
/* TODO @TW: review (B6) */
|
|
62
|
+
/* composes: visible from global; */
|
|
63
|
+
visibility: visible;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.menuItem {
|
|
67
|
+
composes: hover_bg-subtle from global;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.groups {
|
|
71
|
+
composes: max-h-[24rem] from global;
|
|
72
|
+
composes: overflow-auto from global;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.groupList {
|
|
76
|
+
composes: border-b from global;
|
|
77
|
+
composes: border-solid from global;
|
|
78
|
+
composes: border-subtle from global;
|
|
79
|
+
composes: pb-2xs from global;
|
|
80
|
+
composes: pt-2xs from global;
|
|
81
|
+
|
|
82
|
+
composes: last_border-none from global;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* Mobile-specific styles.
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
@media (max-width: 639px) {
|
|
90
|
+
.root:only-child {
|
|
91
|
+
grid-column: 2;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* TODO @TW: cannot compose */
|
|
95
|
+
.root:last-child .menu {
|
|
96
|
+
right: 1rem;
|
|
97
|
+
left: auto;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.menu {
|
|
101
|
+
transform: translate3d(0, 8px, 0);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.menu_open {
|
|
105
|
+
transform: translate3d(0, -4px, 0);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { Check } from 'react-feather';
|
|
3
|
+
import { bool, func, shape, string } from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { useStyle } from '@magento/venia-ui/lib/classify';
|
|
6
|
+
import Icon from '@magento/venia-ui/lib/components/Icon/icon';
|
|
7
|
+
import defaultClasses from '@magento/venia-ui/lib/components/Header/switcherItem.module.css';
|
|
8
|
+
|
|
9
|
+
const SwitcherItem = props => {
|
|
10
|
+
const { active, onClick, option, option2, children } = props;
|
|
11
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
12
|
+
|
|
13
|
+
const handleClick = useCallback(() => {
|
|
14
|
+
onClick(option, option2);
|
|
15
|
+
}, [option, option2, onClick]);
|
|
16
|
+
|
|
17
|
+
const activeIcon = active ? (
|
|
18
|
+
<Icon data-cy="SwitcherItem-activeIcon" size={20} src={Check} />
|
|
19
|
+
) : null;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<button
|
|
23
|
+
data-cy="SwitcherItem-button"
|
|
24
|
+
className={classes.root}
|
|
25
|
+
disabled={active}
|
|
26
|
+
onClick={handleClick}
|
|
27
|
+
>
|
|
28
|
+
<span className={classes.content}>
|
|
29
|
+
<span className={classes.text}>{children}</span>
|
|
30
|
+
{activeIcon}
|
|
31
|
+
</span>
|
|
32
|
+
</button>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
SwitcherItem.propTypes = {
|
|
37
|
+
active: bool,
|
|
38
|
+
classes: shape({
|
|
39
|
+
content: string,
|
|
40
|
+
root: string,
|
|
41
|
+
text: string
|
|
42
|
+
}),
|
|
43
|
+
onClick: func,
|
|
44
|
+
option: string
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default SwitcherItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Link } from 'react-router-dom';
|
|
3
|
+
import Icon from '@magento/venia-ui/lib/components/Icon';
|
|
4
|
+
import resourceUrl from '@magento/peregrine/lib/util/makeUrl';
|
|
5
|
+
import { Heart as HeartIcon } from 'react-feather';
|
|
6
|
+
|
|
7
|
+
const wishlistTrigger = () => {
|
|
8
|
+
return (
|
|
9
|
+
<div className='wishlistTrigger'>
|
|
10
|
+
<Link
|
|
11
|
+
aria-label='wishlist-action'
|
|
12
|
+
to={resourceUrl('/wishlist')}
|
|
13
|
+
className={''}
|
|
14
|
+
data-cy="wishlistLink"
|
|
15
|
+
>
|
|
16
|
+
<Icon src={HeartIcon} attrs={{ width: 20 }} />
|
|
17
|
+
{/* <Heart size="20" color={darkBlue} className={cn('stroke-0')} variant="Outline" /> */}
|
|
18
|
+
</Link>
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default wishlistTrigger
|
|
@@ -49,21 +49,6 @@ const FilterListPage = props => {
|
|
|
49
49
|
// Sorting
|
|
50
50
|
const sortProps = useCustomSort({ sortFromSearch: false, defaultSort: defaultSort});
|
|
51
51
|
const [currentSort] = sortProps;
|
|
52
|
-
// const [sortBy, setSortBy] = useState({
|
|
53
|
-
// sortText: 'All (A-Z)',
|
|
54
|
-
// value: 'all'
|
|
55
|
-
// });
|
|
56
|
-
|
|
57
|
-
// let availableSortBy = [
|
|
58
|
-
// {
|
|
59
|
-
// 'label': 'All (A-Z)',
|
|
60
|
-
// 'value': 'all'
|
|
61
|
-
// },
|
|
62
|
-
// {
|
|
63
|
-
// 'label': 'By Year',
|
|
64
|
-
// 'value': 'newest'
|
|
65
|
-
// }
|
|
66
|
-
// ];
|
|
67
52
|
|
|
68
53
|
const classes = useStyle(defaultClasses);
|
|
69
54
|
|
|
@@ -101,14 +86,7 @@ const FilterListPage = props => {
|
|
|
101
86
|
return result;
|
|
102
87
|
}
|
|
103
88
|
|
|
104
|
-
let allSetsTitle = "Sets";
|
|
105
89
|
let attributeCode = attributeData ? attributeData.attribute_code : '';
|
|
106
|
-
let byYearTitle = "By Year";
|
|
107
|
-
// if (shopby == "singles") {
|
|
108
|
-
// attributeCode = "lego_set_name";
|
|
109
|
-
// // allSetsTitle = "Singles";
|
|
110
|
-
// byYearTitle = "By Year";
|
|
111
|
-
// }
|
|
112
90
|
|
|
113
91
|
let newfilterSearchArr = search ? search.split('&') : [];
|
|
114
92
|
newfilterSearchArr = newfilterSearchArr.filter(function(data) {
|
|
@@ -242,9 +220,6 @@ const FilterListPage = props => {
|
|
|
242
220
|
|
|
243
221
|
const label = filterArr[0];
|
|
244
222
|
const optionId = filterArr[1];
|
|
245
|
-
if (label == "Singles") {
|
|
246
|
-
isSingles = true;
|
|
247
|
-
}
|
|
248
223
|
if (key == "bricks_categories" || key == "sc_sports_categories" || key == "card_game" || key == "product_line" && urlKey == "brands" || key == "product_line" && urlKey == "franchise" || key == "franchise" && urlKey == "brands" || key == "franchise" && urlKey == "franchise" || key == "brands" && urlKey == "franchise" || key == "brands" && urlKey == "brands") {
|
|
249
224
|
activeFilters.push(
|
|
250
225
|
{
|
|
@@ -22,7 +22,7 @@ const SCROLL_OFFSET = 150;
|
|
|
22
22
|
* @param {Object} props.filters - filters to display
|
|
23
23
|
*/
|
|
24
24
|
const FilterTop = props => {
|
|
25
|
-
const { shopby, filters, filterCountToOpen,
|
|
25
|
+
const { shopby, filters, filterCountToOpen, category } = props;
|
|
26
26
|
const [filterBy, setFilterBy] = useState('');
|
|
27
27
|
|
|
28
28
|
const talonProps = useFilterTop({ shopby, filters, category, filterBy, setFilterBy });
|