@jetshop/template-trend 5.8.2 → 5.10.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/SearchPage/CategoryList.linaria.css +7 -0
- package/.linaria-cache/packages/ui/ChannelSelector/Region.linaria.css +3 -0
- package/cypress/integration/essentials.spec.js +50 -0
- package/package.json +5 -5
- package/schema.graphql +30 -18
- package/src/components/Auth/ForgotPassword.loadable.js +7 -0
- package/src/components/Auth/LogInPage.loadable.js +7 -0
- package/src/components/Auth/ResetPassword.loadable.js +7 -0
- package/src/components/Auth/Signup/SignUpPage.loadable.js +7 -0
- package/src/components/Cart/CartFragment.gql +8 -0
- package/src/components/CategoryPage/CategoryPage.loadable.js +7 -0
- package/src/components/CategoryPage/Filters/ListFilters.js +1 -2
- package/src/components/CategoryPage/ProductGridFragment.gql +8 -0
- package/src/components/CategoryPage/WindowedCategoryPage.js +6 -5
- package/src/components/ContentPage/ContentPage.loadable.js +7 -0
- package/src/components/Forms/Input.js +3 -6
- package/src/components/Layout/Header/RecommendedChannel/RecommendedChannelSelector.js +1 -1
- package/src/components/Layout/Header/TopNav.js +13 -11
- package/src/components/MyPages/MyPages.loadable.js +7 -0
- package/src/components/MyPages/MyPagesSidebar.js +0 -1
- package/src/components/NavigationTree/NavTreePage.loadable.js +7 -0
- package/src/components/NotFoundPage.loadable.js +7 -0
- package/src/components/ProductPage/AddToCart/ProductToast.js +1 -1
- package/src/components/ProductPage/ProductPage.loadable.js +7 -0
- package/src/components/SearchPage/SearchPage.loadable.js +7 -0
- package/src/components/Shop.js +26 -75
- package/src/components/StartPage/Content/Row.js +0 -37
- package/src/components/StartPage/StartPage.loadable.js +7 -0
- package/src/components/StartPage/StartPageProductGridFragment.gql +8 -0
- package/src/components/Store/Store.loadable.js +7 -0
- package/src/components/StoreLocator/StoreLocator.loadable.js +7 -0
- package/src/shop.config.js +8 -4
- package/.vscode/launch.json +0 -11
- 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 -90
- 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/.linaria-cache/packages/template-trend/src/components/SearchPage/CategoryList.linaria.css
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
.ScrollWrapper_sybdtro{margin:0 -1.5rem;padding:0 1.5rem 3rem;}@media (max-width:49.99rem){.ScrollWrapper_sybdtro{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}}@media (max-width:39.99rem){.ScrollWrapper_sybdtro{margin:0 0;padding:0 1rem 3rem;}}
|
|
2
|
+
.CategoriesWrapper_c1xlv6vs{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-right:-0.5rem;margin-left:-0.5rem;}.CategoriesWrapper_c1xlv6vs:hover > a > div{opacity:0.8;}@media (max-width:49.99rem){.CategoriesWrapper_c1xlv6vs > a{-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:160px;}}
|
|
3
|
+
.CategoryCard_c1p4xe4z{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:stretch;-webkit-justify-content:stretch;-ms-flex-pack:stretch;justify-content:stretch;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;background:#ffffff;box-shadow:4px 8px 32px rgba(0,0,0,0.1);-webkit-transition:all 250ms ease-in-out;transition:all 250ms ease-in-out;width:100%;height:100%;position:relative;}
|
|
4
|
+
.CardPaddingWrapper_c1r4522t{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:stretch;-webkit-justify-content:stretch;-ms-flex-pack:stretch;justify-content:stretch;width:50%;padding-left:0.5rem;padding-right:0.5rem;max-width:16rem;-webkit-text-decoration:none;text-decoration:none;}@media (min-width:50rem){.CardPaddingWrapper_c1r4522t{width:33.33333333333333%;}}@media (min-width:64rem){.CardPaddingWrapper_c1r4522t{width:20%;}}.CardPaddingWrapper_c1r4522t:hover > div,.CardPaddingWrapper_c1r4522t:focus > div,.CardPaddingWrapper_c1r4522t:active > div{opacity:1 !important;box-shadow:4px 8px 32px rgba(0,0,0,0.1), 4px 8px 40px rgba(0,0,0,0.1);-webkit-transform:translate(0,-2px);-ms-transform:translate(0,-2px);transform:translate(0,-2px);-webkit-transition-duration:100ms;transition-duration:100ms;z-index:2;}
|
|
5
|
+
.CategoryName_c1o377cd{text-align:center;font-weight:bold;font-size:16px;text-transform:uppercase;color:#000;-webkit-text-decoration:none;text-decoration:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;height:3rem;}@media (min-width:50rem){.CategoryName_c1o377cd{height:5rem;}}
|
|
6
|
+
.CategoriesHeader_czlhuxe{margin-bottom:1rem;font-size:24px;}@media (max-width:39.99rem){.CategoriesHeader_czlhuxe{font-size:18px;margin-left:1rem;}}
|
|
7
|
+
.CategoryListWrapper_c1ig1tri{padding:1rem 0;}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// This file contains essential tests to ensure that the basic purchase flow is working
|
|
2
|
+
// Make sure to update the URLs below to pages that are relevant to your shop
|
|
3
|
+
const CATEGORY_PAGE = '/se/sv/nyheter';
|
|
4
|
+
const PRODUCT_PAGE = '/se/sv/mobler/nice-chair';
|
|
5
|
+
|
|
6
|
+
describe('Start page', () => {
|
|
7
|
+
it('successfully loads', () => {
|
|
8
|
+
cy.visit('/');
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
describe('Category page', () => {
|
|
13
|
+
it('successfully loads', () => {
|
|
14
|
+
cy.visit(CATEGORY_PAGE);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('links to products', () => {
|
|
18
|
+
cy.visit(CATEGORY_PAGE);
|
|
19
|
+
const url = cy.url();
|
|
20
|
+
cy.findAllByTestId('product').first().click();
|
|
21
|
+
cy.url().should('not.be', url);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('Product page', () => {
|
|
26
|
+
it('successfully loads', () => {
|
|
27
|
+
cy.visit(PRODUCT_PAGE);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('lets you add to cart', () => {
|
|
31
|
+
cy.visit(PRODUCT_PAGE);
|
|
32
|
+
cy.findByTestId('add-to-cart').click();
|
|
33
|
+
// Cart now contains one item
|
|
34
|
+
cy.findByTestId('cart-button').next().contains('1');
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('Cart', () => {
|
|
39
|
+
it('can be successfully opened', () => {
|
|
40
|
+
cy.findByTestId('cart-button').click();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('lets you go to the checkout', () => {
|
|
44
|
+
cy.visit(PRODUCT_PAGE);
|
|
45
|
+
cy.findByTestId('add-to-cart').click();
|
|
46
|
+
cy.findByTestId('cart-button').click();
|
|
47
|
+
cy.findByTestId('checkout-button').click();
|
|
48
|
+
cy.url().should('contain', '/checkout');
|
|
49
|
+
});
|
|
50
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetshop/template-trend",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "react-scripts build",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@jetshop/core": "^5.
|
|
48
|
+
"@jetshop/core": "^5.10.0",
|
|
49
49
|
"@jetshop/flight-shortcodes": "^2.0.10",
|
|
50
|
-
"@jetshop/intl": "^5.
|
|
51
|
-
"@jetshop/react-scripts": "^5.
|
|
52
|
-
"@jetshop/ui": "^5.
|
|
50
|
+
"@jetshop/intl": "^5.10.0",
|
|
51
|
+
"@jetshop/react-scripts": "^5.10.0",
|
|
52
|
+
"@jetshop/ui": "^5.10.0",
|
|
53
53
|
"@react-google-maps/api": "~1.7.0",
|
|
54
54
|
"prop-types": "^15.6.2",
|
|
55
55
|
"react": "^16.9.0",
|
package/schema.graphql
CHANGED
|
@@ -1043,10 +1043,17 @@ type Mutation {
|
|
|
1043
1043
|
|
|
1044
1044
|
"""
|
|
1045
1045
|
This mutation's purpose is to update a existing customer's information. An
|
|
1046
|
-
authorization token is needed in the request, in order to be able to
|
|
1046
|
+
authorization token is needed in the request, in order to be able to update the customer.
|
|
1047
1047
|
"""
|
|
1048
1048
|
updateCustomer(input: CustomerUpdateInput!): CustomerUpdateResponse
|
|
1049
1049
|
|
|
1050
|
+
"""
|
|
1051
|
+
This mutation's purpose is to update a existing customer's price list using an
|
|
1052
|
+
access code. An authorization token is needed in the request, in order to be
|
|
1053
|
+
able to update the customer.
|
|
1054
|
+
"""
|
|
1055
|
+
updateCustomerPriceList(priceListAccessCode: String!): UpdateCustomerPriceListResult
|
|
1056
|
+
|
|
1050
1057
|
"""
|
|
1051
1058
|
The updatePassword mutation updates the customers password. Both the old password and a new password is a requirement.
|
|
1052
1059
|
"""
|
|
@@ -1314,18 +1321,19 @@ type Page implements Document {
|
|
|
1314
1321
|
data: Content
|
|
1315
1322
|
|
|
1316
1323
|
"""
|
|
1317
|
-
If this page was fetched by ID using the `page(id)` query, parent will be
|
|
1318
|
-
|
|
1319
|
-
query, parent will not be returned if it is hidden
|
|
1324
|
+
* If this page was fetched by ID using the `page(id)` query, `parent` will be returned even if it is hidden.
|
|
1325
|
+
* If this page was fetched using the `pages` query, `parent` will not be returned if it is hidden
|
|
1320
1326
|
"""
|
|
1321
1327
|
parent: Page
|
|
1322
1328
|
|
|
1323
1329
|
"""
|
|
1324
|
-
If this page was fetched by ID using the page(id) query, subPages will
|
|
1325
|
-
returned even if they are hidden.
|
|
1326
|
-
|
|
1330
|
+
* If this page was fetched by ID using the `page(id)` query, `subPages` will
|
|
1331
|
+
be returned even if they are hidden. This can be overridden with the
|
|
1332
|
+
`includeHidden` flag.
|
|
1333
|
+
* If this page was fetched using the `pages` query, `subPages` will not be
|
|
1334
|
+
returned if they are hidden. The `includeHidden` flag has no effect on this.
|
|
1327
1335
|
"""
|
|
1328
|
-
subPages: [Page!]
|
|
1336
|
+
subPages(includeHidden: Boolean = true): [Page!]
|
|
1329
1337
|
}
|
|
1330
1338
|
|
|
1331
1339
|
type PagedResult {
|
|
@@ -1450,6 +1458,7 @@ type Product implements Document {
|
|
|
1450
1458
|
"""
|
|
1451
1459
|
campaigns: [Category]
|
|
1452
1460
|
hasVariants: Boolean!
|
|
1461
|
+
hasVariantsWithDifferingPrices: Boolean!
|
|
1453
1462
|
variants: ProductVariants
|
|
1454
1463
|
images(
|
|
1455
1464
|
"""
|
|
@@ -1507,9 +1516,7 @@ type Product implements Document {
|
|
|
1507
1516
|
|
|
1508
1517
|
"""
|
|
1509
1518
|
Specifies input field(s) for the Customer to populate on the Product that will then carry through to the Order.
|
|
1510
|
-
If 'required' is true the Product should not be purchasable
|
|
1511
|
-
until the field is populated.NB: Carries a performance cost, as asking for
|
|
1512
|
-
this will result in a separate API call in the backend.
|
|
1519
|
+
If 'required' is true the Product should not be purchasable until the field is populated.
|
|
1513
1520
|
"""
|
|
1514
1521
|
customerComments: [ProductComment]
|
|
1515
1522
|
|
|
@@ -1523,10 +1530,6 @@ type Product implements Document {
|
|
|
1523
1530
|
NB: Carries a performance cost, as asking for this will result in a separate API call in the backend.
|
|
1524
1531
|
"""
|
|
1525
1532
|
warehouseStock(includeInactive: Boolean = false): [Warehouse]
|
|
1526
|
-
|
|
1527
|
-
"""
|
|
1528
|
-
NB: Carries a performance cost, as asking for this will result in a separate API call in the backend.
|
|
1529
|
-
"""
|
|
1530
1533
|
head: HtmlHead
|
|
1531
1534
|
|
|
1532
1535
|
"""
|
|
@@ -1563,9 +1566,7 @@ type Product implements Document {
|
|
|
1563
1566
|
"""
|
|
1564
1567
|
configurationPrice(options: [ProductConfigurationPriceInput!]): ProductConfigurationPrice
|
|
1565
1568
|
|
|
1566
|
-
"""
|
|
1567
|
-
NB: Carries a performance cost, as asking for this will result in a separate API call in the backend.
|
|
1568
|
-
"""
|
|
1569
|
+
"""Quantity suffix e.g pcs, box, etc."""
|
|
1569
1570
|
quantitySuffix: String
|
|
1570
1571
|
isPreOrder: Boolean
|
|
1571
1572
|
preOrder: ProductPreOrder
|
|
@@ -1946,6 +1947,12 @@ type Route {
|
|
|
1946
1947
|
another language.NB: Carries no additional performance cost.
|
|
1947
1948
|
"""
|
|
1948
1949
|
alternateRoutes: [AlternateRoute]
|
|
1950
|
+
|
|
1951
|
+
"""N.B. for troubleshooting routes only!"""
|
|
1952
|
+
debug: String
|
|
1953
|
+
|
|
1954
|
+
"""Breadcrumb texts; starting with the root parent, ending on this route."""
|
|
1955
|
+
breadcrumbs: [String]
|
|
1949
1956
|
}
|
|
1950
1957
|
|
|
1951
1958
|
type SearchAutoCompleteResult {
|
|
@@ -2051,6 +2058,7 @@ input SignUpInput {
|
|
|
2051
2058
|
preferences: SignUpPreferencesInput
|
|
2052
2059
|
consents: [SignUpConsentInput]
|
|
2053
2060
|
dynamicContent: String
|
|
2061
|
+
priceListAccessCode: String
|
|
2054
2062
|
}
|
|
2055
2063
|
|
|
2056
2064
|
input SignUpPreferencesCommunicationInput {
|
|
@@ -2183,6 +2191,10 @@ type UpdateCartMutation {
|
|
|
2183
2191
|
cart: Cart
|
|
2184
2192
|
}
|
|
2185
2193
|
|
|
2194
|
+
type UpdateCustomerPriceListResult {
|
|
2195
|
+
success: Boolean!
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2186
2198
|
input UpdateCustomerProductListInput {
|
|
2187
2199
|
id: ID!
|
|
2188
2200
|
typeId: ID!
|
|
@@ -47,9 +47,10 @@ const WindowedCategory = ({ category, result }) => {
|
|
|
47
47
|
const location = useLocation();
|
|
48
48
|
const params = qs.parse(location.search, { ignoreQueryPrefix: true });
|
|
49
49
|
const routePath = category?.isDynamic ? null : result?.data?.route?.path;
|
|
50
|
-
const categoryPath = useMemo(
|
|
51
|
-
routePath
|
|
52
|
-
|
|
50
|
+
const categoryPath = useMemo(
|
|
51
|
+
() => routePath && { path: routePath },
|
|
52
|
+
[routePath]
|
|
53
|
+
);
|
|
53
54
|
|
|
54
55
|
if (!category) {
|
|
55
56
|
return (
|
|
@@ -106,7 +107,7 @@ const WindowedCategory = ({ category, result }) => {
|
|
|
106
107
|
{previous.hasProducts && (
|
|
107
108
|
<ButtonWrapper>
|
|
108
109
|
<TrendLink
|
|
109
|
-
secondary
|
|
110
|
+
className="secondary"
|
|
110
111
|
onClick={e => {
|
|
111
112
|
e.preventDefault();
|
|
112
113
|
previous.fetchProducts();
|
|
@@ -135,7 +136,7 @@ const WindowedCategory = ({ category, result }) => {
|
|
|
135
136
|
{next.hasProducts && (
|
|
136
137
|
<ButtonWrapper>
|
|
137
138
|
<TrendLink
|
|
138
|
-
secondary
|
|
139
|
+
className="secondary"
|
|
139
140
|
onClick={e => {
|
|
140
141
|
e.preventDefault();
|
|
141
142
|
next.fetchProducts();
|
|
@@ -71,11 +71,8 @@ const InputWithLabel = ({
|
|
|
71
71
|
<span>{label || name}</span>
|
|
72
72
|
{required && <span className="req">{t('(Required)')}</span>}
|
|
73
73
|
</Label>
|
|
74
|
-
<Field
|
|
75
|
-
|
|
76
|
-
id={name}
|
|
77
|
-
name={name}
|
|
78
|
-
render={({ field, form: { touched, errors } }) => (
|
|
74
|
+
<Field className={cx(disabled && 'disabled')} id={name} name={name}>
|
|
75
|
+
{({ field, form: { touched, errors } }) => (
|
|
79
76
|
<div>
|
|
80
77
|
<Input
|
|
81
78
|
{...props}
|
|
@@ -104,7 +101,7 @@ const InputWithLabel = ({
|
|
|
104
101
|
)}
|
|
105
102
|
</div>
|
|
106
103
|
)}
|
|
107
|
-
|
|
104
|
+
</Field>
|
|
108
105
|
{!disableValidation && <ErrorMessage name={name} component={ErrorSpan} />}
|
|
109
106
|
</Wrapper>
|
|
110
107
|
);
|
|
@@ -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
|
+
}
|
|
@@ -8,7 +8,7 @@ import { Price } from '@jetshop/ui/Price';
|
|
|
8
8
|
import { theme } from '../../Theme';
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { styled } from 'linaria/react';
|
|
11
|
-
import {
|
|
11
|
+
import { baseStyles } from '../../ui/Button';
|
|
12
12
|
import cartQuery from '../../Cart/CartQuery.gql';
|
|
13
13
|
|
|
14
14
|
const Container = styled('aside')`
|
package/src/components/Shop.js
CHANGED
|
@@ -27,22 +27,20 @@ import routeQuery from './RouteQuery.gql';
|
|
|
27
27
|
import { theme } from './Theme';
|
|
28
28
|
import '../globalStyles';
|
|
29
29
|
import CookieConsent from './CookieConsent';
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
fallback: <LoadingPage />
|
|
45
|
-
});
|
|
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
|
+
import ProductPage from './ProductPage/ProductPage.loadable';
|
|
37
|
+
import CategoryPage from './CategoryPage/CategoryPage.loadable';
|
|
38
|
+
import ContentPage from './ContentPage/ContentPage.loadable';
|
|
39
|
+
import SearchPage from './SearchPage/SearchPage.loadable';
|
|
40
|
+
import SignUpPage from './Auth/Signup/SignUpPage.loadable';
|
|
41
|
+
import ForgotPassword from './Auth/ForgotPassword.loadable';
|
|
42
|
+
import ResetPassword from './Auth/ResetPassword.loadable';
|
|
43
|
+
import MyPages from './MyPages/MyPages.loadable';
|
|
46
44
|
|
|
47
45
|
const LogOutPage = loadable(
|
|
48
46
|
() => import('@jetshop/core/components/AuthContext/LogOut'),
|
|
@@ -58,53 +56,6 @@ const PreviewRoute = loadable(
|
|
|
58
56
|
}
|
|
59
57
|
);
|
|
60
58
|
|
|
61
|
-
const NavTreePage = loadable(() => import('./NavigationTree/NavTreePage'), {
|
|
62
|
-
fallback: <LoadingPage />
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const LoadableStartPage = loadable(() => import('./StartPage/StartPage'), {
|
|
66
|
-
fallback: <LoadingPage />
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
export const LoadableProductPage = loadable(
|
|
70
|
-
() => import('./ProductPage/ProductPage'),
|
|
71
|
-
{
|
|
72
|
-
fallback: <LoadingPage />
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
export const LoadableCategoryPage = loadable(
|
|
77
|
-
() => import('./CategoryPage/CategoryPage'),
|
|
78
|
-
{
|
|
79
|
-
fallback: <LoadingPage />
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
export const LoadableContentPage = loadable(
|
|
84
|
-
() => import('./ContentPage/ContentPage'),
|
|
85
|
-
{
|
|
86
|
-
fallback: <LoadingPage />
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
const LoadableSearchPage = loadable(() => import('./SearchPage/SearchPage'), {
|
|
91
|
-
fallback: <LoadingPage />
|
|
92
|
-
});
|
|
93
|
-
const LoadableSignUpPage = loadable(() => import('./Auth/Signup/SignUpPage'), {
|
|
94
|
-
fallback: <LoadingPage />
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
const ForgotPassword = loadable(() => import('./Auth/ForgotPassword'), {
|
|
98
|
-
fallback: <LoadingPage />
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
const ResetPassword = loadable(() => import('./Auth/ResetPassword'), {
|
|
102
|
-
fallback: <LoadingPage />
|
|
103
|
-
});
|
|
104
|
-
const LoadableMyPages = loadable(() => import('./MyPages/MyPages'), {
|
|
105
|
-
fallback: <LoadingPage />
|
|
106
|
-
});
|
|
107
|
-
|
|
108
59
|
function Shop() {
|
|
109
60
|
const { routes } = useShopConfig();
|
|
110
61
|
return (
|
|
@@ -126,16 +77,16 @@ function Shop() {
|
|
|
126
77
|
<PaginationProvider defaultProductsPerPage={24}>
|
|
127
78
|
<Switch>
|
|
128
79
|
<Route exact path="/">
|
|
129
|
-
<
|
|
80
|
+
<StartPage />
|
|
130
81
|
</Route>
|
|
131
82
|
<Route path="/favourites">
|
|
132
83
|
<Favourites />
|
|
133
84
|
</Route>
|
|
134
85
|
<Route path={routes.search.path}>
|
|
135
|
-
<
|
|
86
|
+
<SearchPage />
|
|
136
87
|
</Route>
|
|
137
88
|
<Route path={routes.signup.path}>
|
|
138
|
-
<
|
|
89
|
+
<SignUpPage />
|
|
139
90
|
</Route>
|
|
140
91
|
<Route path={routes.login.path}>
|
|
141
92
|
<LogInPage />
|
|
@@ -153,7 +104,7 @@ function Shop() {
|
|
|
153
104
|
<NavTreePage />
|
|
154
105
|
</Route>
|
|
155
106
|
<Route path={routes.myPages.path}>
|
|
156
|
-
<
|
|
107
|
+
<MyPages />
|
|
157
108
|
</Route>
|
|
158
109
|
<Route exact path={routes.forgotPassword.path}>
|
|
159
110
|
<ForgotPassword />
|
|
@@ -168,20 +119,20 @@ function Shop() {
|
|
|
168
119
|
productQuery={ProductPreviewQuery}
|
|
169
120
|
categoryQuery={CategoryPreviewQuery}
|
|
170
121
|
pageQuery={PagePreviewQuery}
|
|
171
|
-
productPage={
|
|
172
|
-
categoryPage={
|
|
173
|
-
contentPage={
|
|
174
|
-
StartPage={
|
|
122
|
+
productPage={ProductPage}
|
|
123
|
+
categoryPage={CategoryPage}
|
|
124
|
+
contentPage={ContentPage}
|
|
125
|
+
StartPage={StartPage}
|
|
175
126
|
{...props}
|
|
176
127
|
/>
|
|
177
128
|
)}
|
|
178
129
|
/>
|
|
179
130
|
<DynamicRoute
|
|
180
131
|
routeQuery={routeQuery}
|
|
181
|
-
productPage={
|
|
182
|
-
categoryPage={
|
|
183
|
-
contentPage={
|
|
184
|
-
notFoundPage={
|
|
132
|
+
productPage={ProductPage}
|
|
133
|
+
categoryPage={CategoryPage}
|
|
134
|
+
contentPage={ContentPage}
|
|
135
|
+
notFoundPage={NotFoundPage}
|
|
185
136
|
LoadingPage={LoadingPage}
|
|
186
137
|
/>
|
|
187
138
|
</Switch>
|
|
@@ -2,9 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import MaxWidth from '../../Layout/MaxWidth';
|
|
3
3
|
import { styled } from 'linaria/react';
|
|
4
4
|
import { theme } from '../../Theme';
|
|
5
|
-
import { ReactComponent as Caret } from '@jetshop/ui/svg/Carrot.svg';
|
|
6
|
-
import { Above } from '@jetshop/ui/Breakpoints';
|
|
7
|
-
import { useAnimation, swipeEffect } from '@jetshop/ui/hooks';
|
|
8
5
|
|
|
9
6
|
const Container = styled('div')`
|
|
10
7
|
position: relative;
|
|
@@ -37,40 +34,6 @@ const ItemsContainer = styled('div')`
|
|
|
37
34
|
}
|
|
38
35
|
`;
|
|
39
36
|
|
|
40
|
-
const Button = styled('button')`
|
|
41
|
-
position: absolute;
|
|
42
|
-
font-family: initial;
|
|
43
|
-
margin: 0 10px;
|
|
44
|
-
top: 50%;
|
|
45
|
-
transform: translateY(-50%);
|
|
46
|
-
z-index: 2;
|
|
47
|
-
width: 40px;
|
|
48
|
-
height: 40px;
|
|
49
|
-
border-radius: 50%;
|
|
50
|
-
background: rgba(255, 255, 255, 0.2);
|
|
51
|
-
|
|
52
|
-
&:focus,
|
|
53
|
-
&:active {
|
|
54
|
-
outline: none;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
background: rgba(255, 255, 255, 0.6);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&.left svg {
|
|
62
|
-
transform: rotateZ(90deg);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.right {
|
|
66
|
-
right: 0;
|
|
67
|
-
|
|
68
|
-
svg {
|
|
69
|
-
transform: rotateZ(-90deg);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
37
|
const Row = ({ header, children }) => {
|
|
75
38
|
return (
|
|
76
39
|
<MaxWidth>
|