@jetshop/template-trend 5.11.0 → 5.12.1

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.
Files changed (178) hide show
  1. package/.linaria-cache/packages/template-trend/src/components/Auth/LogInPage.linaria.css +4 -4
  2. package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/Address.linaria.css +1 -1
  3. package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/CustomerType.linaria.css +1 -1
  4. package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/LoginFields.linaria.css +1 -1
  5. package/.linaria-cache/packages/template-trend/src/components/Auth/Signup/SignUpPage.linaria.css +2 -2
  6. package/.linaria-cache/packages/template-trend/src/components/Auth/UI/Form.linaria.css +2 -2
  7. package/.linaria-cache/packages/template-trend/src/components/Cart/CartButton.linaria.css +2 -2
  8. package/.linaria-cache/packages/template-trend/src/components/Cart/CartFlyout.linaria.css +7 -7
  9. package/.linaria-cache/packages/template-trend/src/components/Cart/CartItem.linaria.css +7 -7
  10. package/.linaria-cache/packages/template-trend/src/components/Cart/FreeShipping.linaria.css +2 -2
  11. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/CategoryHeader.linaria.css +8 -8
  12. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/ActiveFilters.linaria.css +6 -6
  13. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Filter.linaria.css +4 -4
  14. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/FilterDrawer.linaria.css +4 -4
  15. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/FilterDropdownMenu.linaria.css +1 -1
  16. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/ActiveCarot.linaria.css +1 -1
  17. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/FilterButton.linaria.css +5 -5
  18. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/ListAccordion.linaria.css +1 -1
  19. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/Mobile/shared/styles.linaria.css +1 -1
  20. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/Filters/RangeFilters.linaria.css +2 -2
  21. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductCard.linaria.css +1 -1
  22. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductGrid.linaria.css +2 -2
  23. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/ProductGridWindow.linaria.css +2 -2
  24. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/StandardCategoryPage.linaria.css +2 -2
  25. package/.linaria-cache/packages/template-trend/src/components/CategoryPage/WindowedCategoryPage.linaria.css +3 -3
  26. package/.linaria-cache/packages/template-trend/src/components/ContentPage/ContentPage.linaria.css +5 -3
  27. package/.linaria-cache/packages/template-trend/src/components/ContentPage/SubPageNavigation.linaria.css +4 -0
  28. package/.linaria-cache/packages/template-trend/src/components/CookieConsent.linaria.css +1 -1
  29. package/.linaria-cache/packages/template-trend/src/components/Forms/GlobalError.linaria.css +1 -1
  30. package/.linaria-cache/packages/template-trend/src/components/Forms/Input.linaria.css +4 -4
  31. package/.linaria-cache/packages/template-trend/src/components/Forms/InputStatus.linaria.css +3 -3
  32. package/.linaria-cache/packages/template-trend/src/components/Forms/Success.linaria.css +1 -1
  33. package/.linaria-cache/packages/template-trend/src/components/Layout/Container.linaria.css +1 -1
  34. package/.linaria-cache/packages/template-trend/src/components/Layout/Content/index.linaria.css +1 -1
  35. package/.linaria-cache/packages/template-trend/src/components/Layout/Footer/Footer.linaria.css +3 -3
  36. package/.linaria-cache/packages/template-trend/src/components/Layout/Footer/SocialLinks.linaria.css +2 -2
  37. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Categories/MobileCategories.linaria.css +6 -6
  38. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/CategoryMenu.linaria.css +1 -1
  39. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/CategoryMenuContainer.linaria.css +2 -2
  40. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/SubMenuSection.linaria.css +1 -1
  41. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/CategoryMenu/SubMenuWrapper.linaria.css +5 -5
  42. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/ChannelSelector.linaria.css +2 -2
  43. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/ChannelSelectorModal.linaria.css +2 -2
  44. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/ChannelSelector/Selector.linaria.css +5 -5
  45. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Header.linaria.css +7 -7
  46. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/Logo.linaria.css +1 -1
  47. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/LogoSearchBar.linaria.css +1 -1
  48. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/MobileMenu.linaria.css +6 -6
  49. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/RecommendedChannel/ChannelBanner.linaria.css +5 -5
  50. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/RecommendedChannel/RecommendedChannelSelector.linaria.css +9 -9
  51. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/SearchBar.linaria.css +3 -3
  52. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/SearchButton.linaria.css +1 -1
  53. package/.linaria-cache/packages/template-trend/src/components/Layout/Header/TopNav.linaria.css +1 -1
  54. package/.linaria-cache/packages/template-trend/src/components/Layout/MaxWidth.linaria.css +1 -1
  55. package/.linaria-cache/packages/template-trend/src/components/Layout/Notifications.linaria.css +1 -1
  56. package/.linaria-cache/packages/template-trend/src/components/LoadingPage.linaria.css +1 -1
  57. package/.linaria-cache/packages/template-trend/src/components/MyPages/CustomerNameHeader.linaria.css +1 -1
  58. package/.linaria-cache/packages/template-trend/src/components/MyPages/DeleteAccount.linaria.css +1 -1
  59. package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPages.linaria.css +1 -1
  60. package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPagesSidebar.linaria.css +1 -1
  61. package/.linaria-cache/packages/template-trend/src/components/MyPages/MyPagesStartPage.linaria.css +2 -2
  62. package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/ListOrder.linaria.css +1 -1
  63. package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/ListDetail.linaria.css +4 -4
  64. package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/OrderTotals.linaria.css +1 -1
  65. package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderDetail/ShippingPayment.linaria.css +1 -1
  66. package/.linaria-cache/packages/template-trend/src/components/MyPages/Orders/OrderListPage.linaria.css +1 -1
  67. package/.linaria-cache/packages/template-trend/src/components/MyPages/ProfileDeliveryAddresses.linaria.css +1 -1
  68. package/.linaria-cache/packages/template-trend/src/components/MyPages/ProfilePage.linaria.css +4 -4
  69. package/.linaria-cache/packages/template-trend/src/components/NavigationTree/NavTree.linaria.css +2 -2
  70. package/.linaria-cache/packages/template-trend/src/components/Newsletter/NewsletterField.linaria.css +3 -3
  71. package/.linaria-cache/packages/template-trend/src/components/NotFoundPage.linaria.css +1 -1
  72. package/.linaria-cache/packages/template-trend/src/components/Pagination/Pagination.linaria.css +1 -1
  73. package/.linaria-cache/packages/template-trend/src/components/ProductList/AddToCart.linaria.css +1 -1
  74. package/.linaria-cache/packages/template-trend/src/components/ProductList/Favourite.linaria.css +1 -1
  75. package/.linaria-cache/packages/template-trend/src/components/ProductList/Favourites.linaria.css +2 -2
  76. package/.linaria-cache/packages/template-trend/src/components/ProductList/Product.linaria.css +2 -2
  77. package/.linaria-cache/packages/template-trend/src/components/ProductPage/AddToCart/AddToCartForm.linaria.css +3 -3
  78. package/.linaria-cache/packages/template-trend/src/components/ProductPage/AddToCart/ProductToast.linaria.css +9 -9
  79. package/.linaria-cache/packages/template-trend/src/components/ProductPage/Campaigns.linaria.css +2 -2
  80. package/.linaria-cache/packages/template-trend/src/components/ProductPage/ConfigurationSelector.linaria.css +1 -1
  81. package/.linaria-cache/packages/template-trend/src/components/ProductPage/Images/ImageContainer.linaria.css +1 -1
  82. package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/IncludedInPackages.linaria.css +1 -1
  83. package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/PackageProduct.linaria.css +2 -2
  84. package/.linaria-cache/packages/template-trend/src/components/ProductPage/PackageProduct/PackageProductItem.linaria.css +1 -1
  85. package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductInfo.linaria.css +3 -3
  86. package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductInfoAccordion.linaria.css +3 -3
  87. package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductPage.linaria.css +1 -1
  88. package/.linaria-cache/packages/template-trend/src/components/ProductPage/ProductPageLoadingState.linaria.css +3 -3
  89. package/.linaria-cache/packages/template-trend/src/components/ProductPage/RelatedProducts.linaria.css +1 -1
  90. package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/NotifyWhenBack.linaria.css +5 -5
  91. package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/StockOrb.linaria.css +1 -1
  92. package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/StockStatusIndicator.linaria.css +1 -1
  93. package/.linaria-cache/packages/template-trend/src/components/ProductPage/StockStatus/WarehouseStock.linaria.css +2 -2
  94. package/.linaria-cache/packages/template-trend/src/components/ProductPage/VariantSelector.linaria.css +3 -3
  95. package/.linaria-cache/packages/template-trend/src/components/ProductPage/styledComponents.linaria.css +1 -1
  96. package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchMeta.linaria.css +1 -1
  97. package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchPage.linaria.css +3 -3
  98. package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchResults.linaria.css +3 -3
  99. package/.linaria-cache/packages/template-trend/src/components/SearchPage/SearchTerm.linaria.css +1 -1
  100. package/.linaria-cache/packages/template-trend/src/components/SearchPage/WindowedSearchResults.linaria.css +4 -4
  101. package/.linaria-cache/packages/template-trend/src/components/StartPage/CategoryList.linaria.css +6 -6
  102. package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/Row.linaria.css +3 -3
  103. package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageCampaign.linaria.css +7 -7
  104. package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageCategories.linaria.css +3 -3
  105. package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageHTMLContent.linaria.css +1 -1
  106. package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageHero.linaria.css +6 -6
  107. package/.linaria-cache/packages/template-trend/src/components/StartPage/Content/StartPageProductGrid.linaria.css +2 -2
  108. package/.linaria-cache/packages/template-trend/src/components/StartPage/StartPage.linaria.css +1 -2
  109. package/.linaria-cache/packages/template-trend/src/components/Store/Store.linaria.css +1 -1
  110. package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreList.linaria.css +5 -5
  111. package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreLocator.linaria.css +5 -5
  112. package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreMap.linaria.css +1 -1
  113. package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreMarker.linaria.css +1 -1
  114. package/.linaria-cache/packages/template-trend/src/components/StoreLocator/StoreSearch.linaria.css +1 -1
  115. package/.linaria-cache/packages/template-trend/src/components/StoreLocator/UserLocation.linaria.css +1 -1
  116. package/.linaria-cache/packages/template-trend/src/components/ui/Badge.linaria.css +1 -1
  117. package/.linaria-cache/packages/template-trend/src/components/ui/Button.linaria.css +4 -3
  118. package/.linaria-cache/packages/template-trend/src/components/ui/CloseButton.linaria.css +1 -1
  119. package/.linaria-cache/packages/template-trend/src/components/ui/Headings.linaria.css +2 -2
  120. package/.linaria-cache/packages/template-trend/src/components/ui/Spinner.linaria.css +1 -1
  121. package/.linaria-cache/packages/ui/Breadcrumbs/Breadcrumbs.linaria.css +2 -2
  122. package/.linaria-cache/packages/ui/Button/Button.linaria.css +2 -2
  123. package/.linaria-cache/packages/ui/Button/SecondaryButton.linaria.css +1 -1
  124. package/.linaria-cache/packages/ui/Button/TrendButton.linaria.css +1 -1
  125. package/.linaria-cache/packages/ui/ChannelSelector/ChannelSelector.linaria.css +1 -1
  126. package/.linaria-cache/packages/ui/ChannelSelector/ChannelSelectorButtons.linaria.css +2 -2
  127. package/.linaria-cache/packages/ui/ChannelSelector/LargeSelector.linaria.css +1 -1
  128. package/.linaria-cache/packages/ui/ChannelSelector/MiniSelector.linaria.css +1 -1
  129. package/.linaria-cache/packages/ui/Checkbox/Checkbox.linaria.css +4 -4
  130. package/.linaria-cache/packages/ui/Checkbox/CheckboxGroup.linaria.css +2 -2
  131. package/.linaria-cache/packages/ui/DropdownMenu/DropdownMenu.linaria.css +2 -2
  132. package/.linaria-cache/packages/ui/ErrorBoundary/Generic.linaria.css +1 -1
  133. package/.linaria-cache/packages/ui/Gallery/Gallery.linaria.css +2 -2
  134. package/.linaria-cache/packages/ui/JetshopText.linaria.css +1 -1
  135. package/.linaria-cache/packages/ui/Loading/LoadingBar.linaria.css +2 -2
  136. package/.linaria-cache/packages/ui/Modal/Drawer/Drawer.linaria.css +1 -1
  137. package/.linaria-cache/packages/ui/Modal/ModalRoot.linaria.css +1 -1
  138. package/.linaria-cache/packages/ui/Modal/TargetWrapper.linaria.css +1 -1
  139. package/.linaria-cache/packages/ui/Pagination/Pagination.linaria.css +1 -1
  140. package/.linaria-cache/packages/ui/PreOrderDateSelector/PreOrderDateSelector.linaria.css +1 -1
  141. package/.linaria-cache/packages/ui/Price/Price.linaria.css +1 -1
  142. package/.linaria-cache/packages/ui/ProductList/Badges.linaria.css +7 -7
  143. package/.linaria-cache/packages/ui/ProductSpecifications/ProductSpecifications.linaria.css +1 -1
  144. package/.linaria-cache/packages/ui/Search/SearchField.linaria.css +5 -5
  145. package/.linaria-cache/packages/ui/Search/SearchPage/SearchMeta.linaria.css +1 -1
  146. package/.linaria-cache/packages/ui/Select/Components.linaria.css +8 -8
  147. package/.vscode/launch.json +11 -0
  148. package/package.json +5 -5
  149. package/schema.graphql +5 -2
  150. package/src/components/Cart/CartFlyout.js +10 -2
  151. package/src/components/Cart/queries/cartFragment.gql +1 -5
  152. package/src/components/CategoryPage/CategoryHeader.js +3 -3
  153. package/src/components/CategoryPage/ProductCard.js +2 -2
  154. package/src/components/CategoryPage/ProductGrid.js +3 -2
  155. package/src/components/CategoryPage/ProductGridWindow.js +3 -2
  156. package/src/components/CategoryPage/StandardCategoryPage.js +2 -0
  157. package/src/components/CategoryPage/WindowedCategoryPage.js +7 -0
  158. package/src/components/ContentPage/ContentPage.js +69 -38
  159. package/src/components/ContentPage/ContentPageFragment.gql +29 -0
  160. package/src/components/ContentPage/SubPageNavigation.js +206 -0
  161. package/src/components/Layout/Footer/FooterLinks.js +6 -4
  162. package/src/components/Layout/Footer/PagesQuery.gql +9 -0
  163. package/src/components/Layout/Header/AutocompleteQuery.gql +1 -6
  164. package/src/components/ProductList/ProductLists.gql +0 -25
  165. package/src/components/ProductList/productListQueries.js +5 -3
  166. package/src/components/ProductPage/AddToCart/ProductToast.js +11 -3
  167. package/src/components/ProductPage/Images/ImageContainer.js +12 -1
  168. package/src/components/ProductPage/ProductInfo.js +1 -1
  169. package/src/components/ProductPage/ProductPage.js +3 -5
  170. package/src/components/ProductPage/ProductPageFragment.gql +1 -0
  171. package/src/components/ProductPage/StockStatus/WarehouseStock.js +15 -17
  172. package/src/components/RouteQuery.gql +2 -2
  173. package/src/components/StartPage/Content/StartPageHero.js +4 -1
  174. package/src/components/StartPage/ContentItemFragment.gql +6 -1
  175. package/src/components/StartPage/StartPageProductGridFragment.gql +1 -0
  176. package/src/components/ui/Button.js +19 -1
  177. package/src/shop.config.js +1 -1
  178. package/.linaria-cache/packages/ui/ChannelSelector/Region.linaria.css +0 -3
@@ -44,6 +44,7 @@ const Category = ({ category, result }) => {
44
44
  <CategoryHeader
45
45
  category={category}
46
46
  parents={result?.data?.route?.parents}
47
+ breadcrumbs={result?.data?.route?.breadcrumbs}
47
48
  />
48
49
 
49
50
  <Container>
@@ -63,6 +64,7 @@ const Category = ({ category, result }) => {
63
64
  products={category.products.result}
64
65
  listName={category.name}
65
66
  categoryPath={category.isDynamic ? null : result?.data?.route}
67
+ category={result?.data?.route?.breadcrumbs?.join('/') || ''}
66
68
  loading={result.loading}
67
69
  imageSizes={[1 / 2, 1 / 2, 1 / 3, 1 / 4]}
68
70
  />
@@ -78,6 +78,11 @@ const WindowedCategory = ({ category, result }) => {
78
78
  category={category}
79
79
  parents={result?.data?.route?.parents}
80
80
  {...props}
81
+ breadcrumbs={
82
+ props.breadcrumbs?.value
83
+ ? result?.data?.route?.breadcrumbs
84
+ : []
85
+ }
81
86
  />
82
87
  </div>
83
88
  )
@@ -89,6 +94,7 @@ const WindowedCategory = ({ category, result }) => {
89
94
  <CategoryHeader
90
95
  category={category}
91
96
  parents={result?.data?.route?.parents}
97
+ breadcrumbs={result?.data?.route?.breadcrumbs}
92
98
  />
93
99
  )}
94
100
  <Container>
@@ -130,6 +136,7 @@ const WindowedCategory = ({ category, result }) => {
130
136
  products={products}
131
137
  listName={category.name}
132
138
  categoryPath={categoryPath}
139
+ category={result?.data?.route?.breadcrumbs?.join('/') || ''}
133
140
  loading={result.loading}
134
141
  imageSizes={[1 / 2, 1 / 2, 1 / 3, 1 / 4]}
135
142
  />
@@ -3,12 +3,13 @@ import { styled } from 'linaria/react';
3
3
  import React from 'react';
4
4
  import UIMaxWidth from '../Layout/MaxWidth';
5
5
  import { ContentRenderer } from '@jetshop/ui/ContentRenderer';
6
-
7
- const Header = styled('h1')`
8
- font-size: 1.6875rem;
9
- font-weight: 600;
10
- margin: 1rem 0 3rem;
11
- `;
6
+ import {
7
+ MobileNavigation,
8
+ DesktopNavigation,
9
+ shouldDisplayNavigation
10
+ } from './SubPageNavigation';
11
+ import { css } from 'linaria';
12
+ import Breadcrumbs from '@jetshop/ui/Breadcrumbs';
12
13
 
13
14
  const Content = styled('div')`
14
15
  padding-bottom: 1rem;
@@ -18,8 +19,35 @@ const Content = styled('div')`
18
19
  }
19
20
  `;
20
21
 
21
- const MaxWidth = styled(UIMaxWidth)`
22
+ const container = css`
23
+ display: flex;
24
+ flex-direction: row;
25
+ `;
26
+
27
+ const sidebar = css`
28
+ max-width: 288px;
29
+ flex: 1 1 auto;
30
+ border-right: 1px solid #dedede;
31
+ margin-right: 2rem;
32
+ padding: 2rem 0;
33
+
34
+ @media (max-width: 799px) {
35
+ display: none;
36
+ }
37
+ `;
38
+
39
+ const content = css`
22
40
  max-width: 60rem;
41
+ flex: 1 1 auto;
42
+ padding: 2rem 0;
43
+
44
+ h1 {
45
+ margin-bottom: 1rem;
46
+ }
47
+ `;
48
+
49
+ const body = css`
50
+ margin-top: 1rem;
23
51
  `;
24
52
 
25
53
  const components = {
@@ -34,44 +62,47 @@ const components = {
34
62
  }
35
63
  };
36
64
 
37
- function ContentPage(props) {
38
- const { page } = props;
65
+ function ContentPage({ page, result }) {
39
66
  return (
40
- <>
41
- <Header>
42
- <MaxWidth>
67
+ <UIMaxWidth className={container}>
68
+ {page && shouldDisplayNavigation(page) && (
69
+ <aside className={sidebar}>
70
+ <DesktopNavigation page={page} />
71
+ </aside>
72
+ )}
73
+ <article className={content}>
74
+ <Breadcrumbs
75
+ parents={result.data?.route?.parents || []}
76
+ breadcrumbs={result.data?.route?.breadcrumbs || []}
77
+ />
78
+ <h1>
43
79
  {page ? page.name : <LoadingLine heightPx={27} widthRem={15} />}
44
- </MaxWidth>
45
- </Header>
46
- <MaxWidth>
47
- {page ? (
48
- <>
49
- {page.data ? (
80
+ </h1>
81
+ <MobileNavigation page={page} />
82
+ <div className={body}>
83
+ {page ? (
84
+ page.data ? (
50
85
  <ContentRenderer
51
86
  items={page.data.items}
52
87
  components={components}
53
88
  />
54
89
  ) : (
55
- <Content
56
- dangerouslySetInnerHTML={{
57
- __html: page.content
58
- }}
59
- />
60
- )}
61
- </>
62
- ) : (
63
- <LoadingLine
64
- heightPx={14}
65
- widthRem={30}
66
- randomizeWidthBy={10}
67
- count={10}
68
- style={{
69
- marginBottom: '12px'
70
- }}
71
- />
72
- )}
73
- </MaxWidth>
74
- </>
90
+ <Content dangerouslySetInnerHTML={{ __html: page.content }} />
91
+ )
92
+ ) : (
93
+ <LoadingLine
94
+ heightPx={14}
95
+ widthRem={30}
96
+ randomizeWidthBy={10}
97
+ count={10}
98
+ style={{
99
+ marginBottom: '12px'
100
+ }}
101
+ />
102
+ )}
103
+ </div>
104
+ </article>
105
+ </UIMaxWidth>
75
106
  );
76
107
  }
77
108
 
@@ -1,4 +1,8 @@
1
1
  fragment ContentPage on Page {
2
+ primaryRoute {
3
+ id
4
+ path
5
+ }
2
6
  name
3
7
  id
4
8
  content
@@ -20,4 +24,29 @@ fragment ContentPage on Page {
20
24
  }
21
25
  }
22
26
  }
27
+
28
+ parent {
29
+ id
30
+ name
31
+ primaryRoute {
32
+ id
33
+ path
34
+ }
35
+ subPages(includeHidden: false) {
36
+ ...SubPage
37
+ }
38
+ }
39
+
40
+ subPages(includeHidden: false) {
41
+ ...SubPage
42
+ }
43
+ }
44
+
45
+ fragment SubPage on Page {
46
+ id
47
+ name
48
+ primaryRoute {
49
+ id
50
+ path
51
+ }
23
52
  }
@@ -0,0 +1,206 @@
1
+ import {
2
+ DropdownMenu,
3
+ DropdownMenuButton,
4
+ DropdownMenuItem,
5
+ DropdownMenuItems
6
+ } from '@jetshop/ui/DropdownMenu';
7
+ import React from 'react';
8
+ import { Link } from 'react-router-dom';
9
+ import { ReactComponent as Carot } from '@jetshop/ui/svg/Carrot.svg';
10
+ import { css, cx } from 'linaria';
11
+ import { theme } from '../Theme';
12
+ import { useHistory, useLocation } from 'react-router';
13
+
14
+ const menu = css`
15
+ width: 100%;
16
+
17
+ @media (min-width: 50em) {
18
+ display: none;
19
+ }
20
+
21
+ [data-flight-dropdown-button] {
22
+ width: 100%;
23
+ display: flex;
24
+ flex-direction: row;
25
+ justify-content: space-between;
26
+ align-items: center;
27
+
28
+ padding: 0.75em;
29
+ border: 1px solid #dedede;
30
+ width: 100%;
31
+ text-align: left;
32
+ background: ${theme.colors.white};
33
+ border-radius: 3px;
34
+ outline: none;
35
+
36
+ :focus {
37
+ color: ${theme.colors.blue};
38
+ }
39
+
40
+ &[aria-expanded='true'] {
41
+ border-radius: 3px 3px 0 0;
42
+ border-bottom: 0;
43
+ color: ${theme.colors.blue};
44
+
45
+ .carot {
46
+ transform: rotate(180deg);
47
+ }
48
+ }
49
+ }
50
+
51
+ [data-flight-dropdown-items] {
52
+ position: absolute;
53
+ top: 100%;
54
+ left: 0;
55
+ background: white;
56
+ display: block;
57
+ z-index: 2;
58
+ outline: none;
59
+ width: 100%;
60
+ border: 1px solid #dedede;
61
+ border-top: 0;
62
+ }
63
+
64
+ [data-flight-dropdown-item] {
65
+ line-height: 1.5;
66
+ border: none;
67
+ cursor: pointer;
68
+ white-space: normal;
69
+ padding: 0.5em 1em;
70
+ :hover {
71
+ color: blue;
72
+ }
73
+ }
74
+
75
+ [data-flight-dropdown-item] a {
76
+ text-decoration: none;
77
+ color: #000;
78
+ }
79
+
80
+ [data-flight-dropdown-item]:focus {
81
+ font-weight: bold;
82
+ background: #f2f2f2;
83
+ outline: none;
84
+ position: relative;
85
+ }
86
+
87
+ [data-flight-dropdown-item]:focus:before {
88
+ content: '';
89
+ position: absolute;
90
+ top: 0;
91
+ bottom: 0;
92
+ left: 0;
93
+ width: 2px;
94
+ background-color: #2f80ed;
95
+ }
96
+ `;
97
+
98
+ const links = css`
99
+ display: flex;
100
+ flex-direction: column;
101
+ `;
102
+
103
+ const link = css`
104
+ color: #000;
105
+ text-decoration: none;
106
+ margin-bottom: 1rem;
107
+ line-height: 1.5;
108
+ `;
109
+
110
+ const activeLink = css`
111
+ font-weight: bold;
112
+ color: #2f80ed;
113
+ `;
114
+
115
+ function getNavigationItemFromPage(page, level) {
116
+ return {
117
+ id: page.id,
118
+ name: page.name,
119
+ url: page.primaryRoute?.path,
120
+ level
121
+ };
122
+ }
123
+
124
+ function Item({ name, url, level }) {
125
+ return (
126
+ <div style={{ marginLeft: `${(level - 1) * 12}px` }}>
127
+ <Link to={url}>{name}</Link>
128
+ </div>
129
+ );
130
+ }
131
+
132
+ function getNavigationItems(page) {
133
+ const parent = page.parent ? getNavigationItemFromPage(page.parent, 1) : null;
134
+ const siblings = page.parent
135
+ ? page.parent.subPages.map(subPage => getNavigationItemFromPage(subPage, 2))
136
+ : [];
137
+ const subPages = page.subPages
138
+ ? page.subPages.map(subPage =>
139
+ getNavigationItemFromPage(subPage, parent ? 3 : 2)
140
+ )
141
+ : [];
142
+ const currentPage = getNavigationItemFromPage(page, parent ? 2 : 1);
143
+
144
+ if (!parent && !subPages?.length) return [];
145
+
146
+ const items = [];
147
+
148
+ if (parent) items.push(parent);
149
+ if (siblings.length) {
150
+ siblings.forEach(page => {
151
+ items.push(page);
152
+ if (page.id === currentPage.id) {
153
+ items.push(...subPages);
154
+ }
155
+ });
156
+ } else {
157
+ items.push(currentPage, ...subPages);
158
+ }
159
+
160
+ return items;
161
+ }
162
+
163
+ export function shouldDisplayNavigation(page) {
164
+ return Boolean(page.parent || page.subPages?.length);
165
+ }
166
+
167
+ export function DesktopNavigation({ page }) {
168
+ const location = useLocation();
169
+ const items = getNavigationItems(page);
170
+
171
+ return (
172
+ <div className={links}>
173
+ {items.map(item => (
174
+ <Link
175
+ key={item.id}
176
+ to={item.url}
177
+ className={cx(link, location.pathname === item.url && activeLink)}
178
+ style={{ marginLeft: `${(item.level - 1) * 12}px` }}
179
+ >
180
+ {item.name}
181
+ </Link>
182
+ ))}
183
+ </div>
184
+ );
185
+ }
186
+
187
+ export function MobileNavigation({ page }) {
188
+ const { push } = useHistory();
189
+ const items = page ? getNavigationItems(page) : [];
190
+
191
+ return (
192
+ <DropdownMenu className={menu}>
193
+ <DropdownMenuButton>
194
+ <span>{page?.name}</span>
195
+ <Carot className="carot" />
196
+ </DropdownMenuButton>
197
+ <DropdownMenuItems>
198
+ {items.map(item => (
199
+ <DropdownMenuItem key={item.id} onSelect={() => push(item.url)}>
200
+ <Item {...item} />
201
+ </DropdownMenuItem>
202
+ ))}
203
+ </DropdownMenuItems>
204
+ </DropdownMenu>
205
+ );
206
+ }
@@ -7,9 +7,8 @@ import { useQuery } from '@apollo/react-hooks';
7
7
 
8
8
  function FooterLinks() {
9
9
  const { data } = useQuery(pagesQuery);
10
- const { data: storeTitleData, loading: storeTitleLoading } = useQuery(
11
- StoreTitleQuery
12
- );
10
+ const { data: storeTitleData, loading: storeTitleLoading } =
11
+ useQuery(StoreTitleQuery);
13
12
 
14
13
  const pages = data?.pages;
15
14
  const storeTitle = storeTitleData?.startPage?.head.title;
@@ -20,7 +19,10 @@ function FooterLinks() {
20
19
  <ul>
21
20
  {pages.map(page => (
22
21
  <li key={page.id}>
23
- <ContentPageLink page={page}>{page.name}</ContentPageLink>
22
+ <ContentPageLink page={page}>
23
+ {page.subPages?.length ? '+ ' : null}
24
+ {page.name}
25
+ </ContentPageLink>
24
26
  </li>
25
27
  ))}
26
28
  </ul>
@@ -6,5 +6,14 @@ query PagesQuery {
6
6
  id
7
7
  path
8
8
  }
9
+
10
+ subPages {
11
+ id
12
+ name
13
+ primaryRoute {
14
+ id
15
+ path
16
+ }
17
+ }
9
18
  }
10
19
  }
@@ -8,12 +8,7 @@ query AutocompleteQuery($term: String!) {
8
8
  id
9
9
  slug
10
10
  path
11
- parents {
12
- id
13
- object {
14
- breadcrumbText
15
- }
16
- }
11
+ breadcrumbs
17
12
  }
18
13
  }
19
14
  }
@@ -18,24 +18,6 @@ query ProductList($id: ID) {
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
-
39
21
  ## add
40
22
  mutation AddToProductList($id: ID, $items: [AddToCustomerProductListInput!]!) {
41
23
  addToCustomerProductList(id: $id, items: $items) {
@@ -54,13 +36,6 @@ mutation RemoveFromProductList($id: ID, $articleNumbers: [String!]) {
54
36
  }
55
37
  }
56
38
 
57
- ## delete product list
58
- mutation DeleteProductList($id: ID) {
59
- deleteCustomerProductList(id: $id) {
60
- success
61
- }
62
- }
63
-
64
39
  ## update
65
40
  mutation UpdateProductListItem($input: UpdateCustomerProductListItemInput!) {
66
41
  updateCustomerProductListItem(input: $input) {
@@ -1,9 +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 = {
4
- createList: ProductListQueries.CreateProductList,
5
- deleteList: ProductListQueries.DeleteProductList,
6
- all: ProductListQueries.ProductLists,
6
+ createList: mutations.CreateProductList,
7
+ deleteList: mutations.DeleteProductList,
8
+ all: queries.ProductLists,
7
9
  query: ProductListQueries.ProductList,
8
10
  productsQuery: ProductListQueries.ProductsFromProductList,
9
11
  add: ProductListQueries.AddToProductList,
@@ -143,9 +143,17 @@ const ProductToast = ({
143
143
  <ChannelContext.Consumer>
144
144
  {({ selectedChannel }) => (
145
145
  <CheckoutButton
146
- href={`${cart.externalCheckoutUrl}&channelCountry=${selectedChannel.country.code}`}
147
- onClick={() => {
148
- track(trackCartCheckoutEvent({ cart }));
146
+ href={cart.externalCheckoutUrl}
147
+ onClick={event => {
148
+ event.preventDefault();
149
+ track(
150
+ trackCartCheckoutEvent({
151
+ cart: cart,
152
+ callback: () => {
153
+ window.location = cart.externalCheckoutUrl;
154
+ }
155
+ })
156
+ );
149
157
  }}
150
158
  >
151
159
  {t('To checkout')}
@@ -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 aspect={'1:1'} images={images} galleryRef={galleryRef}>
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>
@@ -56,7 +56,7 @@ const ProductInfo = ({ product }) => {
56
56
  />
57
57
  </ProductSection>
58
58
  )}
59
- {product.customFields.length > 0 && (
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
- selectedVariant: selectedVariation,
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>
@@ -33,6 +33,7 @@ fragment ProductPage on Product {
33
33
  primaryRoute {
34
34
  path
35
35
  id
36
+ breadcrumbs
36
37
  }
37
38
  ...ProductPrice
38
39
  stockStatus {
@@ -207,21 +207,19 @@ const WarehouseStock = ({ product, variantHandler }) => {
207
207
 
208
208
  const WarehouseStockItem = ({ item, missingOptions, validation }) => {
209
209
  return (
210
- <>
211
- <WarehouseStockWrapper className="warehouse-stock-wrapper">
212
- <p className="stock-status-header">
213
- <span className="store-icon">
214
- <StoreIcon />
215
- </span>
216
- <span className="header-title">{t('Find product in store')}</span>
217
- </p>
218
- <WarehouseValidation
219
- validation={validation}
220
- missingOptions={missingOptions}
221
- item={item}
222
- ></WarehouseValidation>
223
- </WarehouseStockWrapper>
224
- </>
210
+ <WarehouseStockWrapper className="warehouse-stock-wrapper">
211
+ <p className="stock-status-header">
212
+ <span className="store-icon">
213
+ <StoreIcon />
214
+ </span>
215
+ <span className="header-title">{t('Find product in store')}</span>
216
+ </p>
217
+ <WarehouseValidation
218
+ validation={validation}
219
+ missingOptions={missingOptions}
220
+ item={item}
221
+ />
222
+ </WarehouseStockWrapper>
225
223
  );
226
224
  };
227
225
 
@@ -257,7 +255,7 @@ function WarehouseValidation({ validation, missingOptions, item }) {
257
255
  <WarehouseStockItemContent
258
256
  warehouse={warehouse}
259
257
  productVariant={productVariant}
260
- key-={warehouse.location?.id}
258
+ key={warehouse.location?.id}
261
259
  />
262
260
  ))}
263
261
  </ul>
@@ -295,7 +293,7 @@ const WarehouseStockItemContent = ({ warehouse, productVariant }) => {
295
293
  }
296
294
 
297
295
  return (
298
- <li key={warehouse.location?.id} className="warehouse-list-item">
296
+ <li className="warehouse-list-item">
299
297
  <div className="warehouse-name">
300
298
  <span>{warehouse.location?.name}</span>
301
299
  </div>
@@ -1,4 +1,4 @@
1
- #import "@jetshop/core/data/fragments/RouteCrumbFragment.gql"
1
+ #import "@jetshop/core/data/fragments/RouteMetaFragment.gql"
2
2
  #import "@jetshop/core/data/fragments/HeadFragment.gql"
3
3
  #import "./CategoryPage/CategoryPageFragment.gql"
4
4
  #import "./ContentPage/ContentPageFragment.gql"
@@ -12,7 +12,7 @@ query route(
12
12
  $filters: FilterInput
13
13
  ) {
14
14
  route(path: $path) {
15
- ...RouteCrumb
15
+ ...RouteMeta
16
16
  object {
17
17
  ...Head
18
18
  ...CategoryPage