@resira/ui 0.4.9 → 0.4.10
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/README.md +238 -238
- package/dist/index.cjs +16 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2972 -2972
- package/package.json +59 -59
package/dist/index.js
CHANGED
|
@@ -379,7 +379,7 @@ function useReservation() {
|
|
|
379
379
|
const [error, setError] = useState(null);
|
|
380
380
|
const submit = useCallback(
|
|
381
381
|
async (data) => {
|
|
382
|
-
if (!data.resourceId) {
|
|
382
|
+
if (!data.resourceId && !data.checkoutSessionToken) {
|
|
383
383
|
setError("No resource selected");
|
|
384
384
|
return null;
|
|
385
385
|
}
|
|
@@ -3097,9 +3097,10 @@ function ResiraBookingWidget() {
|
|
|
3097
3097
|
guestPhone: guest.guestPhone.trim() || void 0,
|
|
3098
3098
|
notes: guest.notes.trim() || void 0,
|
|
3099
3099
|
promoCode: discountCode.trim() || void 0,
|
|
3100
|
-
termsAccepted: termsAccepted || void 0
|
|
3100
|
+
termsAccepted: termsAccepted || void 0,
|
|
3101
|
+
waiverAccepted: waiverAccepted || void 0
|
|
3101
3102
|
};
|
|
3102
|
-
}, [activeResourceId, selectedProduct, selection, guest, discountCode, termsAccepted, isCheckoutMode, checkoutSession, checkoutSessionToken]);
|
|
3103
|
+
}, [activeResourceId, selectedProduct, selection, guest, discountCode, termsAccepted, waiverAccepted, isCheckoutMode, checkoutSession, checkoutSessionToken]);
|
|
3103
3104
|
const blockedDates = useMemo(() => {
|
|
3104
3105
|
const dates = calendarData?.dates?.blockedDates ?? availability?.dates?.blockedDates ?? [];
|
|
3105
3106
|
return new Set(dates);
|
|
@@ -3330,7 +3331,9 @@ function ResiraBookingWidget() {
|
|
|
3330
3331
|
startTime: selection.startTime,
|
|
3331
3332
|
endTime: selection.endTime,
|
|
3332
3333
|
partySize: selection.partySize,
|
|
3333
|
-
notes: guest.notes.trim() || void 0
|
|
3334
|
+
notes: guest.notes.trim() || void 0,
|
|
3335
|
+
termsAccepted: termsAccepted || void 0,
|
|
3336
|
+
waiverAccepted: waiverAccepted || void 0
|
|
3334
3337
|
};
|
|
3335
3338
|
const result = await submit(payload);
|
|
3336
3339
|
if (result) {
|
|
@@ -3380,6 +3383,10 @@ function ResiraBookingWidget() {
|
|
|
3380
3383
|
setTermsError(locale.termsRequired);
|
|
3381
3384
|
return;
|
|
3382
3385
|
}
|
|
3386
|
+
if (showWaiver && !waiverAccepted) {
|
|
3387
|
+
setTermsError(locale.termsRequired);
|
|
3388
|
+
return;
|
|
3389
|
+
}
|
|
3383
3390
|
setTermsError(null);
|
|
3384
3391
|
const result = await createPayment(paymentPayload);
|
|
3385
3392
|
if (!result) return;
|
|
@@ -3404,7 +3411,8 @@ function ResiraBookingWidget() {
|
|
|
3404
3411
|
}
|
|
3405
3412
|
const resourceId = activeResourceId ?? selectedProduct?.equipmentIds?.[0] ?? "";
|
|
3406
3413
|
const payload = {
|
|
3407
|
-
resourceId,
|
|
3414
|
+
resourceId: isCheckoutMode ? void 0 : resourceId,
|
|
3415
|
+
checkoutSessionToken: isCheckoutMode ? checkoutSessionToken : void 0,
|
|
3408
3416
|
guestName: guest.guestName.trim(),
|
|
3409
3417
|
guestEmail: guest.guestEmail.trim() || void 0,
|
|
3410
3418
|
guestPhone: guest.guestPhone.trim() || void 0,
|
|
@@ -3413,7 +3421,9 @@ function ResiraBookingWidget() {
|
|
|
3413
3421
|
startTime: selection.startTime,
|
|
3414
3422
|
endTime: selection.endTime,
|
|
3415
3423
|
partySize: selection.partySize,
|
|
3416
|
-
notes: guest.notes.trim() || void 0
|
|
3424
|
+
notes: guest.notes.trim() || void 0,
|
|
3425
|
+
termsAccepted: termsAccepted || void 0,
|
|
3426
|
+
waiverAccepted: waiverAccepted || void 0
|
|
3417
3427
|
};
|
|
3418
3428
|
const result = await submit(payload);
|
|
3419
3429
|
if (result) {
|