@jetshop/template-trend 5.9.0 → 5.11.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/.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/CategoryList.linaria.css +7 -0
- 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 +1 -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 +4 -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/.vscode/launch.json +11 -0
- package/README.md +118 -1944
- package/cypress/integration/essentials.spec.js +50 -0
- package/package.json +5 -5
- package/schema.graphql +1 -0
- 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} +2 -5
- 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/CategoryHeader.js +3 -3
- package/src/components/CategoryPage/CategoryPage.js +1 -0
- package/src/components/CategoryPage/Filters/ListFilters.js +1 -2
- package/src/components/CategoryPage/ProductCard.js +3 -1
- package/src/components/CategoryPage/ProductGrid.js +8 -2
- package/src/components/CategoryPage/ProductGridWindow.js +22 -14
- package/src/components/CategoryPage/README.md +11 -0
- package/src/components/CategoryPage/StandardCategoryPage.js +2 -0
- package/src/components/CategoryPage/WindowedCategoryPage.js +13 -5
- package/src/components/Forms/Input.js +3 -6
- package/src/components/Layout/Header/AutocompleteQuery.gql +1 -6
- 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 +3 -1
- package/src/components/Layout/Header/TopNav.js +13 -11
- package/src/components/LogOut.loadable.js +10 -0
- package/src/components/MyPages/MyPagesSidebar.js +0 -1
- 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 +8 -5
- package/src/components/ProductList/SelectVariant.js +6 -10
- package/src/components/ProductList/productListQueries.js +5 -0
- package/src/components/ProductPage/AddToCart/AddToCartForm.js +19 -18
- package/src/components/ProductPage/AddToCart/ProductToast.js +7 -4
- package/src/components/ProductPage/Images/ImageContainer.js +12 -1
- package/src/components/ProductPage/PackageProduct/PackageProduct.js +8 -6
- package/src/components/ProductPage/ProductInfo.js +1 -1
- package/src/components/ProductPage/ProductPage.js +3 -5
- package/src/components/ProductPage/ProductPageFragment.gql +1 -0
- package/src/components/ProductPage/StockStatus/WarehouseStock.js +15 -17
- package/src/components/ProductPage/VariantSelector.js +1 -1
- package/src/components/RouteQuery.gql +2 -2
- 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/Row.js +0 -37
- package/src/components/StartPage/Content/StartPageHero.js +9 -1
- package/src/components/StartPage/StartPage.js +0 -13
- package/src/components/StartPage/StartPageProductGridFragment.gql +1 -0
- package/src/components/ui/Button.js +19 -1
- package/.linaria-cache/packages/ui/ChannelSelector/Region.linaria.css +0 -3
- package/cypress/constants.js +0 -5
- package/cypress/integration/addToCart/addToCart.spec.js +0 -27
- package/cypress/integration/addToCart/disabledVariations.spec.js +0 -17
- package/cypress/integration/addToCart/newslettersubscriber.spec.js +0 -24
- package/cypress/integration/addToCart/notifyWhenBackInStock.spec.js +0 -20
- package/cypress/integration/addToCart/productConfigurations.spec.js +0 -35
- package/cypress/integration/addToCart/productVariations.spec.js +0 -42
- package/cypress/integration/addToCart/sizePriceChange.spec.js +0 -20
- package/cypress/integration/analytics/gtag.spec.js +0 -87
- package/cypress/integration/analytics/releware.spec.js +0 -95
- package/cypress/integration/auth/login.spec.js +0 -18
- package/cypress/integration/auth/signup.spec.js +0 -98
- package/cypress/integration/category_page_spec.js +0 -73
- package/cypress/integration/filters.spec.js +0 -103
- package/cypress/integration/getbyarticlenumber.spec.js +0 -28
- package/cypress/integration/packages.spec.js +0 -85
- package/cypress/integration/prefetch_headers_spec.js +0 -26
- package/cypress/integration/product_browsing_spec.js +0 -17
- package/cypress/integration/search/autocomplete.spec.js +0 -28
- package/cypress/integration/search/search_page.spec.js +0 -39
- package/cypress/integration/ssr/categorySSR.js +0 -9
- package/cypress/integration/ssr/productSSR.js +0 -9
- package/cypress/integration/ssr/startPageSSR.js +0 -5
- package/cypress/integration/start_page_spec.js +0 -5
- package/cypress/integration/stores_page.spec.js +0 -5
- 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
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { styled } from 'linaria/react';
|
|
3
|
-
import {
|
|
3
|
+
import { cx } from 'linaria';
|
|
4
4
|
import t from '@jetshop/intl';
|
|
5
5
|
import ChannelSelector, {
|
|
6
6
|
LangCurrWrapper,
|
|
@@ -153,6 +153,8 @@ const Selector = ({
|
|
|
153
153
|
<CountryFlag
|
|
154
154
|
src={`https://countryflags.jetshop.io/${code}/flat/32.png`}
|
|
155
155
|
alt="Country Flag"
|
|
156
|
+
width="16"
|
|
157
|
+
height="12"
|
|
156
158
|
/>
|
|
157
159
|
{name} ({channel.name})
|
|
158
160
|
</Country>
|
|
@@ -47,14 +47,16 @@ const List = styled('ul')`
|
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
49
|
|
|
50
|
-
export default ({ children, searchOpen, left, ...rest })
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
export default function TopNav({ children, searchOpen, left, ...rest }) {
|
|
51
|
+
return (
|
|
52
|
+
<List
|
|
53
|
+
className={cx(left ? 'left' : null, searchOpen && 'searchOpen')}
|
|
54
|
+
{...rest}
|
|
55
|
+
>
|
|
56
|
+
{React.Children.map(
|
|
57
|
+
children,
|
|
58
|
+
item => item && <li className="top-nav-list-item">{item}</li>
|
|
59
|
+
)}
|
|
60
|
+
</List>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -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}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* TODO This is temporary, delete before merging
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { useContext } from 'react';
|
|
7
|
+
import { ProductListContext } from '@jetshop/core/hooks/ProductList/ProductListContext';
|
|
8
|
+
import { Link } from 'react-router-dom';
|
|
9
|
+
import useAuth from '@jetshop/core/components/AuthContext/useAuth';
|
|
10
|
+
|
|
11
|
+
export default function Lister() {
|
|
12
|
+
const { state, createList, deleteList } = useContext(ProductListContext);
|
|
13
|
+
const { loggedIn } = useAuth();
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<h2>Product lists</h2>
|
|
17
|
+
{loggedIn ? (
|
|
18
|
+
<button onClick={() => createList('BOOM')}>
|
|
19
|
+
Create a list a new list called BOOM
|
|
20
|
+
</button>
|
|
21
|
+
) : (
|
|
22
|
+
<></>
|
|
23
|
+
)}
|
|
24
|
+
|
|
25
|
+
<br />
|
|
26
|
+
|
|
27
|
+
<ul>
|
|
28
|
+
{Array.from(state.lists.entries()).map(([listId, obj]) => (
|
|
29
|
+
<li key={listId} style={{ padding: '0.5em' }}>
|
|
30
|
+
<Link to={`/favourites/${listId || ''}`}>
|
|
31
|
+
{listId === null ? 'Default list' : obj.name}
|
|
32
|
+
</Link>
|
|
33
|
+
{listId === null ? (
|
|
34
|
+
<></>
|
|
35
|
+
) : (
|
|
36
|
+
<button onClick={() => deleteList(listId)}>DELETE</button>
|
|
37
|
+
)}
|
|
38
|
+
</li>
|
|
39
|
+
))}
|
|
40
|
+
</ul>
|
|
41
|
+
<hr />
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -7,7 +7,7 @@ import { SelectVariant } from './SelectVariant';
|
|
|
7
7
|
import { ReactComponent as TrashSVG } from '../../svg/trash.svg';
|
|
8
8
|
import { useProductList } from '@jetshop/core/hooks/ProductList';
|
|
9
9
|
|
|
10
|
-
export function Product({ product, loading, children }) {
|
|
10
|
+
export function Product({ product, loading, children, listId }) {
|
|
11
11
|
// Use the variant's image for display
|
|
12
12
|
const productForDisplay = { ...product };
|
|
13
13
|
if (product.isVariant && product.variant.images) {
|
|
@@ -19,7 +19,7 @@ export function Product({ product, loading, children }) {
|
|
|
19
19
|
<ProductCard product={productForDisplay} as="div">
|
|
20
20
|
{product.hasVariants && (
|
|
21
21
|
<div className="select-variant">
|
|
22
|
-
<SelectVariant product={product} />
|
|
22
|
+
<SelectVariant listId={listId} product={product} />
|
|
23
23
|
</div>
|
|
24
24
|
)}
|
|
25
25
|
{product.validation.status === 'valid' ? (
|
|
@@ -28,6 +28,7 @@ export function Product({ product, loading, children }) {
|
|
|
28
28
|
<InvalidProduct validation={product.validation} />
|
|
29
29
|
)}
|
|
30
30
|
<RemoveFromList
|
|
31
|
+
listId={listId}
|
|
31
32
|
articleNumber={product.articleNumber}
|
|
32
33
|
variant={product.variant}
|
|
33
34
|
/>
|
|
@@ -36,8 +37,8 @@ export function Product({ product, loading, children }) {
|
|
|
36
37
|
);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
function RemoveFromList({ children, articleNumber, variant }) {
|
|
40
|
-
const { remove } = useProductList();
|
|
40
|
+
function RemoveFromList({ children, articleNumber, variant, listId }) {
|
|
41
|
+
const { remove } = useProductList(listId);
|
|
41
42
|
const variantArticleNumber = variant?.articleNumber;
|
|
42
43
|
return (
|
|
43
44
|
<button
|
|
@@ -12,8 +12,8 @@ query ProductsFromProductList($articleNumbers: [String]) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
## query
|
|
15
|
-
query ProductList {
|
|
16
|
-
customerProductList {
|
|
15
|
+
query ProductList($id: ID) {
|
|
16
|
+
customerProductList(id: $id) {
|
|
17
17
|
...ProductListFragment
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -27,7 +27,7 @@ mutation AddToProductList($id: ID, $items: [AddToCustomerProductListInput!]!) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
## remove
|
|
30
|
+
## remove article from product list
|
|
31
31
|
mutation RemoveFromProductList($id: ID, $articleNumbers: [String!]) {
|
|
32
32
|
removeFromCustomerProductList(id: $id, articleNumbers: $articleNumbers) {
|
|
33
33
|
customerProductList {
|
|
@@ -54,9 +54,12 @@ mutation MergeProductLists($id: ID, $items: [AddToCustomerProductListInput!]!) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
### Fragments ###
|
|
58
|
-
|
|
59
57
|
fragment MinimalProductListDetail on CustomerProductList {
|
|
58
|
+
id
|
|
59
|
+
name
|
|
60
|
+
# TODO
|
|
61
|
+
# typeId {...}
|
|
62
|
+
# description
|
|
60
63
|
items {
|
|
61
64
|
variant {
|
|
62
65
|
articleNumber
|
|
@@ -10,18 +10,14 @@ import {
|
|
|
10
10
|
import { ReactComponent as Check } from '@jetshop/ui/svg/Check.svg';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
|
-
export function SelectVariant({ product }) {
|
|
14
|
-
const { update } = useProductList();
|
|
13
|
+
export function SelectVariant({ product, listId }) {
|
|
14
|
+
const { update } = useProductList(listId);
|
|
15
15
|
const initialVariant = product.variant;
|
|
16
16
|
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
validateSelection
|
|
22
|
-
} = useProductVariants(product, {
|
|
23
|
-
initialVariant
|
|
24
|
-
});
|
|
17
|
+
const { selectedVariant, selectValue, getSelectedValue, validateSelection } =
|
|
18
|
+
useProductVariants(product, {
|
|
19
|
+
initialVariant
|
|
20
|
+
});
|
|
25
21
|
|
|
26
22
|
React.useEffect(() => {
|
|
27
23
|
// When a variant is selected, call the update function from useProductList to update the list
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import queries from '@jetshop/core/data/queries/ProductLists.gql';
|
|
2
|
+
import mutations from '@jetshop/core/data/mutations/productListMutations.gql';
|
|
1
3
|
import * as ProductListQueries from './ProductLists.gql';
|
|
2
4
|
|
|
3
5
|
export const productListQueries = {
|
|
6
|
+
createList: mutations.CreateProductList,
|
|
7
|
+
deleteList: mutations.DeleteProductList,
|
|
8
|
+
all: queries.ProductLists,
|
|
4
9
|
query: ProductListQueries.ProductList,
|
|
5
10
|
productsQuery: ProductListQueries.ProductsFromProductList,
|
|
6
11
|
add: ProductListQueries.AddToProductList,
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { styled } from 'linaria/react';
|
|
3
|
+
import { css, cx } from 'linaria';
|
|
4
|
+
import { Form } from 'formik';
|
|
5
|
+
|
|
1
6
|
import AddToCartFormik from '@jetshop/core/cart/AddToCartFormik';
|
|
2
7
|
import ProductConfigurationContext from '@jetshop/core/components/ProductConfigurationProvider/ProductConfigurationContext';
|
|
3
8
|
import { useDynamicPrice } from '@jetshop/core/hooks/useDynamicPrice';
|
|
4
9
|
import t from '@jetshop/intl';
|
|
5
10
|
import { Price } from '@jetshop/ui/Price';
|
|
6
11
|
import { useStockStatus } from '@jetshop/ui/Stock/StockStatusContainer';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import { css, cx } from 'linaria';
|
|
11
|
-
import addToCartMutation from '../../Cart/addToCart.gql';
|
|
12
|
-
import CartQuery from '../../Cart/CartQuery.gql';
|
|
12
|
+
import { PreOrderDateSelector } from '@jetshop/ui/PreOrderDateSelector';
|
|
13
|
+
import { useNotification } from '@jetshop/core/components/Notifications';
|
|
14
|
+
|
|
13
15
|
import InputWithLabel from '../../Forms/Input';
|
|
14
16
|
import Button from '../../ui/Button';
|
|
15
17
|
import { IncludedInPackages } from '../PackageProduct/IncludedInPackages';
|
|
@@ -19,11 +21,12 @@ import StockStatusIndicator from '../StockStatus/StockStatusIndicator';
|
|
|
19
21
|
import { useProductValidationMessage } from '../useProductValidationMessage';
|
|
20
22
|
import { VariantSelector, dropdownStyles } from '../VariantSelector';
|
|
21
23
|
import { theme } from '../../Theme';
|
|
22
|
-
import { useNotification } from '@jetshop/core/components/Notifications';
|
|
23
24
|
import ProductToastWrapper from './ProductToast';
|
|
24
25
|
import { ConfigurationSelector } from '../ConfigurationSelector';
|
|
25
26
|
import WarehouseStock from '../StockStatus/WarehouseStock';
|
|
26
|
-
|
|
27
|
+
|
|
28
|
+
import addToCartMutation from '../../Cart/queries/addToCart.gql';
|
|
29
|
+
import CartQuery from '../../Cart/queries/cartQuery.gql';
|
|
27
30
|
|
|
28
31
|
const StyledForm = styled(Form)`
|
|
29
32
|
display: flex;
|
|
@@ -56,7 +59,7 @@ function AddToCartForm({
|
|
|
56
59
|
product,
|
|
57
60
|
variant,
|
|
58
61
|
getMissingOptions,
|
|
59
|
-
variantHandler
|
|
62
|
+
variantHandler
|
|
60
63
|
}) {
|
|
61
64
|
const configurationContext = useContext(ProductConfigurationContext);
|
|
62
65
|
const price = useDynamicPrice(product, variant);
|
|
@@ -68,7 +71,7 @@ function AddToCartForm({
|
|
|
68
71
|
missingOptions,
|
|
69
72
|
variantValidation,
|
|
70
73
|
hasVariants,
|
|
71
|
-
stockStatus
|
|
74
|
+
stockStatus
|
|
72
75
|
});
|
|
73
76
|
const [trigger, dismiss] = useNotification();
|
|
74
77
|
|
|
@@ -82,12 +85,12 @@ function AddToCartForm({
|
|
|
82
85
|
/>,
|
|
83
86
|
{
|
|
84
87
|
id: mutationId,
|
|
85
|
-
type: 'add-to-cart'
|
|
88
|
+
type: 'add-to-cart'
|
|
86
89
|
}
|
|
87
90
|
);
|
|
88
91
|
};
|
|
89
92
|
const onAddToCartError = () => {
|
|
90
|
-
return ({
|
|
93
|
+
return ({ mutationId, quantity, price, error }) => {
|
|
91
94
|
dismiss(mutationId);
|
|
92
95
|
|
|
93
96
|
trigger(
|
|
@@ -99,7 +102,7 @@ function AddToCartForm({
|
|
|
99
102
|
error={error}
|
|
100
103
|
/>,
|
|
101
104
|
{
|
|
102
|
-
type: 'add-to-cart'
|
|
105
|
+
type: 'add-to-cart'
|
|
103
106
|
}
|
|
104
107
|
);
|
|
105
108
|
};
|
|
@@ -136,9 +139,7 @@ function AddToCartForm({
|
|
|
136
139
|
css={{
|
|
137
140
|
marginBottom: '24px',
|
|
138
141
|
opacity:
|
|
139
|
-
configurationContext && configurationContext.loading
|
|
140
|
-
? 0.3
|
|
141
|
-
: 1,
|
|
142
|
+
configurationContext && configurationContext.loading ? 0.3 : 1
|
|
142
143
|
}}
|
|
143
144
|
/>
|
|
144
145
|
|
|
@@ -151,7 +152,7 @@ function AddToCartForm({
|
|
|
151
152
|
|
|
152
153
|
<StyledForm>
|
|
153
154
|
{product.customerComments &&
|
|
154
|
-
product.customerComments.map(
|
|
155
|
+
product.customerComments.map(comment => (
|
|
155
156
|
<InputWithLabel
|
|
156
157
|
wrapperClassName="customer-comment-input-wrapper"
|
|
157
158
|
className="customer-comment-input"
|
|
@@ -184,7 +185,7 @@ function AddToCartForm({
|
|
|
184
185
|
style={{
|
|
185
186
|
opacity: !!validationMessage ? 0.7 : 1,
|
|
186
187
|
cursor: !!validationMessage ? 'not-allowed' : 'pointer',
|
|
187
|
-
width: '100%'
|
|
188
|
+
width: '100%'
|
|
188
189
|
}}
|
|
189
190
|
>
|
|
190
191
|
{validationMessage ? validationMessage : t('Add to cart')}
|
|
@@ -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 ChannelContext from '@jetshop/core/components/ChannelContext';
|
|
@@ -5,11 +8,11 @@ import CartProvider from '@jetshop/core/components/Query/CartProvider';
|
|
|
5
8
|
import t from '@jetshop/intl';
|
|
6
9
|
import Image from '@jetshop/ui/Image/Image';
|
|
7
10
|
import { Price } from '@jetshop/ui/Price';
|
|
11
|
+
|
|
12
|
+
import { baseStyles } from '../../ui/Button';
|
|
8
13
|
import { theme } from '../../Theme';
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
import { TrendLink, baseStyles } from '../../ui/Button';
|
|
12
|
-
import cartQuery from '../../Cart/CartQuery.gql';
|
|
14
|
+
|
|
15
|
+
import cartQuery from '../../Cart/queries/cartQuery.gql';
|
|
13
16
|
|
|
14
17
|
const Container = styled('aside')`
|
|
15
18
|
${theme.above.sm} {
|
|
@@ -26,9 +26,20 @@ export default function ImageContainer({ images, badges, variant, ...rest }) {
|
|
|
26
26
|
variant
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
+
const selectedVariantImageIndex = variant
|
|
30
|
+
? images.findIndex(image => image.url === variant.images?.[0]?.url)
|
|
31
|
+
: null;
|
|
32
|
+
|
|
29
33
|
return (
|
|
30
34
|
<div {...rest} className={cx(rest.className, wrapper)}>
|
|
31
|
-
<Gallery
|
|
35
|
+
<Gallery
|
|
36
|
+
aspect={'1:1'}
|
|
37
|
+
images={images}
|
|
38
|
+
galleryRef={galleryRef}
|
|
39
|
+
eagerlyLoad={
|
|
40
|
+
selectedVariantImageIndex ? [0, selectedVariantImageIndex] : [0]
|
|
41
|
+
}
|
|
42
|
+
>
|
|
32
43
|
<Badges badges={badges} />
|
|
33
44
|
</Gallery>
|
|
34
45
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { usePackageProduct } from '@jetshop/core/hooks/PackageProducts';
|
|
2
|
-
import { useIntl } from '@jetshop/intl';
|
|
3
|
-
import { Price } from '@jetshop/ui/Price';
|
|
4
1
|
import React, { useEffect, useRef } from 'react';
|
|
5
2
|
import { styled } from 'linaria/react';
|
|
6
3
|
import { css } from 'linaria';
|
|
7
|
-
|
|
8
|
-
import
|
|
4
|
+
|
|
5
|
+
import { usePackageProduct } from '@jetshop/core/hooks/PackageProducts';
|
|
6
|
+
import { useIntl } from '@jetshop/intl';
|
|
7
|
+
import { Price } from '@jetshop/ui/Price';
|
|
8
|
+
import { useNotification } from '@jetshop/core/components/Notifications';
|
|
9
9
|
import { ReactComponent as Cart } from '../../../svg/Cart.svg';
|
|
10
10
|
import {
|
|
11
11
|
default as Button,
|
|
@@ -14,7 +14,9 @@ import {
|
|
|
14
14
|
import { PackageProductItem } from './PackageProductItem';
|
|
15
15
|
import packageProductQuery from './PackageProductQuery.gql';
|
|
16
16
|
import { theme } from '../../Theme';
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
import addMultipleToCartMutation from '../../Cart/queries/addMultipleToCart.gql';
|
|
19
|
+
import cartQuery from '../../Cart/queries/cartQuery.gql';
|
|
18
20
|
|
|
19
21
|
const PackageProductWrapper = styled('div')`
|
|
20
22
|
padding: 12px;
|
|
@@ -56,7 +56,7 @@ const ProductInfo = ({ product }) => {
|
|
|
56
56
|
/>
|
|
57
57
|
</ProductSection>
|
|
58
58
|
)}
|
|
59
|
-
{product.customFields
|
|
59
|
+
{product.customFields?.length > 0 && (
|
|
60
60
|
<ProductSection>
|
|
61
61
|
<SectionHeading>{t('Specifications')}</SectionHeading>
|
|
62
62
|
<ProductSpecifications fields={product.customFields} />
|
|
@@ -129,10 +129,8 @@ const Product = ({ result: { data, loading }, product }) => {
|
|
|
129
129
|
preselectCheapest: true
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
-
const {
|
|
133
|
-
|
|
134
|
-
getMissingOptions
|
|
135
|
-
} = variantHandler;
|
|
132
|
+
const { selectedVariant: selectedVariation, getMissingOptions } =
|
|
133
|
+
variantHandler;
|
|
136
134
|
|
|
137
135
|
// Return early if there is no product
|
|
138
136
|
if (!product)
|
|
@@ -150,8 +148,8 @@ const Product = ({ result: { data, loading }, product }) => {
|
|
|
150
148
|
<ProductContainer>
|
|
151
149
|
<MaxWidth>
|
|
152
150
|
<Breadcrumbs
|
|
151
|
+
breadcrumbs={data?.route?.breadcrumbs || []}
|
|
153
152
|
parents={parents}
|
|
154
|
-
breadcrumbText={product.breadcrumbText}
|
|
155
153
|
/>
|
|
156
154
|
</MaxWidth>
|
|
157
155
|
<Container>
|