@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
|
@@ -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,12 +12,30 @@ 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
|
}
|
|
20
20
|
|
|
21
|
+
## query all lists
|
|
22
|
+
query ProductLists {
|
|
23
|
+
customerProductLists {
|
|
24
|
+
...ProductListFragment
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Create a product list
|
|
30
|
+
mutation CreateProductList($input: CreateCustomerProductListInput!) {
|
|
31
|
+
createCustomerProductList(input: $input) {
|
|
32
|
+
success
|
|
33
|
+
customerProductList {
|
|
34
|
+
...MinimalProductListDetail
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
## add
|
|
22
40
|
mutation AddToProductList($id: ID, $items: [AddToCustomerProductListInput!]!) {
|
|
23
41
|
addToCustomerProductList(id: $id, items: $items) {
|
|
@@ -27,7 +45,7 @@ mutation AddToProductList($id: ID, $items: [AddToCustomerProductListInput!]!) {
|
|
|
27
45
|
}
|
|
28
46
|
}
|
|
29
47
|
|
|
30
|
-
## remove
|
|
48
|
+
## remove article from product list
|
|
31
49
|
mutation RemoveFromProductList($id: ID, $articleNumbers: [String!]) {
|
|
32
50
|
removeFromCustomerProductList(id: $id, articleNumbers: $articleNumbers) {
|
|
33
51
|
customerProductList {
|
|
@@ -36,6 +54,13 @@ mutation RemoveFromProductList($id: ID, $articleNumbers: [String!]) {
|
|
|
36
54
|
}
|
|
37
55
|
}
|
|
38
56
|
|
|
57
|
+
## delete product list
|
|
58
|
+
mutation DeleteProductList($id: ID) {
|
|
59
|
+
deleteCustomerProductList(id: $id) {
|
|
60
|
+
success
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
39
64
|
## update
|
|
40
65
|
mutation UpdateProductListItem($input: UpdateCustomerProductListItemInput!) {
|
|
41
66
|
updateCustomerProductListItem(input: $input) {
|
|
@@ -54,9 +79,12 @@ mutation MergeProductLists($id: ID, $items: [AddToCustomerProductListInput!]!) {
|
|
|
54
79
|
}
|
|
55
80
|
}
|
|
56
81
|
|
|
57
|
-
### Fragments ###
|
|
58
|
-
|
|
59
82
|
fragment MinimalProductListDetail on CustomerProductList {
|
|
83
|
+
id
|
|
84
|
+
name
|
|
85
|
+
# TODO
|
|
86
|
+
# typeId {...}
|
|
87
|
+
# description
|
|
60
88
|
items {
|
|
61
89
|
variant {
|
|
62
90
|
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,9 @@
|
|
|
1
1
|
import * as ProductListQueries from './ProductLists.gql';
|
|
2
2
|
|
|
3
3
|
export const productListQueries = {
|
|
4
|
+
createList: ProductListQueries.CreateProductList,
|
|
5
|
+
deleteList: ProductListQueries.DeleteProductList,
|
|
6
|
+
all: ProductListQueries.ProductLists,
|
|
4
7
|
query: ProductListQueries.ProductList,
|
|
5
8
|
productsQuery: ProductListQueries.ProductsFromProductList,
|
|
6
9
|
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';
|
|
8
|
-
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { styled } from 'linaria/react';
|
|
11
|
+
|
|
11
12
|
import { baseStyles } from '../../ui/Button';
|
|
12
|
-
import
|
|
13
|
+
import { theme } from '../../Theme';
|
|
14
|
+
|
|
15
|
+
import cartQuery from '../../Cart/queries/cartQuery.gql';
|
|
13
16
|
|
|
14
17
|
const Container = styled('aside')`
|
|
15
18
|
${theme.above.sm} {
|
|
@@ -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;
|
|
@@ -159,7 +159,7 @@ function DropdownVariantSelect({
|
|
|
159
159
|
<DropdownMenuItem
|
|
160
160
|
data-testid={value + option.name}
|
|
161
161
|
key={value + option.name}
|
|
162
|
-
disabled={doNotDisable && validation === 'invalid'}
|
|
162
|
+
disabled={!doNotDisable && validation === 'invalid'}
|
|
163
163
|
onSelect={({ setIsOpen }) => {
|
|
164
164
|
selectValue(value, option);
|
|
165
165
|
setIsOpen(false);
|
|
@@ -3,7 +3,7 @@ import { styled } from 'linaria/react';
|
|
|
3
3
|
import CategoryLink from '@jetshop/ui/CategoryLink';
|
|
4
4
|
import Image from '@jetshop/ui/Image';
|
|
5
5
|
import { theme } from '../Theme';
|
|
6
|
-
import
|
|
6
|
+
import MaxWidth from '../Layout/MaxWidth';
|
|
7
7
|
|
|
8
8
|
const ScrollWrapper = styled('div')`
|
|
9
9
|
margin: 0 -1.5rem;
|
|
@@ -112,7 +112,9 @@ const CategoriesHeader = styled('h3')`
|
|
|
112
112
|
}
|
|
113
113
|
`;
|
|
114
114
|
|
|
115
|
-
const CategoryListWrapper = styled('div')
|
|
115
|
+
const CategoryListWrapper = styled('div')`
|
|
116
|
+
padding: 1rem 0;
|
|
117
|
+
`;
|
|
116
118
|
|
|
117
119
|
const Category = ({ category }) => {
|
|
118
120
|
const categoryImageUrl = category?.images?.[0]?.url;
|
|
@@ -135,7 +137,7 @@ const Category = ({ category }) => {
|
|
|
135
137
|
};
|
|
136
138
|
const CategoryList = ({ title, categories, className = '' }) => {
|
|
137
139
|
return (
|
|
138
|
-
<
|
|
140
|
+
<MaxWidth className={className}>
|
|
139
141
|
<CategoryListWrapper>
|
|
140
142
|
<CategoriesHeader>{title}</CategoriesHeader>
|
|
141
143
|
<ScrollWrapper>
|
|
@@ -146,7 +148,7 @@ const CategoryList = ({ title, categories, className = '' }) => {
|
|
|
146
148
|
</CategoriesWrapper>
|
|
147
149
|
</ScrollWrapper>
|
|
148
150
|
</CategoryListWrapper>
|
|
149
|
-
</
|
|
151
|
+
</MaxWidth>
|
|
150
152
|
);
|
|
151
153
|
};
|
|
152
154
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from '@jetshop/intl';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Query } from 'react-apollo';
|
|
4
|
-
import CategoryList from '
|
|
4
|
+
import CategoryList from './CategoryList';
|
|
5
5
|
import { Header, Matches } from './SearchPage';
|
|
6
6
|
import SearchTerm from './SearchTerm';
|
|
7
7
|
import EmptySearchCategoriesQuery from './EmptySearchCategoriesQuery.gql';
|
package/src/components/Shop.js
CHANGED
|
@@ -1,60 +1,53 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Helmet } from 'react-helmet-async';
|
|
3
|
+
import { Route, Switch } from 'react-router-dom';
|
|
4
|
+
|
|
2
5
|
import CustomFont from '@jetshop/core/components/Fonts/CustomFont';
|
|
6
|
+
import DynamicRoute from '@jetshop/core/components/DynamicRoute';
|
|
3
7
|
import PaginationProvider from '@jetshop/core/components/Pagination/PaginationProvider';
|
|
4
8
|
import { ProductListProvider } from '@jetshop/core/hooks/ProductList/ProductListContext';
|
|
5
9
|
import { useShopConfig } from '@jetshop/core/hooks/useShopConfig';
|
|
10
|
+
|
|
6
11
|
import GenericError from '@jetshop/ui/ErrorBoundary/Generic';
|
|
7
12
|
import LoadingBar from '@jetshop/ui/Loading/LoadingBar';
|
|
8
13
|
import ModalProvider from '@jetshop/ui/Modal/ModalProvider';
|
|
9
14
|
import ModalRoot from '@jetshop/ui/Modal/ModalRoot';
|
|
10
15
|
import ScrollRestorationHandler from '@jetshop/ui/ScrollRestorationHandler';
|
|
11
|
-
|
|
12
|
-
import { Helmet } from 'react-helmet-async';
|
|
13
|
-
import loadable from '@loadable/component';
|
|
14
|
-
import { Route, Switch } from 'react-router-dom';
|
|
15
|
-
import loadFontCss from '../fonts/loadFontCss';
|
|
16
|
-
import CategoryPreviewQuery from './CategoryPreviewQuery.gql';
|
|
17
|
-
import PagePreviewQuery from './PagePreviewQuery.gql';
|
|
16
|
+
|
|
18
17
|
import Container from './Layout/Container';
|
|
19
18
|
import Content from './Layout/Content';
|
|
20
19
|
import Footer from './Layout/Footer/Footer';
|
|
21
20
|
import Header from './Layout/Header/Header';
|
|
21
|
+
|
|
22
|
+
import ForgotPassword from './Auth/ForgotPassword.loadable';
|
|
23
|
+
import LogInPage from './Auth/LogInPage.loadable';
|
|
24
|
+
import ResetPassword from './Auth/ResetPassword.loadable';
|
|
25
|
+
import SignUpPage from './Auth/Signup/SignUpPage.loadable';
|
|
26
|
+
import CategoryPage from './CategoryPage/CategoryPage.loadable';
|
|
27
|
+
import ContentPage from './ContentPage/ContentPage.loadable';
|
|
28
|
+
import CookieConsent from './CookieConsent';
|
|
22
29
|
import LoadingPage from './LoadingPage';
|
|
30
|
+
import LogOutPage from './LogOut.loadable';
|
|
31
|
+
import MyPages from './MyPages/MyPages.loadable';
|
|
32
|
+
import NavTreePage from './NavigationTree/NavTreePage.loadable';
|
|
33
|
+
import NotFoundPage from './NotFoundPage.loadable';
|
|
34
|
+
import PreviewRoute from './PreviewRoute.loadable';
|
|
23
35
|
import { Favourites } from './ProductList/Favourites';
|
|
24
36
|
import { productListQueries } from './ProductList/productListQueries';
|
|
25
|
-
import ProductPreviewQuery from './ProductPreviewQuery.gql';
|
|
26
|
-
import routeQuery from './RouteQuery.gql';
|
|
27
|
-
import { theme } from './Theme';
|
|
28
|
-
import '../globalStyles';
|
|
29
|
-
import CookieConsent from './CookieConsent';
|
|
30
|
-
import Store from './Store/Store.loadable';
|
|
31
|
-
import StoreLocator from './StoreLocator/StoreLocator.loadable';
|
|
32
|
-
import NotFoundPage from './NotFoundPage.loadable';
|
|
33
|
-
import LogInPage from './Auth/LogInPage.loadable';
|
|
34
|
-
import NavTreePage from './NavigationTree/NavTreePage.loadable';
|
|
35
|
-
import StartPage from './StartPage/StartPage.loadable';
|
|
36
37
|
import ProductPage from './ProductPage/ProductPage.loadable';
|
|
37
|
-
import CategoryPage from './CategoryPage/CategoryPage.loadable';
|
|
38
|
-
import ContentPage from './ContentPage/ContentPage.loadable';
|
|
39
38
|
import SearchPage from './SearchPage/SearchPage.loadable';
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import MyPages from './MyPages/MyPages.loadable';
|
|
39
|
+
import StartPage from './StartPage/StartPage.loadable';
|
|
40
|
+
import Store from './Store/Store.loadable';
|
|
41
|
+
import StoreLocator from './StoreLocator/StoreLocator.loadable';
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
);
|
|
43
|
+
import categoryPreviewQuery from './CategoryPreviewQuery.gql';
|
|
44
|
+
import pagePreviewQuery from './PagePreviewQuery.gql';
|
|
45
|
+
import productPreviewQuery from './ProductPreviewQuery.gql';
|
|
46
|
+
import routeQuery from './RouteQuery.gql';
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
fallback: <LoadingPage />
|
|
56
|
-
}
|
|
57
|
-
);
|
|
48
|
+
import { theme } from './Theme';
|
|
49
|
+
import loadFontCss from '../fonts/loadFontCss';
|
|
50
|
+
import '../globalStyles';
|
|
58
51
|
|
|
59
52
|
function Shop() {
|
|
60
53
|
const { routes } = useShopConfig();
|
|
@@ -76,49 +69,32 @@ function Shop() {
|
|
|
76
69
|
<Content>
|
|
77
70
|
<PaginationProvider defaultProductsPerPage={24}>
|
|
78
71
|
<Switch>
|
|
79
|
-
<Route exact path="/"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<Route path=
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<Route path={routes.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<Route path={routes.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<Route
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<StoreLocator />
|
|
99
|
-
</Route>
|
|
100
|
-
<Route path={`${routes.store.path}/:id`}>
|
|
101
|
-
<Store />
|
|
102
|
-
</Route>
|
|
103
|
-
<Route path={routes.tree.path}>
|
|
104
|
-
<NavTreePage />
|
|
105
|
-
</Route>
|
|
106
|
-
<Route path={routes.myPages.path}>
|
|
107
|
-
<MyPages />
|
|
108
|
-
</Route>
|
|
109
|
-
<Route exact path={routes.forgotPassword.path}>
|
|
110
|
-
<ForgotPassword />
|
|
111
|
-
</Route>
|
|
112
|
-
<Route path={`${routes.resetPassword.path}/:token`}>
|
|
113
|
-
<ResetPassword />
|
|
114
|
-
</Route>
|
|
72
|
+
<Route exact path="/" component={StartPage} />
|
|
73
|
+
<Route path="/favourites" component={Favourites} />
|
|
74
|
+
<Route path={routes.search.path} component={SearchPage} />
|
|
75
|
+
<Route path={routes.signup.path} component={SignUpPage} />
|
|
76
|
+
<Route path={routes.login.path} component={LogInPage} />
|
|
77
|
+
<Route path={routes.logout.path} component={LogOutPage} />
|
|
78
|
+
<Route path={routes.stores.path} component={StoreLocator} />
|
|
79
|
+
<Route path={`${routes.store.path}/:id`} component={Store} />
|
|
80
|
+
<Route path={routes.tree.path} component={NavTreePage} />
|
|
81
|
+
<Route path={routes.myPages.path} component={MyPages} />
|
|
82
|
+
<Route
|
|
83
|
+
exact
|
|
84
|
+
path={routes.forgotPassword.path}
|
|
85
|
+
component={ForgotPassword}
|
|
86
|
+
/>
|
|
87
|
+
<Route
|
|
88
|
+
path={`${routes.resetPassword.path}/:token`}
|
|
89
|
+
component={ResetPassword}
|
|
90
|
+
/>
|
|
115
91
|
<Route
|
|
116
92
|
path="/preview"
|
|
117
93
|
render={props => (
|
|
118
94
|
<PreviewRoute
|
|
119
|
-
productQuery={
|
|
120
|
-
categoryQuery={
|
|
121
|
-
pageQuery={
|
|
95
|
+
productQuery={productPreviewQuery}
|
|
96
|
+
categoryQuery={categoryPreviewQuery}
|
|
97
|
+
pageQuery={pagePreviewQuery}
|
|
122
98
|
productPage={ProductPage}
|
|
123
99
|
categoryPage={CategoryPage}
|
|
124
100
|
contentPage={ContentPage}
|
|
@@ -66,12 +66,20 @@ const heroStyles = css`
|
|
|
66
66
|
justify-content: center;
|
|
67
67
|
`;
|
|
68
68
|
|
|
69
|
-
const StartPageHero = ({
|
|
69
|
+
const StartPageHero = ({
|
|
70
|
+
header,
|
|
71
|
+
text,
|
|
72
|
+
buttonText,
|
|
73
|
+
buttonLink,
|
|
74
|
+
imageSrc,
|
|
75
|
+
isAboveFold
|
|
76
|
+
}) => (
|
|
70
77
|
<StartPageHeroWrapper>
|
|
71
78
|
<Image
|
|
72
79
|
fillAvailableSpace={true}
|
|
73
80
|
src={imageSrc.value}
|
|
74
81
|
className={heroStyles}
|
|
82
|
+
critical={isAboveFold.value}
|
|
75
83
|
>
|
|
76
84
|
<Container>
|
|
77
85
|
<Title>{header.value}</Title>
|
|
@@ -2,7 +2,6 @@ import StartPageRenderer from '@jetshop/ui/StartPageRenderer';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useQuery } from 'react-apollo';
|
|
4
4
|
import { styled } from 'linaria/react';
|
|
5
|
-
import MaxWidth from '../Layout/MaxWidth';
|
|
6
5
|
import LoadingPage from '../LoadingPage';
|
|
7
6
|
import StartPageCampaign from './Content/StartPageCampaign';
|
|
8
7
|
import StartPageCategories from './Content/StartPageCategories';
|
|
@@ -12,8 +11,6 @@ import StartPageProductGrid from './Content/StartPageProductGrid';
|
|
|
12
11
|
import startPageQuery from './StartPageQuery.gql';
|
|
13
12
|
import { StartPageCategoryItem } from './Content/StartPageCategories';
|
|
14
13
|
|
|
15
|
-
import { theme } from '../Theme';
|
|
16
|
-
|
|
17
14
|
const startPageComponents = {
|
|
18
15
|
HERO: StartPageHero,
|
|
19
16
|
HTML: StartPageHTMLContent,
|
|
@@ -29,16 +26,6 @@ const StartPageWrapper = styled('div')`
|
|
|
29
26
|
flex-direction: column;
|
|
30
27
|
`;
|
|
31
28
|
|
|
32
|
-
export const MainSectionWrapper = styled(MaxWidth)`
|
|
33
|
-
width: 100%;
|
|
34
|
-
align-self: center;
|
|
35
|
-
padding-left: 1.5rem;
|
|
36
|
-
padding-right: 1.5rem;
|
|
37
|
-
${theme.below.sm} {
|
|
38
|
-
padding-left: 0px;
|
|
39
|
-
padding-right: 0px;
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
29
|
const StartPage = ({ startPageId }) => {
|
|
43
30
|
const result = useQuery(startPageQuery, {
|
|
44
31
|
variables: { startPageId: startPageId }
|