@jetshop/template-trend 5.10.0 → 5.11.0
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/.linaria-cache/packages/template-trend/src/components/Auth/LogInPage.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/Address.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/CustomerType.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/LoginFields.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/SignUpPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Auth/UI/Form.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Cart/CartButton.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Cart/CartFlyout.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/Cart/CartItem.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/Cart/FreeShipping.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/CategoryHeader.linaria.css +8 -8
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/ActiveFilters.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Filter.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/FilterDrawer.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/FilterDropdownMenu.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/ActiveCarot.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/FilterButton.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/ListAccordion.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/shared/styles.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/RangeFilters.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductCard.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductGrid.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductGridWindow.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/StandardCategoryPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/CategoryPage/WindowedCategoryPage.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ContentPage/ContentPage.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/CookieConsent.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Forms/GlobalError.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Forms/Input.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/Forms/InputStatus.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/Forms/Success.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Container.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Content/index.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Footer/Footer.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/Layout/Footer/SocialLinks.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Categories/MobileCategories.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/CategoryMenu.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/CategoryMenuContainer.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/SubMenuSection.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/SubMenuWrapper.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/ChannelSelector.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/ChannelSelectorModal.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/Selector.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Header.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Logo.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/LogoSearchBar.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/MobileMenu.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/RecommendedChannel/ChannelBanner.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/RecommendedChannel/RecommendedChannelSelector.linaria.css +9 -9
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/SearchBar.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/SearchButton.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Header/TopNav.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/MaxWidth.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Layout/Notifications.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/LoadingPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/CustomerNameHeader.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/DeleteAccount.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPages.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPagesSidebar.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPagesStartPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/ListOrder.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/ListDetail.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/OrderTotals.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/ShippingPayment.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderListPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/ProfileDeliveryAddresses.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/MyPages/ProfilePage.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/NavigationTree/NavTree.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Newsletter/NewsletterField.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/NotFoundPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/Pagination/Pagination.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductList/AddToCart.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductList/Favourite.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductList/Favourites.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductList/Product.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/AddToCart/AddToCartForm.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/AddToCart/ProductToast.linaria.css +9 -9
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/Campaigns.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ConfigurationSelector.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/Images/ImageContainer.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/IncludedInPackages.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/PackageProduct.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/PackageProductItem.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductInfo.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductInfoAccordion.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductPage.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductPageLoadingState.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/RelatedProducts.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/NotifyWhenBack.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/StockOrb.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/StockStatusIndicator.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/WarehouseStock.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/VariantSelector.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ProductPage/styledComponents.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchMeta.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchPage.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchResults.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchTerm.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/SearchPage/WindowedSearchResults.linaria.css +4 -4
- package/.linaria-cache/packages/template-trend/src/components/StartPage/CategoryList.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/Row.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageCampaign.linaria.css +7 -7
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageCategories.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageHTMLContent.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageHero.linaria.css +6 -6
- package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageProductGrid.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/StartPage/StartPage.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/Store/Store.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreList.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreLocator.linaria.css +5 -5
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreMap.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreMarker.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreSearch.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/StoreLocator/UserLocation.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ui/Badge.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ui/Button.linaria.css +3 -3
- package/.linaria-cache/packages/template-trend/src/components/ui/CloseButton.linaria.css +1 -1
- package/.linaria-cache/packages/template-trend/src/components/ui/Headings.linaria.css +2 -2
- package/.linaria-cache/packages/template-trend/src/components/ui/Spinner.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Breadcrumbs/Breadcrumbs.linaria.css +2 -2
- package/.linaria-cache/packages/ui/Button/Button.linaria.css +2 -2
- package/.linaria-cache/packages/ui/Button/SecondaryButton.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Button/TrendButton.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ChannelSelector/ChannelSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ChannelSelector/ChannelSelectorButtons.linaria.css +2 -2
- package/.linaria-cache/packages/ui/ChannelSelector/LargeSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ChannelSelector/MiniSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Checkbox/Checkbox.linaria.css +4 -4
- package/.linaria-cache/packages/ui/Checkbox/CheckboxGroup.linaria.css +2 -2
- package/.linaria-cache/packages/ui/DropdownMenu/DropdownMenu.linaria.css +2 -2
- package/.linaria-cache/packages/ui/ErrorBoundary/Generic.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Gallery/Gallery.linaria.css +2 -2
- package/.linaria-cache/packages/ui/JetshopText.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Loading/LoadingBar.linaria.css +2 -2
- package/.linaria-cache/packages/ui/Modal/Drawer/Drawer.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Modal/ModalRoot.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Modal/TargetWrapper.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Pagination/Pagination.linaria.css +1 -1
- package/.linaria-cache/packages/ui/PreOrderDateSelector/PreOrderDateSelector.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Price/Price.linaria.css +1 -1
- package/.linaria-cache/packages/ui/ProductList/Badges.linaria.css +7 -7
- package/.linaria-cache/packages/ui/ProductSpecifications/ProductSpecifications.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Search/SearchField.linaria.css +5 -5
- package/.linaria-cache/packages/ui/Search/SearchPage/SearchMeta.linaria.css +1 -1
- package/.linaria-cache/packages/ui/Select/Components.linaria.css +8 -8
- package/README.md +118 -1944
- package/package.json +5 -5
- package/src/components/Auth/ForgotPassword.js +3 -8
- package/src/components/Auth/README.md +5 -0
- package/src/components/Cart/CartButton.js +40 -44
- package/src/components/Cart/CartFlyout.js +8 -5
- package/src/components/Cart/CartItem.js +12 -15
- package/src/components/Cart/{addMultipleToCart.gql → queries/addMultipleToCart.gql} +1 -1
- package/src/components/Cart/{addToCart.gql → queries/addToCart.gql} +1 -1
- package/src/components/Cart/{CartFragment.gql → queries/cartFragment.gql} +1 -0
- package/src/components/Cart/{CartQuery.gql → queries/cartQuery.gql} +1 -1
- package/src/components/Cart/{decrementQuantity.gql → queries/decrementQuantity.gql} +1 -1
- package/src/components/Cart/{incrementQuantity.gql → queries/incrementQuantity.gql} +1 -1
- package/src/components/Cart/{removeFromCart.gql → queries/removeFromCart.gql} +1 -1
- package/src/components/CategoryPage/CategoryPage.js +1 -0
- package/src/components/CategoryPage/ProductCard.js +2 -0
- package/src/components/CategoryPage/ProductGrid.js +5 -0
- package/src/components/CategoryPage/ProductGridWindow.js +19 -12
- package/src/components/CategoryPage/README.md +11 -0
- package/src/components/Layout/Header/ChannelSelector/ChannelSelector.js +3 -0
- package/src/components/Layout/Header/ChannelSelector/ChannelSelectorModal.js +4 -3
- package/src/components/Layout/Header/ChannelSelector/Selector.js +2 -0
- package/src/components/Layout/Header/RecommendedChannel/RecommendedChannelSelector.js +2 -0
- package/src/components/LogOut.loadable.js +10 -0
- package/src/components/PreviewRoute.loadable.js +10 -0
- package/src/components/ProductList/AddToCart.js +8 -5
- package/src/components/ProductList/Favourite.js +2 -2
- package/src/components/ProductList/FavouriteCount.js +2 -2
- package/src/components/ProductList/Favourites.js +17 -12
- package/src/components/ProductList/Lister.js +44 -0
- package/src/components/ProductList/Product.js +5 -4
- package/src/components/ProductList/ProductLists.gql +33 -5
- package/src/components/ProductList/SelectVariant.js +6 -10
- package/src/components/ProductList/productListQueries.js +3 -0
- package/src/components/ProductPage/AddToCart/AddToCartForm.js +19 -18
- package/src/components/ProductPage/AddToCart/ProductToast.js +7 -4
- package/src/components/ProductPage/PackageProduct/PackageProduct.js +8 -6
- package/src/components/ProductPage/VariantSelector.js +1 -1
- package/src/components/{StartPage → SearchPage}/CategoryList.js +6 -4
- package/src/components/SearchPage/EmptySearchResults.js +1 -1
- package/src/components/Shop.js +52 -76
- package/src/components/StartPage/Content/StartPageHero.js +9 -1
- package/src/components/StartPage/StartPage.js +0 -13
- package/src/components/StartPage/Campaign.js +0 -162
- package/src/components/StartPage/CampaignHeader.js +0 -101
- package/src/components/StartPage/ExtraDetails.js +0 -72
- package/src/components/StartPage/Readme.md +0 -88
- package/src/components/StartPage/campaign.json +0 -20
- package/src/components/StartPage/campaignHeader.json +0 -5
- package/src/components/StartPage/categoryList.json +0 -65
- package/src/components/StartPage/extraDetails.json +0 -6
- package/src/components/StartPage/title.json +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetshop/template-trend",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "react-scripts build",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@jetshop/core": "^5.
|
|
48
|
+
"@jetshop/core": "^5.11.0",
|
|
49
49
|
"@jetshop/flight-shortcodes": "^2.0.10",
|
|
50
|
-
"@jetshop/intl": "^5.
|
|
51
|
-
"@jetshop/react-scripts": "^5.
|
|
52
|
-
"@jetshop/ui": "^5.
|
|
50
|
+
"@jetshop/intl": "^5.11.0",
|
|
51
|
+
"@jetshop/react-scripts": "^5.11.0",
|
|
52
|
+
"@jetshop/ui": "^5.11.0",
|
|
53
53
|
"@react-google-maps/api": "~1.7.0",
|
|
54
54
|
"prop-types": "^15.6.2",
|
|
55
55
|
"react": "^16.9.0",
|
|
@@ -13,7 +13,7 @@ import { activeSegment, smallSection } from './UI/Form';
|
|
|
13
13
|
import MaxWidth from '../Layout/MaxWidth';
|
|
14
14
|
import { cx } from 'linaria';
|
|
15
15
|
|
|
16
|
-
export default function ForgotPasswordPage(
|
|
16
|
+
export default function ForgotPasswordPage() {
|
|
17
17
|
return (
|
|
18
18
|
<MaxWidth style={{ alignItems: 'center', marginTop: '2em' }}>
|
|
19
19
|
<ForgotPasswordProvider>
|
|
@@ -28,13 +28,8 @@ export default function ForgotPasswordPage(props) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function ForgotPasswordForm() {
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
isSubmitting,
|
|
34
|
-
globalError,
|
|
35
|
-
isValid,
|
|
36
|
-
emailInputProps
|
|
37
|
-
} = useForgotPasswordData();
|
|
31
|
+
const { submitted, isSubmitting, globalError, isValid, emailInputProps } =
|
|
32
|
+
useForgotPasswordData();
|
|
38
33
|
|
|
39
34
|
if (submitted) {
|
|
40
35
|
return (
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Auth
|
|
2
|
+
|
|
3
|
+
These components deal with registering and signing in, using Jetshop to keep track of memberships. This is usually used for customer loyalty programs, or for e.g. b2b sales where you need an account to browse the site.
|
|
4
|
+
|
|
5
|
+
If you don't use this feature, feel free to comment out the imports and routes in Shop.js to reduce the bundle size.
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { css } from 'linaria';
|
|
3
|
+
import { styled } from 'linaria/react';
|
|
4
|
+
|
|
1
5
|
import CartProvider from '@jetshop/core/components/Query/CartProvider';
|
|
2
6
|
import t from '@jetshop/intl';
|
|
3
7
|
import { Above } from '@jetshop/ui/Breakpoints';
|
|
4
8
|
import { DrawerTrigger } from '@jetshop/ui/Modal/Drawer/DrawerTrigger';
|
|
5
9
|
import { FlyoutTrigger } from '@jetshop/ui/Modal/Flyout';
|
|
6
|
-
import {
|
|
7
|
-
import { css } from 'linaria';
|
|
8
|
-
import React, { Fragment } from 'react';
|
|
9
|
-
import { ReactComponent as Cart } from '../../svg/Cart.svg';
|
|
10
|
+
import { ReactComponent as CartIcon } from '../../svg/Cart.svg';
|
|
10
11
|
import Badge from '../ui/Badge';
|
|
11
|
-
import cartQuery from './
|
|
12
|
+
import cartQuery from './queries/cartQuery.gql';
|
|
12
13
|
|
|
13
14
|
const Button = styled('button')`
|
|
14
15
|
padding: 0;
|
|
@@ -38,7 +39,7 @@ function CartButton({ target, itemsInCart, className }) {
|
|
|
38
39
|
data-testid="cart-button"
|
|
39
40
|
onClick={target.isOpen ? target.hideTarget : target.showTarget}
|
|
40
41
|
>
|
|
41
|
-
<
|
|
42
|
+
<CartIcon className="badge-svg-wrapper" />
|
|
42
43
|
<span>{t('Cart')}</span>
|
|
43
44
|
</Button>
|
|
44
45
|
{itemsInCart > 0 && <Badge text={itemsInCart} />}
|
|
@@ -48,45 +49,40 @@ function CartButton({ target, itemsInCart, className }) {
|
|
|
48
49
|
|
|
49
50
|
function CartButtonFlyout({ className }) {
|
|
50
51
|
return (
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// Set items in cart to the API result.
|
|
55
|
-
// If the result is undefined, fall back to 0
|
|
56
|
-
const itemsInCart = result?.data?.cart?.totalQuantity || 0;
|
|
52
|
+
<CartProvider query={cartQuery}>
|
|
53
|
+
{result => {
|
|
54
|
+
const itemsInCart = result?.data?.cart?.totalQuantity || 0;
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
</CartProvider>
|
|
89
|
-
</Fragment>
|
|
56
|
+
// Drawer on mobile, flyout on desktop
|
|
57
|
+
return (
|
|
58
|
+
<Above breakpoint="md">
|
|
59
|
+
{matches =>
|
|
60
|
+
matches ? (
|
|
61
|
+
<FlyoutTrigger id="cart-flyout">
|
|
62
|
+
{flyout => (
|
|
63
|
+
<CartButton
|
|
64
|
+
className={className}
|
|
65
|
+
target={flyout}
|
|
66
|
+
itemsInCart={itemsInCart}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
</FlyoutTrigger>
|
|
70
|
+
) : (
|
|
71
|
+
<DrawerTrigger preventOverflow={true} id="cart-drawer">
|
|
72
|
+
{drawer => (
|
|
73
|
+
<CartButton
|
|
74
|
+
className={className}
|
|
75
|
+
target={drawer}
|
|
76
|
+
itemsInCart={itemsInCart}
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
</DrawerTrigger>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
</Above>
|
|
83
|
+
);
|
|
84
|
+
}}
|
|
85
|
+
</CartProvider>
|
|
90
86
|
);
|
|
91
87
|
}
|
|
92
88
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { styled } from 'linaria/react';
|
|
3
|
+
|
|
1
4
|
import { useTracker } from '@jetshop/core/analytics/Analytics';
|
|
2
5
|
import { trackCartCheckoutEvent } from '@jetshop/core/analytics/tracking';
|
|
3
6
|
import CartProvider from '@jetshop/core/components/Query/CartProvider';
|
|
@@ -6,15 +9,15 @@ import { Above } from '@jetshop/ui/Breakpoints';
|
|
|
6
9
|
import Drawer, { DrawerTarget } from '@jetshop/ui/Modal/Drawer';
|
|
7
10
|
import { FlyoutTarget } from '@jetshop/ui/Modal/Flyout';
|
|
8
11
|
import { Price } from '@jetshop/ui/Price';
|
|
12
|
+
import { useChannelSettings } from '@jetshop/core/hooks/Channels/useChannelSettings';
|
|
13
|
+
import { Currency } from '@jetshop/ui/Price/Currency';
|
|
14
|
+
|
|
9
15
|
import { theme } from '../Theme';
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { styled } from 'linaria/react';
|
|
12
16
|
import { baseStyles } from '../ui/Button';
|
|
13
17
|
import CartItem from './CartItem';
|
|
14
|
-
import cartQuery from './CartQuery.gql';
|
|
15
18
|
import FreeShipping from './FreeShipping';
|
|
16
|
-
|
|
17
|
-
import
|
|
19
|
+
|
|
20
|
+
import cartQuery from './queries/cartQuery.gql';
|
|
18
21
|
|
|
19
22
|
const Flyout = styled('div')`
|
|
20
23
|
background: white;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { styled } from 'linaria/react';
|
|
3
|
+
import { Link } from 'react-router-dom';
|
|
4
|
+
|
|
1
5
|
import useDecrementQuantity from '@jetshop/core/components/Mutation/useDecrementQuantity';
|
|
2
6
|
import useIncrementQuantity from '@jetshop/core/components/Mutation/useIncrementQuantity';
|
|
3
7
|
import useRemoveFromCart from '@jetshop/core/components/Mutation/useRemoveFromCart';
|
|
4
8
|
import getCartItemVariant from '@jetshop/core/helpers/getCartItemVariant';
|
|
5
9
|
import Image from '@jetshop/ui/Image';
|
|
6
10
|
import { Price } from '@jetshop/ui/Price';
|
|
7
|
-
import { ReactComponent as
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { styled } from 'linaria/react';
|
|
10
|
-
import { Link } from 'react-router-dom';
|
|
11
|
+
import { ReactComponent as CrossIcon } from '@jetshop/ui/svg/Cross.svg';
|
|
11
12
|
import { FlyoutTrigger } from '@jetshop/ui/Modal/Flyout';
|
|
12
|
-
import removeFromCartMutation from './removeFromCart.gql';
|
|
13
|
-
import incrementQuantityMutation from './incrementQuantity.gql';
|
|
14
|
-
import decrementQuantityMutation from './decrementQuantity.gql';
|
|
15
|
-
import cartQuery from './
|
|
13
|
+
import removeFromCartMutation from './queries/removeFromCart.gql';
|
|
14
|
+
import incrementQuantityMutation from './queries/incrementQuantity.gql';
|
|
15
|
+
import decrementQuantityMutation from './queries/decrementQuantity.gql';
|
|
16
|
+
import cartQuery from './queries/cartQuery.gql';
|
|
16
17
|
|
|
17
18
|
const Wrapper = styled('div')`
|
|
18
19
|
display: flex;
|
|
@@ -103,12 +104,8 @@ const RemoveItem = styled('div')`
|
|
|
103
104
|
`;
|
|
104
105
|
|
|
105
106
|
const CartItem = ({ item, className = '' }) => {
|
|
106
|
-
const {
|
|
107
|
-
|
|
108
|
-
variantImage,
|
|
109
|
-
variantValues,
|
|
110
|
-
hasVariantImage
|
|
111
|
-
} = getCartItemVariant(item);
|
|
107
|
+
const { isVariant, variantImage, variantValues, hasVariantImage } =
|
|
108
|
+
getCartItemVariant(item);
|
|
112
109
|
|
|
113
110
|
const { incrementQuantity } = useIncrementQuantity({
|
|
114
111
|
incrementQuantityMutation,
|
|
@@ -196,7 +193,7 @@ const CartItem = ({ item, className = '' }) => {
|
|
|
196
193
|
}
|
|
197
194
|
data-testid="remove-from-cart"
|
|
198
195
|
>
|
|
199
|
-
<
|
|
196
|
+
<CrossIcon />
|
|
200
197
|
</button>
|
|
201
198
|
</RemoveItem>
|
|
202
199
|
|
|
@@ -25,6 +25,7 @@ const CategoryPage = props => {
|
|
|
25
25
|
const searchObject = qs.parse(search, { ignoreQueryPrefix: true });
|
|
26
26
|
const standardPagination = searchObject.standardPagination === 'true';
|
|
27
27
|
|
|
28
|
+
// Comment out the one you're not using
|
|
28
29
|
if (standardPagination) {
|
|
29
30
|
return <LoadableStandardCategoryPage {...props} />;
|
|
30
31
|
} else {
|
|
@@ -69,6 +69,7 @@ export function ProductCard({
|
|
|
69
69
|
forwardRef,
|
|
70
70
|
as = 'li',
|
|
71
71
|
children,
|
|
72
|
+
loadImageEagerly = false,
|
|
72
73
|
...linkProps
|
|
73
74
|
}) {
|
|
74
75
|
const hasImages = product.images && product.images.length > 0;
|
|
@@ -103,6 +104,7 @@ export function ProductCard({
|
|
|
103
104
|
src={product.images[0].url}
|
|
104
105
|
modifiedDate={product.images[0].modifiedDate}
|
|
105
106
|
badges={<Badges badges={badges} />}
|
|
107
|
+
critical={loadImageEagerly}
|
|
106
108
|
></Image>
|
|
107
109
|
) : (
|
|
108
110
|
<Image src={transparentDataImg} />
|
|
@@ -51,6 +51,10 @@ export const Wrapper = styled('ul')`
|
|
|
51
51
|
}
|
|
52
52
|
`;
|
|
53
53
|
|
|
54
|
+
export function isAboveFold(index) {
|
|
55
|
+
return index < 4;
|
|
56
|
+
}
|
|
57
|
+
|
|
54
58
|
export function ProductGrid({
|
|
55
59
|
products,
|
|
56
60
|
listName,
|
|
@@ -81,6 +85,7 @@ export function ProductGrid({
|
|
|
81
85
|
product={product}
|
|
82
86
|
style={{ opacity: loading ? 0.5 : 1 }}
|
|
83
87
|
list={listName}
|
|
88
|
+
loadImageEagerly={isAboveFold(index)}
|
|
84
89
|
{...rest}
|
|
85
90
|
>
|
|
86
91
|
<Favourite
|
|
@@ -3,7 +3,7 @@ import { trackListEvent } from '@jetshop/core/analytics/tracking';
|
|
|
3
3
|
import React, { useEffect, useMemo } from 'react';
|
|
4
4
|
import { css, cx } from 'linaria';
|
|
5
5
|
import { ProductCard } from './ProductCard';
|
|
6
|
-
import { priceStyle } from './ProductGrid';
|
|
6
|
+
import { isAboveFold, priceStyle } from './ProductGrid';
|
|
7
7
|
import { WindowGrid } from '@jetshop/ui/WindowGrid';
|
|
8
8
|
|
|
9
9
|
const container = css`
|
|
@@ -40,24 +40,31 @@ function ProductGridWindow({
|
|
|
40
40
|
}, [listName, products, track]);
|
|
41
41
|
|
|
42
42
|
const renderProduct = useMemo(
|
|
43
|
-
() =>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
() =>
|
|
44
|
+
({ item: product, style, innerRef }) =>
|
|
45
|
+
(
|
|
46
|
+
<div className={defaultStyle} style={style} ref={innerRef}>
|
|
47
|
+
<ProductCard
|
|
48
|
+
key={product.articleNumber}
|
|
49
|
+
product={product}
|
|
50
|
+
as="div"
|
|
51
|
+
categoryPath={categoryPath}
|
|
52
|
+
loadImageEagerly={isAboveFold(product.index)}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
),
|
|
53
56
|
[categoryPath]
|
|
54
57
|
);
|
|
55
58
|
|
|
59
|
+
const items = useMemo(() => {
|
|
60
|
+
return products.map((product, index) => ({ ...product, index }));
|
|
61
|
+
}, [products]);
|
|
62
|
+
|
|
56
63
|
return (
|
|
57
64
|
<WindowGrid
|
|
58
65
|
id={id}
|
|
59
66
|
itemsPerRow={[2, null, 3, 4]}
|
|
60
|
-
items={
|
|
67
|
+
items={items}
|
|
61
68
|
prevOffset={prevOffset}
|
|
62
69
|
className={cx(container, priceStyle)}
|
|
63
70
|
component={renderProduct}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Category page
|
|
2
|
+
This folder contains two versions of category pages, of which you would usually select one.
|
|
3
|
+
|
|
4
|
+
## Classic paginated category page
|
|
5
|
+
A category page that uses classic pagination, meaning next/previous buttons to step through pages, showing only one page of products at a time.
|
|
6
|
+
|
|
7
|
+
## Infinite pagination category page
|
|
8
|
+
A more scroll-friendly version of a category page, where new products are appended to the list when you press the "Load more products" button. In order not to lose performance when rendering a large amount of products, it uses a technique called windowing to only render the products that are in view at the moment. This can cause issues if you have product cards of varying height, so make sure that all images and details showed on the product card result in the same overall height for the product card.
|
|
9
|
+
|
|
10
|
+
## Read more
|
|
11
|
+
You can find more information about pagination in the [Flight documentation](https://docs.dev.jetshop.se/pagination).
|
|
@@ -13,6 +13,7 @@ const Flyout = styled('div')`
|
|
|
13
13
|
|
|
14
14
|
const CountryFlag = styled('img')`
|
|
15
15
|
height: 12px;
|
|
16
|
+
width: 12px;
|
|
16
17
|
margin-right: 5px;
|
|
17
18
|
`;
|
|
18
19
|
|
|
@@ -32,6 +33,8 @@ export default class HeaderChannelSelector extends Component {
|
|
|
32
33
|
<CountryFlag
|
|
33
34
|
src={`https://countryflags.jetshop.io/${selectedChannel.country.code}/flat/32.png`}
|
|
34
35
|
alt="Country Flag"
|
|
36
|
+
width="16"
|
|
37
|
+
height="12"
|
|
35
38
|
/>
|
|
36
39
|
{selectedChannel.country.name}
|
|
37
40
|
</button>
|
|
@@ -26,9 +26,8 @@ const modalStyles = css`
|
|
|
26
26
|
`;
|
|
27
27
|
|
|
28
28
|
const ChannelSelectorModal = props => {
|
|
29
|
-
const { selectedChannel, channels, updateChannel } =
|
|
30
|
-
ChannelContext
|
|
31
|
-
);
|
|
29
|
+
const { selectedChannel, channels, updateChannel } =
|
|
30
|
+
useContext(ChannelContext);
|
|
32
31
|
|
|
33
32
|
return (
|
|
34
33
|
<ModalTrigger
|
|
@@ -49,6 +48,8 @@ const ChannelSelectorModal = props => {
|
|
|
49
48
|
src={`https://countryflags.jetshop.io/${selectedChannel.country.code}/flat/32.png`}
|
|
50
49
|
alt="Country Flag"
|
|
51
50
|
style={{ height: '12px', marginRight: '6px' }}
|
|
51
|
+
width="16"
|
|
52
|
+
height="12"
|
|
52
53
|
/>
|
|
53
54
|
<span>{selectedChannel.country.name}</span>
|
|
54
55
|
</Button>
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { css } from 'linaria';
|
|
1
3
|
import { useMutation } from '@apollo/react-hooks';
|
|
4
|
+
|
|
5
|
+
import t from '@jetshop/intl';
|
|
2
6
|
import { CartIdContext } from '@jetshop/core/components/Cart/CartIdContext';
|
|
3
7
|
import { addToCartSuccess } from '@jetshop/core/components/Mutation/AddToCart/addToCartUtils';
|
|
4
|
-
import t from '@jetshop/intl';
|
|
5
|
-
import React, { useContext } from 'react';
|
|
6
|
-
import { css } from 'linaria';
|
|
7
|
-
import { addToCart } from '../Cart/addToCart.gql';
|
|
8
|
-
import ProductToastWrapper from '../ProductPage/AddToCart/ProductToast';
|
|
9
8
|
import { useNotification } from '@jetshop/core/components/Notifications';
|
|
10
9
|
|
|
10
|
+
import ProductToastWrapper from '../ProductPage/AddToCart/ProductToast';
|
|
11
|
+
|
|
12
|
+
import { addToCart } from '../Cart/queries/addToCart.gql';
|
|
13
|
+
|
|
11
14
|
const addButton = css`
|
|
12
15
|
background: white;
|
|
13
16
|
border: 0.75px solid #bfbdbd;
|
|
@@ -14,13 +14,13 @@ const favourite = css`
|
|
|
14
14
|
}
|
|
15
15
|
`;
|
|
16
16
|
|
|
17
|
-
export function Favourite({ product, variant, ...rest }) {
|
|
17
|
+
export function Favourite({ product, variant, listId, ...rest }) {
|
|
18
18
|
const articleNumber = product.articleNumber;
|
|
19
19
|
|
|
20
20
|
const selectedVariation = product.variant || variant;
|
|
21
21
|
const variantArticleNumber = selectedVariation?.articleNumber;
|
|
22
22
|
|
|
23
|
-
const { toggle, inList } = useProductList();
|
|
23
|
+
const { toggle, inList } = useProductList(listId);
|
|
24
24
|
|
|
25
25
|
function toggleWithoutBubble(e) {
|
|
26
26
|
e.preventDefault();
|
|
@@ -5,8 +5,8 @@ import { Link } from 'react-router-dom';
|
|
|
5
5
|
import { ReactComponent as HeartSVG } from '../../svg/Heart.svg';
|
|
6
6
|
import Badge from '../ui/Badge';
|
|
7
7
|
|
|
8
|
-
export function FavouriteCount({ className }) {
|
|
9
|
-
const { count } = useProductList();
|
|
8
|
+
export function FavouriteCount({ className, listId }) {
|
|
9
|
+
const { count } = useProductList(listId);
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
12
|
<Link to="/favourites" className={className}>
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { css, cx } from 'linaria';
|
|
3
|
+
|
|
1
4
|
import {
|
|
2
5
|
useProductList,
|
|
3
6
|
useProductListItems
|
|
4
7
|
} from '@jetshop/core/hooks/ProductList';
|
|
5
8
|
import { useAddMultipleToCart } from '@jetshop/core/hooks/useAddMultipleToCart';
|
|
6
9
|
import t from '@jetshop/intl';
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import { ReactComponent as
|
|
10
|
-
import addMultipleToCartMutation from '../Cart/addMultipleToCart.gql';
|
|
11
|
-
import cartQuery from '../Cart/CartQuery.gql';
|
|
10
|
+
import { useNotification } from '@jetshop/core/components/Notifications';
|
|
11
|
+
|
|
12
|
+
import { ReactComponent as CartIcon } from '../../svg/Cart.svg';
|
|
12
13
|
import MaxWidth from '../Layout/MaxWidth';
|
|
13
14
|
import { theme } from '../Theme';
|
|
14
15
|
import Button from '../ui/Button';
|
|
15
16
|
import { Product } from './Product';
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
import addMultipleToCartMutation from '../Cart/queries/addMultipleToCart.gql';
|
|
19
|
+
import cartQuery from '../Cart/queries/cartQuery.gql';
|
|
17
20
|
|
|
18
21
|
export function Favourites() {
|
|
19
|
-
const
|
|
22
|
+
const listId = null;
|
|
23
|
+
|
|
24
|
+
const { products, loading } = useProductListItems(listId);
|
|
20
25
|
const [trigger] = useNotification();
|
|
21
26
|
|
|
22
27
|
const validItems = getItemsForAddToCart(products);
|
|
@@ -32,7 +37,7 @@ export function Favourites() {
|
|
|
32
37
|
onCompleted: () => {
|
|
33
38
|
trigger(
|
|
34
39
|
<AddAllSuccessToast>
|
|
35
|
-
<
|
|
40
|
+
<CartIcon />
|
|
36
41
|
{t(
|
|
37
42
|
'{productCount, plural, =1 {# product added to the cart.} other {# products added to the cart.}}',
|
|
38
43
|
{ productCount: validItemCount }
|
|
@@ -73,7 +78,7 @@ export function Favourites() {
|
|
|
73
78
|
key={product.variant?.articleNumber || product.articleNumber}
|
|
74
79
|
data-valid={product.validation.status}
|
|
75
80
|
>
|
|
76
|
-
<Product product={product} />
|
|
81
|
+
<Product listId={listId} product={product} />
|
|
77
82
|
</li>
|
|
78
83
|
);
|
|
79
84
|
})}
|
|
@@ -96,7 +101,7 @@ export function Favourites() {
|
|
|
96
101
|
)
|
|
97
102
|
: t('No valid items to add to cart')}
|
|
98
103
|
</Button>
|
|
99
|
-
<ClearList>{t('Clear list')}</ClearList>
|
|
104
|
+
<ClearList listId={listId}>{t('Clear list')}</ClearList>
|
|
100
105
|
</div>
|
|
101
106
|
</MaxWidth>
|
|
102
107
|
);
|
|
@@ -106,8 +111,8 @@ function AddAllSuccessToast({ children }) {
|
|
|
106
111
|
return <div className={addAllToastStyles}>{children}</div>;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
|
-
function ClearList({ children }) {
|
|
110
|
-
const { clear } = useProductList();
|
|
114
|
+
function ClearList({ children, listId }) {
|
|
115
|
+
const { clear } = useProductList(listId);
|
|
111
116
|
return (
|
|
112
117
|
<Button secondary onClick={clear}>
|
|
113
118
|
{children}
|