@jetshop/template-trend 5.13.1 → 5.13.3

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.
@@ -3,7 +3,7 @@
3
3
  .ProductImageWrapper_p1i58doo{width:5rem;margin-right:1rem;}
4
4
  .ProductCheckoutContainer_pjx0jqi{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;height:100%;width:100%;}.ProductCheckoutContainer_pjx0jqi a{-webkit-text-decoration:none;text-decoration:none;}.ProductCheckoutContainer_pjx0jqi a:hover{opacity:0.8;-webkit-text-decoration:none;text-decoration:none;color:white;}
5
5
  .Product_p3e3eyv{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;margin:16px;}
6
- .ProductDetails_p41hym0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;color:black;}
6
+ .ProductDetails_p41hym0{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;color:black;}.ProductDetails_p41hym0 .price,.ProductDetails_p41hym0 .new-price{margin-top:0.75rem;}.ProductDetails_p41hym0 .old-price{margin-top:0.25rem;}.ProductDetails_p41hym0 .new-price{color:#EB0000;}
7
7
  .Header_hrfqnnj{font-size:16px;margin-bottom:8px;}
8
8
  .ProductName_p1jc6jl9{font-size:12px;}
9
9
  .Error_ednkb9d{color:red;margin-top:8px;font-size:12px;}
@@ -0,0 +1 @@
1
+ .Wrapper_wr5mleq{--innerFontSize:0.85rem;position:relative;}.Wrapper_wr5mleq .label{font-size:0.75rem;cursor:pointer;background:transparent;}.Wrapper_wr5mleq .price-table{position:absolute;padding:0.35rem 0.9rem;background:white;border:1px solid #e5e5e5;max-height:30rem;overflow:scroll;z-index:2;min-width:14rem;max-width:18rem;}.Wrapper_wr5mleq .price-table .label{font-size:var(--innerFontSize);}.Wrapper_wr5mleq .price-table li{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}.Wrapper_wr5mleq .price-table li .timestamp{font-size:var(--innerFontSize);}.Wrapper_wr5mleq .price-table li [data-flight-price=''] > .price{font-size:var(--innerFontSize);font-weight:normal;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetshop/template-trend",
3
- "version": "5.13.1",
3
+ "version": "5.13.3",
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.13.1",
48
+ "@jetshop/core": "^5.13.3",
49
49
  "@jetshop/flight-shortcodes": "^2.0.10",
50
- "@jetshop/intl": "^5.13.1",
51
- "@jetshop/react-scripts": "^5.13.1",
52
- "@jetshop/ui": "^5.13.1",
50
+ "@jetshop/intl": "^5.13.3",
51
+ "@jetshop/react-scripts": "^5.13.3",
52
+ "@jetshop/ui": "^5.13.3",
53
53
  "@react-google-maps/api": "~1.7.0",
54
54
  "prop-types": "^15.6.2",
55
55
  "react": "^16.9.0",
@@ -27,6 +27,7 @@ import WarehouseStock from '../StockStatus/WarehouseStock';
27
27
 
28
28
  import addToCartMutation from '../../Cart/queries/addToCart.gql';
29
29
  import CartQuery from '../../Cart/queries/cartQuery.gql';
30
+ import { PriceHistoryWrapper } from '../PriceHistory';
30
31
 
31
32
  const StyledForm = styled(Form)`
32
33
  display: flex;
@@ -140,6 +141,10 @@ function AddToCartForm({
140
141
  configurationContext && configurationContext.loading ? 0.3 : 1
141
142
  }}
142
143
  />
144
+ <PriceHistoryWrapper
145
+ articleNumber={product.articleNumber}
146
+ variant={variant}
147
+ />
143
148
 
144
149
  <Campaigns
145
150
  campaigns={product.campaigns}
@@ -67,6 +67,19 @@ const ProductDetails = styled('div')`
67
67
  flex-direction: column;
68
68
  flex-grow: 1;
69
69
  color: black;
70
+
71
+ .price,
72
+ .new-price {
73
+ margin-top: 0.75rem;
74
+ }
75
+
76
+ .old-price {
77
+ margin-top: 0.25rem;
78
+ }
79
+
80
+ .new-price {
81
+ color: ${theme.colors.red};
82
+ }
70
83
  `;
71
84
 
72
85
  const Header = styled('h3')`
@@ -0,0 +1,147 @@
1
+ import t from '@jetshop/intl';
2
+ import React, { useContext } from 'react';
3
+ import { useQuery } from '@apollo/react-hooks';
4
+ import PriceHistoryQuery from './PriceHistoryQuery.gql';
5
+ import { styled } from 'linaria/react';
6
+ import { Price } from '@jetshop/ui/Price';
7
+
8
+ import { FlyoutTrigger } from '@jetshop/ui/Modal/Flyout';
9
+ import { FlyoutTarget } from '@jetshop/ui/Modal/Flyout';
10
+ import ChannelContext from '@jetshop/core/components/ChannelContext/ChannelContext';
11
+
12
+ const Wrapper = styled.div`
13
+ --innerFontSize: 0.85rem;
14
+ position: relative;
15
+
16
+ .label {
17
+ font-size: 0.75rem;
18
+ cursor: pointer;
19
+ background: transparent;
20
+ }
21
+
22
+ .price-table {
23
+ position: absolute;
24
+ padding: 0.35rem 0.9rem;
25
+ background: white;
26
+ border: 1px solid #e5e5e5;
27
+ max-height: 30rem;
28
+ overflow: scroll;
29
+ z-index: 2;
30
+ min-width: 14rem;
31
+ max-width: 18rem;
32
+
33
+ .label {
34
+ font-size: var(--innerFontSize);
35
+ }
36
+
37
+ li {
38
+ display: flex;
39
+ justify-content: space-between;
40
+
41
+ .timestamp {
42
+ font-size: var(--innerFontSize);
43
+ }
44
+
45
+ [data-flight-price=''] {
46
+ > .price {
47
+ font-size: var(--innerFontSize);
48
+ font-weight: normal;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ `;
54
+
55
+ export function PriceHistoryWrapper(props) {
56
+ return (
57
+ <Wrapper>
58
+ <FlyoutTrigger
59
+ id="price-history-flyout"
60
+ coverStyles={{ zIndex: 0, background: 'transparent' }}
61
+ >
62
+ {({ isOpen, hideTarget, showTarget }) => (
63
+ <button
64
+ onClick={() => {
65
+ if (isOpen) {
66
+ hideTarget();
67
+ } else {
68
+ showTarget();
69
+ }
70
+ }}
71
+ className="label"
72
+ >
73
+ {t('View price history')}
74
+ </button>
75
+ )}
76
+ </FlyoutTrigger>
77
+ <FlyoutTarget id="price-history-flyout">
78
+ {() => <PriceHistory {...props} />}
79
+ </FlyoutTarget>
80
+ </Wrapper>
81
+ );
82
+ }
83
+
84
+ const days = 30;
85
+ function PriceHistory({ articleNumber, variant }) {
86
+ const { error, loading, data } = useQuery(PriceHistoryQuery, {
87
+ variables: { articleNumber, days },
88
+ errorPolicy: 'all',
89
+ skip: !articleNumber
90
+ });
91
+
92
+ if (loading || error) {
93
+ return (
94
+ <div className="price-table">
95
+ {loading && (
96
+ <span className="label">
97
+ {t('Getting the last { days } days price changes...', {
98
+ days
99
+ })}
100
+ </span>
101
+ )}
102
+ {error && <span className="label">{t('Something went wrong')}</span>}
103
+ </div>
104
+ );
105
+ }
106
+
107
+ const { product } = data;
108
+
109
+ if (!variant) {
110
+ return <Table history={product.history} days={days} />;
111
+ }
112
+
113
+ const selectedVariant = product.variants.values.find(
114
+ value => value.articleNumber === variant.articleNumber
115
+ );
116
+
117
+ return <Table history={selectedVariant.history} days={days} />;
118
+ }
119
+
120
+ const Table = ({ history, days }) => {
121
+ const { selectedChannel } = useContext(ChannelContext);
122
+
123
+ if (history?.length === 0) {
124
+ return (
125
+ <div className="price-table">
126
+ <span>{t('No recent price changes the last { days }', { days })}</span>
127
+ </div>
128
+ );
129
+ }
130
+
131
+ return (
132
+ <div className="price-table">
133
+ <ul>
134
+ {history.previousPrice.map(({ timestamp, price }) => (
135
+ <li key={timestamp}>
136
+ <span className="timestamp">
137
+ {new Date(timestamp).toLocaleDateString([
138
+ selectedChannel.language.culture
139
+ ])}
140
+ </span>
141
+ <Price price={price} as="span" />
142
+ </li>
143
+ ))}
144
+ </ul>
145
+ </div>
146
+ );
147
+ };
@@ -0,0 +1,32 @@
1
+ query ProductPriceHistory($articleNumber: String!, $days: Int!) {
2
+ product(articleNumber: $articleNumber) {
3
+ id
4
+ articleNumber
5
+ history(days: $days) {
6
+ previousPrice {
7
+ timestamp
8
+ price {
9
+ incVat
10
+ exVat
11
+ vat
12
+ }
13
+ }
14
+ }
15
+
16
+ variants {
17
+ values {
18
+ articleNumber
19
+ history(days: $days) {
20
+ previousPrice {
21
+ timestamp
22
+ price {
23
+ incVat
24
+ vat
25
+ exVat
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
@@ -41,6 +41,9 @@
41
41
  "cart_total_c0110f50": {
42
42
  "message": "Cart total"
43
43
  },
44
+ "categories_9d537a7a": {
45
+ "message": "Categories"
46
+ },
44
47
  "change_password_20192c50": {
45
48
  "message": "Change Password"
46
49
  },
@@ -197,6 +200,9 @@
197
200
  "free_shipping_and_return_355b42d1": {
198
201
  "message": "Free shipping and return"
199
202
  },
203
+ "getting_the_last_days_days_price_changes_bedecd5": {
204
+ "message": "Getting the last { days } days price changes..."
205
+ },
200
206
  "go_to_country_517a8515": {
201
207
  "message": "Go to { country }"
202
208
  },
@@ -215,6 +221,9 @@
215
221
  "hold_on_a_moment_a3f09a64": {
216
222
  "message": "Hold on a moment…"
217
223
  },
224
+ "home_351838cd": {
225
+ "message": "Home"
226
+ },
218
227
  "homepage_4b84763d": {
219
228
  "message": "HOMEPAGE"
220
229
  },
@@ -227,6 +236,9 @@
227
236
  "i_want_newsletters_58c52364": {
228
237
  "message": "I want newsletters"
229
238
  },
239
+ "image_not_found_2f99135": {
240
+ "message": "Image Not Found"
241
+ },
230
242
  "in_stock_859385c7": {
231
243
  "message": "In Stock"
232
244
  },
@@ -281,6 +293,9 @@
281
293
  "login_6f3d6249": {
282
294
  "message": "Login"
283
295
  },
296
+ "login_failed_please_try_again_841d7c15": {
297
+ "message": "Login failed. Please try again"
298
+ },
284
299
  "look_up_my_info_6436db80": {
285
300
  "message": "Look up my info"
286
301
  },
@@ -332,12 +347,21 @@
332
347
  "newsletters_a04708fd": {
333
348
  "message": "Newsletters"
334
349
  },
350
+ "next_40e12421": {
351
+ "message": "Next"
352
+ },
353
+ "no_e16d9132": {
354
+ "message": "No"
355
+ },
335
356
  "no_items_in_cart_cf9df6d4": {
336
357
  "message": "No items in cart."
337
358
  },
338
359
  "no_orders_found_ed613bce": {
339
360
  "message": "No orders found"
340
361
  },
362
+ "no_recent_price_changes_the_last_days_61d42dda": {
363
+ "message": "No recent price changes the last { days }"
364
+ },
341
365
  "no_results_for_term_7528ef47": {
342
366
  "message": "No results for <Term />"
343
367
  },
@@ -398,6 +422,9 @@
398
422
  "package_discount_66e25640": {
399
423
  "message": "Package Discount"
400
424
  },
425
+ "page_currentpage_of_totalpages_a773c744": {
426
+ "message": "Page { currentPage } of { totalPages }"
427
+ },
401
428
  "payment_method_84a444f1": {
402
429
  "message": "Payment method"
403
430
  },
@@ -431,9 +458,18 @@
431
458
  "postal_code_is_required_ca3b7a32": {
432
459
  "message": "Postal code is required."
433
460
  },
461
+ "powered_by_norce_f39c32c8": {
462
+ "message": "Powered by Norce"
463
+ },
464
+ "pre_order_date_86078d45": {
465
+ "message": "Pre-order date"
466
+ },
434
467
  "pre_order_date_is_required_170e38e0": {
435
468
  "message": "Pre-order date is required"
436
469
  },
470
+ "prev_f82cbc48": {
471
+ "message": "Prev"
472
+ },
437
473
  "price_ffd8b80": {
438
474
  "message": "Price"
439
475
  },
@@ -464,6 +500,9 @@
464
500
  "productname_has_been_added_to_the_cart_fba79585": {
465
501
  "message": "{ productName } has been added to the cart"
466
502
  },
503
+ "products_c5f0793": {
504
+ "message": "Products"
505
+ },
467
506
  "quantity_20164bff": {
468
507
  "message": "Quantity"
469
508
  },
@@ -512,6 +551,9 @@
512
551
  "select_options_9ee7b227": {
513
552
  "message": "Select options"
514
553
  },
554
+ "select_pre_order_date_8c8d72b7": {
555
+ "message": "Select pre-order date"
556
+ },
515
557
  "select_the_variants_b3aa2844": {
516
558
  "message": "Select the variants"
517
559
  },
@@ -683,6 +725,9 @@
683
725
  "view_password_ec63cb11": {
684
726
  "message": "View password"
685
727
  },
728
+ "view_price_history_8078c9af": {
729
+ "message": "View price history"
730
+ },
686
731
  "visit_product_page_to_add_54331147": {
687
732
  "message": "Visit product page to add"
688
733
  },
@@ -701,6 +746,9 @@
701
746
  "whoops_54a74974": {
702
747
  "message": "Whoops"
703
748
  },
749
+ "yes_dde87d5": {
750
+ "message": "Yes"
751
+ },
704
752
  "you_are_now_subscribed_71495f41": {
705
753
  "message": "You are now subscribed."
706
754
  },
@@ -772,5 +772,14 @@
772
772
  },
773
773
  "email_address_is_required_24d62494": {
774
774
  "message": "E-postadress är obligatoriskt."
775
+ },
776
+ "getting_the_last_days_days_price_changes_bedecd5": {
777
+ "message": "Hämtar de senaste { days } dagarnas prisändringar..."
778
+ },
779
+ "no_recent_price_changes_the_last_days_61d42dda": {
780
+ "message": "Hittade inte några prisförändringar senaste { days } dagarna"
781
+ },
782
+ "view_price_history_8078c9af": {
783
+ "message": "Visa prishistorik"
775
784
  }
776
785
  }
@@ -1,7 +0,0 @@
1
- .ScrollWrapper_s140peh{margin:0 -1.5rem;padding:0 1.5rem 3rem;}@media (max-width:49.99rem){.ScrollWrapper_s140peh{-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;}}@media (max-width:39.99rem){.ScrollWrapper_s140peh{margin:0 0;padding:0 1rem 3rem;}}
2
- .CategoriesWrapper_c1o22ktz{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_c1o22ktz:hover > a > div{opacity:0.8;}@media (max-width:49.99rem){.CategoriesWrapper_c1o22ktz > a{-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;width:160px;}}
3
- .CategoryCard_c11pqhux{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_c1l548id{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_c1l548id{width:33.33333333333333%;}}@media (min-width:64rem){.CardPaddingWrapper_c1l548id{width:20%;}}.CardPaddingWrapper_c1l548id:hover > div,.CardPaddingWrapper_c1l548id:focus > div,.CardPaddingWrapper_c1l548id: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_cmpnef6{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_cmpnef6{height:5rem;}}
6
- .CategoriesHeader_cmtbqnf{margin-bottom:1rem;font-size:24px;}@media (max-width:39.99rem){.CategoriesHeader_cmtbqnf{font-size:18px;margin-left:1rem;}}
7
-
@@ -1 +0,0 @@
1
- .preventBodyScrollStyle_p1lthaoa{overflow:hidden;}
@@ -1,11 +0,0 @@
1
- {
2
- "configurations": [
3
- {
4
- "type": "node-terminal",
5
- "name": "Run Script: start",
6
- "request": "launch",
7
- "command": "yarn run start",
8
- "cwd": "${workspaceFolder}"
9
- }
10
- ]
11
- }