@licklist/design 0.57.0 → 0.58.0-dev.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/dist/auth/Login/LoginComponent.d.ts.map +1 -1
- package/dist/auth/Login/LoginComponent.js +1 -1
- package/dist/calendar/Calendar.d.ts +3 -8
- package/dist/calendar/Calendar.d.ts.map +1 -1
- package/dist/calendar/Calendar.js +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts +2 -2
- package/dist/calendar/components/CalendarButtons/CalendarButtons.d.ts.map +1 -1
- package/dist/calendar/components/CalendarButtons/CalendarButtons.js +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts +2 -2
- package/dist/calendar/components/CalendarDates/CalendarDates.d.ts.map +1 -1
- package/dist/calendar/components/CalendarDates/CalendarDates.js +1 -1
- package/dist/calendar/utils/index.d.ts +0 -2
- package/dist/calendar/utils/index.d.ts.map +1 -1
- package/dist/calendar/utils/index.js +1 -1
- package/dist/date-time-button/DateTimeButton.d.ts +3 -3
- package/dist/date-time-button/DateTimeButton.d.ts.map +1 -1
- package/dist/events/event-venue-map/components/Scrollbars/Scrollbars.js +1 -1
- package/dist/iframe/order-process/components/BookingSummary/components/ToggleHeader/ToggleHeader.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.d.ts.map +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/CategoryProduct.js +1 -1
- package/dist/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.js +1 -1
- package/dist/index.js +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.d.ts.map +1 -1
- package/dist/notification/email-template/control/EmailTemplateControl.js +1 -1
- package/dist/sales/booking/results/components/ResultCard.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts +2 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.d.ts.map +1 -1
- package/dist/sales/manual-booking/summary/ManualBookingSummary.js +1 -1
- package/dist/snippet/snippet-template/preview/Preview.d.ts.map +1 -1
- package/dist/snippet/snippet-template/preview/Preview.js +1 -1
- package/dist/static/date-range-input/DateRangeInput.d.ts.map +1 -1
- package/dist/static/date-range-input/DateRangeInput.js +1 -1
- package/dist/styles/resources-blocking/_index.scss +6 -0
- package/dist/styles/sales/BookingFilter.scss +24 -2
- package/dist/styles/sales/BookingResults.scss +1 -1
- package/dist/styles/sales/BookingTabs.scss +63 -5
- package/dist/styles/sales/LifeTimeSales.scss +1 -0
- package/dist/styles/sales/ManualBooking.scss +62 -3
- package/dist/styles/sales/SourceOfSales.scss +3 -0
- package/dist/styles/snippet-templates/SnippetTemplateCard.scss +3 -2
- package/dist/styles/static/Tabs.scss +6 -0
- package/dist/styles/themes/bookedit/_index.scss +9 -8
- package/dist/styles/themes/bookedit/_variables.scss +2 -0
- package/package.json +5 -1
- package/src/auth/Login/LoginComponent.tsx +9 -1
- package/src/calendar/Calendar.tsx +9 -16
- package/src/calendar/components/CalendarButtons/CalendarButtons.tsx +8 -5
- package/src/calendar/components/CalendarDates/CalendarDates.tsx +12 -13
- package/src/calendar/utils/index.ts +0 -19
- package/src/date-time-button/DateTimeButton.tsx +3 -3
- package/src/iframe/order-process/components/CategoryProduct/CategoryProduct.tsx +5 -2
- package/src/iframe/order-process/components/CategoryProduct/components/ProductQuantityInput/ProductQuantityInput.tsx +1 -1
- package/src/notification/email-template/control/EmailTemplateControl.tsx +5 -15
- package/src/sales/booking/results/components/ResultCard.tsx +0 -3
- package/src/sales/manual-booking/summary/ManualBookingSummary.tsx +9 -1
- package/src/snippet/snippet-template/preview/Preview.tsx +3 -0
- package/src/static/date-range-input/DateRangeInput.tsx +23 -2
- package/src/static/switch/BooleanSwitch.tsx +1 -1
- package/src/styles/resources-blocking/_index.scss +6 -0
- package/src/styles/sales/BookingFilter.scss +24 -2
- package/src/styles/sales/BookingResults.scss +1 -1
- package/src/styles/sales/BookingTabs.scss +63 -5
- package/src/styles/sales/LifeTimeSales.scss +1 -0
- package/src/styles/sales/ManualBooking.scss +62 -3
- package/src/styles/sales/SourceOfSales.scss +3 -0
- package/src/styles/snippet-templates/SnippetTemplateCard.scss +3 -2
- package/src/styles/static/Tabs.scss +6 -0
- package/src/styles/themes/bookedit/_index.scss +9 -8
- package/src/styles/themes/bookedit/_variables.scss +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("tslib"),n=require("react"),r=(e=n)&&"object"==typeof e&&"default"in e?e.default:e,a=require("react-i18next"),i=require("react-bootstrap"),s=require("../Icon.js"),o=require("@react-aria/utils"),u=require("react-date-range"),c=require("react-use"),l=require("./utils/index.js"),d=require("../../iframe/order-process/components/BookingSummary/types/index.js");require("react-date-range/dist/styles.css"),require("react-date-range/dist/theme/default.css"),require("../index.js");var m={name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;Object.assign(t.styles.popper,{marginLeft:"-2px",maxWidth:"unset"})},effect:function(e){var t=e.state;Object.assign(t.elements.popper.style,{maxWidth:"unset"})}};exports.DateRangeInput=function(e){var f=e.placeholder,p=e.startDate,g=e.endDate,D=e.onDateChange,v=e.months,h=void 0===v?2:v,y=e.disabled,_=a.useTranslation("Design").t,E=t.__read(n.useState("horizontal"),2),w=E[0],q=E[1],b=t.__read(n.useState([{startDate:new Date,endDate:new Date,key:"selection"}]),2),x=b[0],j=b[1],k=t.__read(n.useState(!1),2),C=k[0],S=k[1],I=o.useId(),N=n.useRef();c.useClickAway(N,(function(){return S(!1)}));return n.useEffect((function(){p&&g&&j((function(e){return[t.__assign(t.__assign({},e[0]),l.stringDatesToJSDates({startDate:p,endDate:g}))]}))}),[p,g]),n.useEffect((function(){var e=function(){window.innerWidth>d.MOBILE_WIDTH?q("horizontal"):q("vertical")};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),r.createElement("div",null,r.createElement(i.OverlayTrigger,{show:C,overlay:r.createElement(i.Popover,{id:I,className:"rounded"},r.createElement(i.Popover.Content,{className:"shadow-lg rounded",ref:N},r.createElement(u.DateRange,{onChange:function(e){return j([e.selection])},moveRangeOnFirstSelection:!1,ranges:x,months:h,direction:w}),r.createElement("div",{className:"mt-3 d-flex justify-content-end"},r.createElement(i.Button,{onClick:function(){D&&D({}),j((function(e){return[t.__assign(t.__assign({},e[0]),{startDate:new Date,endDate:new Date})]})),S(!1)},variant:"link"},_("clear")),r.createElement(i.Button,{onClick:function(){D&&D(l.rangeDatesToStringDates(x)),S(!1)},className:"ml-3",variant:"link"},_("apply"))))),trigger:"click",placement:"bottom",popperConfig:{modifiers:[m]}},r.createElement("div",{onClick:function(){return S((function(e){return!e}))},onKeyDown:function(){return S((function(e){return!e}))},role:"button",tabIndex:0,className:"date-range-input-wrapper"},r.createElement(i.Form.Control,{type:"input",placeholder:f,disabled:y,readOnly:!0,className:"date-range-input",value:l.stringDatesToInputValue({startDate:p,endDate:g})}),r.createElement(s.default,{type:"calendar",height:"1rem",className:"date-range-input-icon"}))))};
|
|
@@ -157,6 +157,19 @@
|
|
|
157
157
|
margin-bottom: 0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
|
|
161
|
+
.apply-container{
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: space-around;
|
|
164
|
+
column-gap: 2rem;
|
|
165
|
+
margin-left: 3rem;
|
|
166
|
+
|
|
167
|
+
@include media-breakpoint-down(sm) {
|
|
168
|
+
flex-direction: row;
|
|
169
|
+
margin-left: 0rem;
|
|
170
|
+
column-gap: 1rem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
160
173
|
}
|
|
161
174
|
|
|
162
175
|
.additional-filter-container {
|
|
@@ -175,8 +188,12 @@
|
|
|
175
188
|
}
|
|
176
189
|
}
|
|
177
190
|
|
|
178
|
-
@include media-breakpoint-
|
|
179
|
-
flex-wrap:
|
|
191
|
+
@include media-breakpoint-down(xl) {
|
|
192
|
+
flex-wrap: wrap;
|
|
193
|
+
|
|
194
|
+
.apply-container {
|
|
195
|
+
margin-left: 4rem;
|
|
196
|
+
}
|
|
180
197
|
|
|
181
198
|
.date-container {
|
|
182
199
|
width: auto;
|
|
@@ -230,6 +247,11 @@
|
|
|
230
247
|
transform: rotate(45deg);
|
|
231
248
|
}
|
|
232
249
|
}
|
|
250
|
+
|
|
251
|
+
@include media-breakpoint-down(sm) {
|
|
252
|
+
flex-direction: column;
|
|
253
|
+
justify-content: flex-start;
|
|
254
|
+
}
|
|
233
255
|
}
|
|
234
256
|
}
|
|
235
257
|
}
|
|
@@ -1,24 +1,49 @@
|
|
|
1
1
|
.booking-tabs-pane {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: row;
|
|
4
|
+
justify-content: space-between;
|
|
4
5
|
align-items: center;
|
|
5
6
|
height: 2.75rem;
|
|
6
7
|
background-color: $white;
|
|
7
8
|
|
|
8
9
|
.booking-tabs {
|
|
9
10
|
svg {
|
|
10
|
-
g
|
|
11
|
-
fill: $white;
|
|
11
|
+
g>rect:first-child {
|
|
12
|
+
fill: $white;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
|
|
15
16
|
.active {
|
|
16
17
|
svg {
|
|
17
|
-
g
|
|
18
|
-
fill: $blue;
|
|
18
|
+
g>rect:first-child {
|
|
19
|
+
fill: $blue;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
@include media-breakpoint-down(sm) {
|
|
25
|
+
width: 4rem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.content {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 85%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
|
|
35
|
+
@include media-breakpoint-down(sm) {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: start;
|
|
39
|
+
height: 4rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.booking {
|
|
43
|
+
@include media-breakpoint-down(sm) {
|
|
44
|
+
height: 13rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
22
47
|
}
|
|
23
48
|
|
|
24
49
|
.separator {
|
|
@@ -29,6 +54,12 @@
|
|
|
29
54
|
.children {
|
|
30
55
|
flex: 1;
|
|
31
56
|
margin-left: 1rem;
|
|
57
|
+
|
|
58
|
+
@include media-breakpoint-down(sm) {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: start;
|
|
62
|
+
}
|
|
32
63
|
}
|
|
33
64
|
|
|
34
65
|
.buttons {
|
|
@@ -61,6 +92,33 @@
|
|
|
61
92
|
border-radius: 0.625rem;
|
|
62
93
|
margin-right: 0.5rem;
|
|
63
94
|
}
|
|
95
|
+
@include media-breakpoint-down(sm) {
|
|
96
|
+
width: 12.5rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@include media-breakpoint-down(sm) {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-direction: column;
|
|
104
|
+
align-items: start;
|
|
105
|
+
gap: .5rem;
|
|
106
|
+
margin-top: .5rem;
|
|
107
|
+
white-space: nowrap;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@include media-breakpoint-down(sm) {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: start;
|
|
114
|
+
gap: 1rem;
|
|
115
|
+
margin-top: 1rem;
|
|
116
|
+
height: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.booking {
|
|
120
|
+
@include media-breakpoint-down(sm) {
|
|
121
|
+
height: 13rem;
|
|
64
122
|
}
|
|
65
123
|
}
|
|
66
124
|
}
|
|
@@ -361,10 +361,11 @@
|
|
|
361
361
|
width: inherit;
|
|
362
362
|
|
|
363
363
|
@include media-breakpoint-down(sm) {
|
|
364
|
-
|
|
365
|
-
padding-top: 2rem;
|
|
364
|
+
display: none;
|
|
366
365
|
}
|
|
367
366
|
|
|
367
|
+
|
|
368
|
+
|
|
368
369
|
.form-control {
|
|
369
370
|
margin-bottom: 1.5rem;
|
|
370
371
|
}
|
|
@@ -411,6 +412,64 @@
|
|
|
411
412
|
}
|
|
412
413
|
}
|
|
413
414
|
|
|
415
|
+
.manual-booking-summary-mobile {
|
|
416
|
+
display: none;
|
|
417
|
+
|
|
418
|
+
@include media-breakpoint-down(sm) {
|
|
419
|
+
display: block;
|
|
420
|
+
padding: 0 1.5rem;
|
|
421
|
+
padding-top: 2rem;
|
|
422
|
+
height: max-content;
|
|
423
|
+
margin-bottom: 1.5rem;
|
|
424
|
+
width: inherit;
|
|
425
|
+
|
|
426
|
+
.form-control {
|
|
427
|
+
margin-bottom: .5rem;
|
|
428
|
+
}
|
|
429
|
+
.receipt-title {
|
|
430
|
+
font-size: 1.125rem;
|
|
431
|
+
font-weight: 600;
|
|
432
|
+
padding-bottom: 0.4rem;
|
|
433
|
+
margin-bottom: 1rem;
|
|
434
|
+
border-bottom: 2px solid $gray-400;
|
|
435
|
+
}
|
|
436
|
+
.event-name {
|
|
437
|
+
font-size: 0.94rem;
|
|
438
|
+
font-weight: 600;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.border-summary-item {
|
|
442
|
+
padding-bottom: 0.9rem;
|
|
443
|
+
margin-bottom: 1%;
|
|
444
|
+
border-bottom: 2px solid $gray-100;
|
|
445
|
+
flex-wrap: wrap;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.total-container {
|
|
449
|
+
display: flex;
|
|
450
|
+
justify-content: space-between;
|
|
451
|
+
font-size: 1rem;
|
|
452
|
+
font-weight: 600;
|
|
453
|
+
|
|
454
|
+
@include media-breakpoint-down(lg) {
|
|
455
|
+
flex-wrap: wrap;
|
|
456
|
+
}
|
|
457
|
+
.total-amount {
|
|
458
|
+
padding-left: 1rem;
|
|
459
|
+
@include media-breakpoint-down(lg) {
|
|
460
|
+
padding-left: 0;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.summary-item-container {
|
|
466
|
+
.border-summary-item:nth-last-child(2) {
|
|
467
|
+
border-bottom: 2px solid $gray-400;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
414
473
|
.menu-list-manual-booking {
|
|
415
474
|
display: flex;
|
|
416
475
|
align-items: center;
|
|
@@ -437,4 +496,4 @@
|
|
|
437
496
|
color: $blue;
|
|
438
497
|
}
|
|
439
498
|
}
|
|
440
|
-
}
|
|
499
|
+
}
|
|
@@ -28,12 +28,13 @@ $snippet-template-card-button-transition: $product-set-card-transition !default;
|
|
|
28
28
|
border: 1px solid #ccc;
|
|
29
29
|
border-radius: $border-radius;
|
|
30
30
|
height: 10rem;
|
|
31
|
-
width: 15rem;
|
|
31
|
+
min-width: 15rem;
|
|
32
32
|
padding: 1rem;
|
|
33
33
|
|
|
34
34
|
@include media-breakpoint-down(sm) {
|
|
35
35
|
height: 100%;
|
|
36
36
|
max-height: 10rem;
|
|
37
|
+
width: 100%;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
p {
|
|
@@ -109,4 +110,4 @@ $snippet-template-card-button-transition: $product-set-card-transition !default;
|
|
|
109
110
|
&:hover {
|
|
110
111
|
border: 2px solid $blue;
|
|
111
112
|
}
|
|
112
|
-
}
|
|
113
|
+
}
|
|
@@ -11,6 +11,12 @@ $tab-nav-link-active-border-bottom: 1px solid $tab-nav-link-active-color !defaul
|
|
|
11
11
|
margin-left: -1.25rem;
|
|
12
12
|
border-bottom: 1px solid $nav-tabs-border-color;
|
|
13
13
|
|
|
14
|
+
@include media-breakpoint-down(sm) {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
.nav-link {
|
|
15
21
|
color: $tab-nav-link-color;
|
|
16
22
|
background-color: transparent;
|
|
@@ -98,7 +98,8 @@
|
|
|
98
98
|
color: gray("600");
|
|
99
99
|
|
|
100
100
|
&.sortable {
|
|
101
|
-
&::before,
|
|
101
|
+
&::before,
|
|
102
|
+
&::after {
|
|
102
103
|
opacity: 1;
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -132,20 +133,20 @@
|
|
|
132
133
|
width: 2.5rem;
|
|
133
134
|
height: 2.5rem;
|
|
134
135
|
background-color: transparent;
|
|
135
|
-
|
|
136
|
+
|
|
136
137
|
svg {
|
|
137
138
|
margin-bottom: 2.5px;
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
&:hover {
|
|
141
142
|
cursor: pointer;
|
|
142
|
-
border-radius: .5rem;
|
|
143
|
+
border-radius: 0.5rem;
|
|
143
144
|
background-color: lighten($primary, 40);
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
.page-item {
|
|
148
|
-
margin-left: .4rem;
|
|
149
|
+
margin-left: 0.4rem;
|
|
149
150
|
min-width: 15px;
|
|
150
151
|
width: 2.5rem;
|
|
151
152
|
height: 2.5rem;
|
|
@@ -153,7 +154,7 @@
|
|
|
153
154
|
.page-link {
|
|
154
155
|
border: 0;
|
|
155
156
|
padding: 0;
|
|
156
|
-
border-radius: .5rem;
|
|
157
|
+
border-radius: 0.5rem;
|
|
157
158
|
height: 100%;
|
|
158
159
|
display: flex;
|
|
159
160
|
align-items: center;
|
|
@@ -162,13 +163,13 @@
|
|
|
162
163
|
color: $black;
|
|
163
164
|
font-weight: 600;
|
|
164
165
|
font-size: 0.875rem;
|
|
165
|
-
|
|
166
|
+
|
|
166
167
|
&:hover {
|
|
167
|
-
border-radius: .5rem;
|
|
168
|
+
border-radius: 0.5rem;
|
|
168
169
|
background-color: lighten($primary, 40);
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
+
|
|
172
173
|
&.active {
|
|
173
174
|
.page-link {
|
|
174
175
|
border: 2px solid $primary;
|
|
@@ -197,6 +197,7 @@ $grid-breakpoints: (
|
|
|
197
197
|
md: 768px,
|
|
198
198
|
lg: 992px,
|
|
199
199
|
xl: 1200px,
|
|
200
|
+
xxl: 1500px,
|
|
200
201
|
) !default;
|
|
201
202
|
|
|
202
203
|
@include _assert-ascending($grid-breakpoints, "$grid-breakpoints");
|
|
@@ -211,6 +212,7 @@ $container-max-widths: (
|
|
|
211
212
|
md: 720px,
|
|
212
213
|
lg: 960px,
|
|
213
214
|
xl: 1140px,
|
|
215
|
+
xxl: 1500px,
|
|
214
216
|
) !default;
|
|
215
217
|
|
|
216
218
|
@include _assert-ascending($container-max-widths, "$container-max-widths");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0-dev.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -213,5 +213,9 @@
|
|
|
213
213
|
},
|
|
214
214
|
"devDependencies": {
|
|
215
215
|
"identity-obj-proxy": "^3.0.0"
|
|
216
|
+
},
|
|
217
|
+
"volta": {
|
|
218
|
+
"node": "16.20.2",
|
|
219
|
+
"yarn": "1.22.18"
|
|
216
220
|
}
|
|
217
221
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, useState } from "react";
|
|
1
|
+
import React, { useContext, useEffect, useState } from "react";
|
|
2
2
|
import Row from "react-bootstrap/Row";
|
|
3
3
|
import Col from "react-bootstrap/Col";
|
|
4
4
|
import { Trans, useTranslation } from "react-i18next";
|
|
@@ -90,6 +90,14 @@ const LoginComponent = ({
|
|
|
90
90
|
RouteService.redirectTo("/");
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (!user.profile || !auth.secrets) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
RouteService.redirectTo("/");
|
|
99
|
+
}, [user.profile, auth.secrets]);
|
|
100
|
+
|
|
93
101
|
return (
|
|
94
102
|
<Router>
|
|
95
103
|
<Row className="justify-content-center">
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React, { Dispatch, ReactElement, SetStateAction } from "react";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
|
-
import {
|
|
3
|
+
import { DateTimeButtonProps } from "src/date-time-button";
|
|
4
4
|
import { CalendarButtons } from "./components/CalendarButtons";
|
|
5
5
|
import { CalendarDates } from "./components/CalendarDates";
|
|
6
6
|
|
|
7
|
-
// same as apps/iframe/src/types/availability.ts
|
|
8
|
-
export type AvailableTimes = Record<string, string[]>;
|
|
9
|
-
|
|
10
7
|
export const defaultStartDay = DateTime.now().set({
|
|
11
8
|
millisecond: 0,
|
|
12
9
|
second: 0,
|
|
@@ -18,32 +15,28 @@ export type CalendarProps = {
|
|
|
18
15
|
currentDate: DateTime;
|
|
19
16
|
setCurrentDate: Dispatch<SetStateAction<DateTime>>;
|
|
20
17
|
calendarDates: DateTime[];
|
|
21
|
-
disabledDates?: DateTime[];
|
|
22
18
|
selectedDate: DateTime | null;
|
|
23
19
|
setSelectedDate: Dispatch<SetStateAction<DateTime | null>>;
|
|
24
20
|
fromPrice?: string | ReactElement | null;
|
|
25
21
|
isLoading?: boolean;
|
|
26
22
|
initialDate?: DateTime;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
getDateTimeButtonProps: (
|
|
24
|
+
date: DateTime
|
|
25
|
+
) => Pick<
|
|
26
|
+
DateTimeButtonProps,
|
|
27
|
+
"resources" | "showResources" | "shouldCalculateResources" | "isDisabled"
|
|
28
|
+
>;
|
|
31
29
|
};
|
|
32
30
|
|
|
33
31
|
export const Calendar = ({
|
|
34
|
-
disabledDates = [],
|
|
35
32
|
initialDate = defaultStartDay,
|
|
36
33
|
...props
|
|
37
34
|
}: CalendarProps) => {
|
|
38
35
|
return (
|
|
39
36
|
<div className="calendar-wrapper">
|
|
40
37
|
<div className="calendar">
|
|
41
|
-
<CalendarButtons
|
|
42
|
-
|
|
43
|
-
initialDate={initialDate}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
46
|
-
<CalendarDates disabledDates={disabledDates} {...props} />
|
|
38
|
+
<CalendarButtons initialDate={initialDate} {...props} />
|
|
39
|
+
<CalendarDates {...props} />
|
|
47
40
|
</div>
|
|
48
41
|
</div>
|
|
49
42
|
);
|
|
@@ -4,26 +4,25 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import { range } from "lodash";
|
|
5
5
|
import { ReactComponent as SelectArrow } from "../../../assets/iframe/selectArrow.svg";
|
|
6
6
|
import { CalendarSelect } from "../CalendarSelect";
|
|
7
|
-
import { isDateDisabled } from "../../utils";
|
|
8
7
|
import { CalendarProps } from "../../Calendar";
|
|
9
8
|
|
|
10
9
|
type CalendarButtonsProps = Pick<
|
|
11
10
|
CalendarProps,
|
|
12
11
|
| "isLoading"
|
|
13
|
-
| "disabledDates"
|
|
14
12
|
| "initialDate"
|
|
15
13
|
| "currentDate"
|
|
16
14
|
| "setCurrentDate"
|
|
17
15
|
| "setSelectedDate"
|
|
16
|
+
| "getDateTimeButtonProps"
|
|
18
17
|
>;
|
|
19
18
|
|
|
20
19
|
export const CalendarButtons = ({
|
|
21
|
-
disabledDates = [],
|
|
22
20
|
isLoading = false,
|
|
23
21
|
initialDate,
|
|
24
22
|
currentDate,
|
|
25
23
|
setCurrentDate,
|
|
26
24
|
setSelectedDate,
|
|
25
|
+
getDateTimeButtonProps,
|
|
27
26
|
}: CalendarButtonsProps) => {
|
|
28
27
|
const { t } = useTranslation("Design");
|
|
29
28
|
|
|
@@ -66,7 +65,9 @@ export const CalendarButtons = ({
|
|
|
66
65
|
const onTodayClick = () => {
|
|
67
66
|
setCurrentDate(initialDate);
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
const { isDisabled } = getDateTimeButtonProps(initialDate);
|
|
69
|
+
|
|
70
|
+
if (isDisabled) return;
|
|
70
71
|
|
|
71
72
|
setSelectedDate(initialDate);
|
|
72
73
|
};
|
|
@@ -75,7 +76,9 @@ export const CalendarButtons = ({
|
|
|
75
76
|
const nextDate = initialDate.set({ day: initialDate.day + 1 });
|
|
76
77
|
setCurrentDate(nextDate);
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
const { isDisabled } = getDateTimeButtonProps(initialDate);
|
|
80
|
+
|
|
81
|
+
if (isDisabled) return;
|
|
79
82
|
|
|
80
83
|
setSelectedDate(nextDate);
|
|
81
84
|
};
|
|
@@ -2,25 +2,25 @@ import React, { useMemo } from "react";
|
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
3
|
import { DateTimeButton, Variant } from "../../../date-time-button";
|
|
4
4
|
import { CalendarWeekdays } from "../CalendarWeekdays";
|
|
5
|
-
import { isDateDisabled } from "../../utils";
|
|
6
5
|
import { CalendarProps } from "../../Calendar";
|
|
7
6
|
|
|
8
|
-
export type CalendarDatesProps =
|
|
7
|
+
export type CalendarDatesProps = Pick<
|
|
9
8
|
CalendarProps,
|
|
10
|
-
|
|
9
|
+
| "isLoading"
|
|
10
|
+
| "calendarDates"
|
|
11
|
+
| "selectedDate"
|
|
12
|
+
| "setSelectedDate"
|
|
13
|
+
| "fromPrice"
|
|
14
|
+
| "getDateTimeButtonProps"
|
|
11
15
|
>;
|
|
12
16
|
|
|
13
17
|
export const CalendarDates = ({
|
|
14
|
-
disabledDates = [],
|
|
15
18
|
isLoading = false,
|
|
16
19
|
calendarDates,
|
|
17
20
|
selectedDate,
|
|
18
21
|
setSelectedDate,
|
|
19
22
|
fromPrice,
|
|
20
|
-
|
|
21
|
-
includeAvailability,
|
|
22
|
-
shouldCalculateResources,
|
|
23
|
-
availableTimes,
|
|
23
|
+
getDateTimeButtonProps,
|
|
24
24
|
}: CalendarDatesProps) => {
|
|
25
25
|
const fillCalendarDates = useMemo(() => {
|
|
26
26
|
let firstDayOfWeek = calendarDates[0]?.weekday ?? 0;
|
|
@@ -46,8 +46,9 @@ export const CalendarDates = ({
|
|
|
46
46
|
{fillCalendarDates.map((date: DateTime | null) => {
|
|
47
47
|
if (date === null) return <div />;
|
|
48
48
|
|
|
49
|
-
const
|
|
50
|
-
|
|
49
|
+
const props = getDateTimeButtonProps(date);
|
|
50
|
+
|
|
51
|
+
const isDisabled = isLoading || props.isDisabled;
|
|
51
52
|
|
|
52
53
|
return (
|
|
53
54
|
<DateTimeButton
|
|
@@ -59,10 +60,8 @@ export const CalendarDates = ({
|
|
|
59
60
|
date={date}
|
|
60
61
|
onSelect={() => setSelectedDate(date)}
|
|
61
62
|
price={fromPrice}
|
|
62
|
-
resources={getAvailability?.(date)}
|
|
63
|
-
showResources={includeAvailability}
|
|
64
63
|
variant={Variant.month}
|
|
65
|
-
|
|
64
|
+
{...props}
|
|
66
65
|
/>
|
|
67
66
|
);
|
|
68
67
|
})}
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
import { DateTime, Interval } from "luxon";
|
|
2
|
-
import isEqual from "lodash/isEqual";
|
|
3
|
-
import { DATE_FORMAT } from "@licklist/core/dist/Config";
|
|
4
|
-
import { AvailableTimes } from "../Calendar";
|
|
5
|
-
|
|
6
|
-
export const isDateDisabled = (
|
|
7
|
-
date: DateTime,
|
|
8
|
-
disabledDates: DateTime[] = [],
|
|
9
|
-
availableTimes?: AvailableTimes
|
|
10
|
-
): boolean => {
|
|
11
|
-
const disabledByDates = !!disabledDates.find((disabledDate) =>
|
|
12
|
-
isEqual(disabledDate.toObject(), date.toObject())
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
const noAvailableTimes = availableTimes
|
|
16
|
-
? !availableTimes?.[date.toFormat(DATE_FORMAT)]
|
|
17
|
-
: false;
|
|
18
|
-
|
|
19
|
-
return disabledByDates || noAvailableTimes;
|
|
20
|
-
};
|
|
21
2
|
|
|
22
3
|
export const getMonthCalendarDates = (initialDate: DateTime): DateTime[] => {
|
|
23
4
|
const startOfMonth = initialDate.startOf("month");
|
|
@@ -14,12 +14,12 @@ export enum Variant {
|
|
|
14
14
|
|
|
15
15
|
export type DateTimeButtonProps = {
|
|
16
16
|
date: DateTime;
|
|
17
|
-
isSelected
|
|
18
|
-
isDisabled
|
|
17
|
+
isSelected: boolean;
|
|
18
|
+
isDisabled: boolean;
|
|
19
19
|
isSoldOut?: boolean;
|
|
20
20
|
onSelect: (date: DateTime) => void;
|
|
21
21
|
price?: string | number | ReactElement | null;
|
|
22
|
-
resources
|
|
22
|
+
resources?: ZoneResourcesAvailability | null;
|
|
23
23
|
showResources?: boolean;
|
|
24
24
|
shouldCalculateResources?: boolean;
|
|
25
25
|
variant: Variant;
|
|
@@ -32,6 +32,9 @@ export const CategoryProduct = ({
|
|
|
32
32
|
const { t } = useTranslation(["Design", "Validation"]);
|
|
33
33
|
const { control, clearErrors, setError } = useFormContext();
|
|
34
34
|
|
|
35
|
+
const hasDeposits =
|
|
36
|
+
category.allowDeposits && product?.deposit < product.price;
|
|
37
|
+
|
|
35
38
|
const productQuantityError = useMemo(() => {
|
|
36
39
|
if (!productsWithErrors) {
|
|
37
40
|
return undefined;
|
|
@@ -155,7 +158,7 @@ export const CategoryProduct = ({
|
|
|
155
158
|
invalid={invalid}
|
|
156
159
|
/>
|
|
157
160
|
</div>
|
|
158
|
-
{
|
|
161
|
+
{hasDeposits && !category?.remainderExpireAfter && (
|
|
159
162
|
<div className="mt-4">
|
|
160
163
|
{t("Design:payNowAndUponArrival", {
|
|
161
164
|
deposit: formatNumber(product?.deposit, {
|
|
@@ -170,7 +173,7 @@ export const CategoryProduct = ({
|
|
|
170
173
|
</div>
|
|
171
174
|
)}
|
|
172
175
|
|
|
173
|
-
{
|
|
176
|
+
{hasDeposits && category?.remainderExpireAfter > 0 && (
|
|
174
177
|
<div className="mt-4">
|
|
175
178
|
{t("Design:payNowAndReminderDays", {
|
|
176
179
|
deposit: formatNumber(product?.deposit, {
|