@ikas/storefront 0.0.163-alpha.13 → 0.0.163-alpha.15
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/build/index.es.js
CHANGED
|
@@ -61633,6 +61633,15 @@ var StockError = observer(function (_a) {
|
|
|
61633
61633
|
}, text: t("checkout-page:actions.continue"), isLoading: isLoading, onClick: onContinueClick }))) }));
|
|
61634
61634
|
});
|
|
61635
61635
|
|
|
61636
|
+
var css_248z$o = ".style-module_Container__1f6or {\n width: 100vw;\n height: 100vh;\n background-color: var(--checkout-primary-bg-color);\n display: flex;\n justify-content: center;\n align-items: center; }\n .style-module_Container__1f6or .style-module_loader__VCfEE,\n .style-module_Container__1f6or .style-module_loader__VCfEE:after {\n border-radius: 50%;\n width: 5em;\n height: 5em; }\n .style-module_Container__1f6or .style-module_loader__VCfEE {\n font-size: 6px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(255, 255, 255, 0.2);\n border-right: 0.5em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.5em solid rgba(255, 255, 255, 0.2);\n border-left: 0.5em solid var(--checkout-button-bg-color);\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__3N32j 1.1s infinite linear;\n animation: style-module_load8__3N32j 1.1s infinite linear; }\n\n@-webkit-keyframes style-module_load8__3N32j {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes style-module_load8__3N32j {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n";
|
|
61637
|
+
var styles$n = {"Container":"style-module_Container__1f6or","loader":"style-module_loader__VCfEE","load8":"style-module_load8__3N32j"};
|
|
61638
|
+
styleInject(css_248z$o);
|
|
61639
|
+
|
|
61640
|
+
var FullscreenLoading = function () {
|
|
61641
|
+
return (createElement("div", { className: styles$n.Container },
|
|
61642
|
+
createElement("div", { className: styles$n.loader })));
|
|
61643
|
+
};
|
|
61644
|
+
|
|
61636
61645
|
var IkasCheckoutPage = function (_a) {
|
|
61637
61646
|
var _b, _c, _d;
|
|
61638
61647
|
var checkout = _a.checkout, checkoutSettings = _a.checkoutSettings, customizationProps = _a.customizationProps, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
|
|
@@ -61670,7 +61679,7 @@ var IkasCheckoutPage = function (_a) {
|
|
|
61670
61679
|
document.documentElement.style.setProperty("--checkout-success-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.successLightColor) || "#F6FFED");
|
|
61671
61680
|
}, [customizationProps]);
|
|
61672
61681
|
if (!vm.isCheckoutLoaded || !vm.store.customerStore.initialized)
|
|
61673
|
-
return null;
|
|
61682
|
+
return createElement(FullscreenLoading, null);
|
|
61674
61683
|
if (vm.checkout.hasCustomer &&
|
|
61675
61684
|
((_b = vm.store.customerStore.customer) === null || _b === void 0 ? void 0 : _b.id) !== ((_c = vm.checkout.customer) === null || _c === void 0 ? void 0 : _c.id)) {
|
|
61676
61685
|
router.push("/account/login?redirect=" + encodeURIComponent(vm.checkoutUrl));
|
|
@@ -62434,21 +62443,60 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
62434
62443
|
});
|
|
62435
62444
|
|
|
62436
62445
|
var CheckoutPage = function (_a) {
|
|
62437
|
-
var
|
|
62446
|
+
var checkoutId = _a.checkoutId, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "checkoutSettingsStr", "customizationProps", "configJson"]);
|
|
62447
|
+
var router = useRouter();
|
|
62448
|
+
var _b = useState(), checkout = _b[0], setCheckout = _b[1];
|
|
62438
62449
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
62439
62450
|
var store = IkasStorefrontConfig.store;
|
|
62440
|
-
var checkout = new IkasCheckout(JSON.parse(checkoutStr));
|
|
62441
62451
|
var checkoutSettings = checkoutSettingsStr
|
|
62442
62452
|
? new IkasCheckoutSettings(JSON.parse(checkoutSettingsStr))
|
|
62443
62453
|
: new IkasCheckoutSettings();
|
|
62454
|
+
useEffect(function () {
|
|
62455
|
+
document.documentElement.style.setProperty("--checkout-button-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonBgColor) || "#272727");
|
|
62456
|
+
document.documentElement.style.setProperty("--checkout-button-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonTextColor) || "#FFFFFF");
|
|
62457
|
+
document.documentElement.style.setProperty("--checkout-button-disabled-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonDisabledBgColor) || "#F7F7F9");
|
|
62458
|
+
document.documentElement.style.setProperty("--checkout-button-disabled-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonDisabledTextColor) || "#8A8B94");
|
|
62459
|
+
document.documentElement.style.setProperty("--checkout-primary-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.primaryTextColor) || "#272727");
|
|
62460
|
+
document.documentElement.style.setProperty("--checkout-secondary-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.secondaryTextColor) || "#8A8B94");
|
|
62461
|
+
document.documentElement.style.setProperty("--checkout-primary-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.primaryBgColor) || "#FFFFFF");
|
|
62462
|
+
document.documentElement.style.setProperty("--checkout-secondary-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.secondaryBgColor) || "#F7F7F9");
|
|
62463
|
+
document.documentElement.style.setProperty("--checkout-border-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.borderColor) || "#E5E4E9");
|
|
62464
|
+
document.documentElement.style.setProperty("--checkout-card-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.cardBgColor) || "#F7F7F9");
|
|
62465
|
+
document.documentElement.style.setProperty("--checkout-error-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.errorColor) || "#FB4E4E");
|
|
62466
|
+
document.documentElement.style.setProperty("--checkout-error-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.errorLightColor) || "#FCF3F4");
|
|
62467
|
+
document.documentElement.style.setProperty("--checkout-warning-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.warningColor) || "#FFBC1F");
|
|
62468
|
+
document.documentElement.style.setProperty("--checkout-warning-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.warningLightColor) || "#FFFAEE");
|
|
62469
|
+
document.documentElement.style.setProperty("--checkout-success-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.successColor) || "#2DCA73");
|
|
62470
|
+
document.documentElement.style.setProperty("--checkout-success-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.successLightColor) || "#F6FFED");
|
|
62471
|
+
}, [customizationProps]);
|
|
62444
62472
|
useEffect(function () {
|
|
62445
62473
|
store.checkLocalization();
|
|
62474
|
+
getCheckout();
|
|
62446
62475
|
}, []);
|
|
62476
|
+
var getCheckout = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
62477
|
+
var checkout;
|
|
62478
|
+
return __generator(this, function (_a) {
|
|
62479
|
+
switch (_a.label) {
|
|
62480
|
+
case 0: return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(checkoutId)];
|
|
62481
|
+
case 1:
|
|
62482
|
+
checkout = _a.sent();
|
|
62483
|
+
if (checkout) {
|
|
62484
|
+
setCheckout(checkout);
|
|
62485
|
+
}
|
|
62486
|
+
else {
|
|
62487
|
+
router.replace("/");
|
|
62488
|
+
}
|
|
62489
|
+
return [2 /*return*/];
|
|
62490
|
+
}
|
|
62491
|
+
});
|
|
62492
|
+
}); }, [checkoutId]);
|
|
62493
|
+
if (!checkout)
|
|
62494
|
+
return createElement(FullscreenLoading, null);
|
|
62447
62495
|
return (createElement(IkasCheckoutPage$1, __assign({ checkout: checkout, checkoutSettings: checkoutSettings, customizationProps: customizationProps }, others)));
|
|
62448
62496
|
};
|
|
62449
62497
|
var _id_ = observer(CheckoutPage);
|
|
62450
62498
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
62451
|
-
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect,
|
|
62499
|
+
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkoutSettings, componentDirs, isLocal, serverRuntimeConfig, currentLocale, nextI18nConf, i18nReader, translations, checkoutPage, checkoutComponent, customizationProps;
|
|
62452
62500
|
var _a;
|
|
62453
62501
|
return __generator(this, function (_b) {
|
|
62454
62502
|
switch (_b.label) {
|
|
@@ -62486,12 +62534,8 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62486
62534
|
if (!id || typeof id !== "string") {
|
|
62487
62535
|
return [2 /*return*/, redirect()];
|
|
62488
62536
|
}
|
|
62489
|
-
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
62490
|
-
case 2:
|
|
62491
|
-
checkout = _b.sent();
|
|
62492
|
-
if (!checkout) return [3 /*break*/, 5];
|
|
62493
62537
|
return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
|
|
62494
|
-
case
|
|
62538
|
+
case 2:
|
|
62495
62539
|
checkoutSettings = _b.sent();
|
|
62496
62540
|
componentDirs = ["common", CHECKOUT_TRANSLATION_NAMESPACE];
|
|
62497
62541
|
isLocal = process.env.NEXT_PUBLIC_ENV === "local";
|
|
@@ -62500,7 +62544,7 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62500
62544
|
nextI18nConf = serverRuntimeConfig.nextI18nConf;
|
|
62501
62545
|
i18nReader = new I18NFileReader(currentLocale, componentDirs, isLocal ? undefined : nextI18nConf.localePath);
|
|
62502
62546
|
return [4 /*yield*/, i18nReader.read()];
|
|
62503
|
-
case
|
|
62547
|
+
case 3:
|
|
62504
62548
|
translations = _b.sent();
|
|
62505
62549
|
IkasStorefrontConfig.translations = translations;
|
|
62506
62550
|
checkoutPage = themeLocalization.themeJson.pages.find(function (p) { return p.type === IkasThemePageType.CHECKOUT; });
|
|
@@ -62527,7 +62571,7 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62527
62571
|
};
|
|
62528
62572
|
return [2 /*return*/, {
|
|
62529
62573
|
props: {
|
|
62530
|
-
|
|
62574
|
+
checkoutId: id,
|
|
62531
62575
|
checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
|
|
62532
62576
|
: null,
|
|
62533
62577
|
customizationProps: customizationProps,
|
|
@@ -62538,7 +62582,6 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62538
62582
|
queryParams: context.query,
|
|
62539
62583
|
},
|
|
62540
62584
|
}];
|
|
62541
|
-
case 5: return [2 /*return*/, redirect()];
|
|
62542
62585
|
}
|
|
62543
62586
|
});
|
|
62544
62587
|
}); };
|
package/build/index.js
CHANGED
|
@@ -61612,6 +61612,15 @@ var StockError = mobxReactLite.observer(function (_a) {
|
|
|
61612
61612
|
}, text: t("checkout-page:actions.continue"), isLoading: isLoading, onClick: onContinueClick }))) }));
|
|
61613
61613
|
});
|
|
61614
61614
|
|
|
61615
|
+
var css_248z$o = ".style-module_Container__1f6or {\n width: 100vw;\n height: 100vh;\n background-color: var(--checkout-primary-bg-color);\n display: flex;\n justify-content: center;\n align-items: center; }\n .style-module_Container__1f6or .style-module_loader__VCfEE,\n .style-module_Container__1f6or .style-module_loader__VCfEE:after {\n border-radius: 50%;\n width: 5em;\n height: 5em; }\n .style-module_Container__1f6or .style-module_loader__VCfEE {\n font-size: 6px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(255, 255, 255, 0.2);\n border-right: 0.5em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.5em solid rgba(255, 255, 255, 0.2);\n border-left: 0.5em solid var(--checkout-button-bg-color);\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__3N32j 1.1s infinite linear;\n animation: style-module_load8__3N32j 1.1s infinite linear; }\n\n@-webkit-keyframes style-module_load8__3N32j {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes style-module_load8__3N32j {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n";
|
|
61616
|
+
var styles$n = {"Container":"style-module_Container__1f6or","loader":"style-module_loader__VCfEE","load8":"style-module_load8__3N32j"};
|
|
61617
|
+
styleInject(css_248z$o);
|
|
61618
|
+
|
|
61619
|
+
var FullscreenLoading = function () {
|
|
61620
|
+
return (React.createElement("div", { className: styles$n.Container },
|
|
61621
|
+
React.createElement("div", { className: styles$n.loader })));
|
|
61622
|
+
};
|
|
61623
|
+
|
|
61615
61624
|
var IkasCheckoutPage = function (_a) {
|
|
61616
61625
|
var _b, _c, _d;
|
|
61617
61626
|
var checkout = _a.checkout, checkoutSettings = _a.checkoutSettings, customizationProps = _a.customizationProps, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
|
|
@@ -61649,7 +61658,7 @@ var IkasCheckoutPage = function (_a) {
|
|
|
61649
61658
|
document.documentElement.style.setProperty("--checkout-success-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.successLightColor) || "#F6FFED");
|
|
61650
61659
|
}, [customizationProps]);
|
|
61651
61660
|
if (!vm.isCheckoutLoaded || !vm.store.customerStore.initialized)
|
|
61652
|
-
return null;
|
|
61661
|
+
return React.createElement(FullscreenLoading, null);
|
|
61653
61662
|
if (vm.checkout.hasCustomer &&
|
|
61654
61663
|
((_b = vm.store.customerStore.customer) === null || _b === void 0 ? void 0 : _b.id) !== ((_c = vm.checkout.customer) === null || _c === void 0 ? void 0 : _c.id)) {
|
|
61655
61664
|
router$1.push("/account/login?redirect=" + encodeURIComponent(vm.checkoutUrl));
|
|
@@ -62413,21 +62422,60 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
62413
62422
|
});
|
|
62414
62423
|
|
|
62415
62424
|
var CheckoutPage = function (_a) {
|
|
62416
|
-
var
|
|
62425
|
+
var checkoutId = _a.checkoutId, checkoutSettingsStr = _a.checkoutSettingsStr, customizationProps = _a.customizationProps, configJson = _a.configJson, others = __rest(_a, ["checkoutId", "checkoutSettingsStr", "customizationProps", "configJson"]);
|
|
62426
|
+
var router$1 = router.useRouter();
|
|
62427
|
+
var _b = React.useState(), checkout = _b[0], setCheckout = _b[1];
|
|
62417
62428
|
IkasStorefrontConfig.initWithJson(configJson);
|
|
62418
62429
|
var store = IkasStorefrontConfig.store;
|
|
62419
|
-
var checkout = new IkasCheckout(JSON.parse(checkoutStr));
|
|
62420
62430
|
var checkoutSettings = checkoutSettingsStr
|
|
62421
62431
|
? new IkasCheckoutSettings(JSON.parse(checkoutSettingsStr))
|
|
62422
62432
|
: new IkasCheckoutSettings();
|
|
62433
|
+
React.useEffect(function () {
|
|
62434
|
+
document.documentElement.style.setProperty("--checkout-button-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonBgColor) || "#272727");
|
|
62435
|
+
document.documentElement.style.setProperty("--checkout-button-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonTextColor) || "#FFFFFF");
|
|
62436
|
+
document.documentElement.style.setProperty("--checkout-button-disabled-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonDisabledBgColor) || "#F7F7F9");
|
|
62437
|
+
document.documentElement.style.setProperty("--checkout-button-disabled-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.buttonDisabledTextColor) || "#8A8B94");
|
|
62438
|
+
document.documentElement.style.setProperty("--checkout-primary-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.primaryTextColor) || "#272727");
|
|
62439
|
+
document.documentElement.style.setProperty("--checkout-secondary-text-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.secondaryTextColor) || "#8A8B94");
|
|
62440
|
+
document.documentElement.style.setProperty("--checkout-primary-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.primaryBgColor) || "#FFFFFF");
|
|
62441
|
+
document.documentElement.style.setProperty("--checkout-secondary-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.secondaryBgColor) || "#F7F7F9");
|
|
62442
|
+
document.documentElement.style.setProperty("--checkout-border-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.borderColor) || "#E5E4E9");
|
|
62443
|
+
document.documentElement.style.setProperty("--checkout-card-bg-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.cardBgColor) || "#F7F7F9");
|
|
62444
|
+
document.documentElement.style.setProperty("--checkout-error-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.errorColor) || "#FB4E4E");
|
|
62445
|
+
document.documentElement.style.setProperty("--checkout-error-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.errorLightColor) || "#FCF3F4");
|
|
62446
|
+
document.documentElement.style.setProperty("--checkout-warning-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.warningColor) || "#FFBC1F");
|
|
62447
|
+
document.documentElement.style.setProperty("--checkout-warning-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.warningLightColor) || "#FFFAEE");
|
|
62448
|
+
document.documentElement.style.setProperty("--checkout-success-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.successColor) || "#2DCA73");
|
|
62449
|
+
document.documentElement.style.setProperty("--checkout-success-light-color", (customizationProps === null || customizationProps === void 0 ? void 0 : customizationProps.successLightColor) || "#F6FFED");
|
|
62450
|
+
}, [customizationProps]);
|
|
62423
62451
|
React.useEffect(function () {
|
|
62424
62452
|
store.checkLocalization();
|
|
62453
|
+
getCheckout();
|
|
62425
62454
|
}, []);
|
|
62455
|
+
var getCheckout = React.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
62456
|
+
var checkout;
|
|
62457
|
+
return __generator(this, function (_a) {
|
|
62458
|
+
switch (_a.label) {
|
|
62459
|
+
case 0: return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(checkoutId)];
|
|
62460
|
+
case 1:
|
|
62461
|
+
checkout = _a.sent();
|
|
62462
|
+
if (checkout) {
|
|
62463
|
+
setCheckout(checkout);
|
|
62464
|
+
}
|
|
62465
|
+
else {
|
|
62466
|
+
router$1.replace("/");
|
|
62467
|
+
}
|
|
62468
|
+
return [2 /*return*/];
|
|
62469
|
+
}
|
|
62470
|
+
});
|
|
62471
|
+
}); }, [checkoutId]);
|
|
62472
|
+
if (!checkout)
|
|
62473
|
+
return React.createElement(FullscreenLoading, null);
|
|
62426
62474
|
return (React.createElement(IkasCheckoutPage$1, __assign({ checkout: checkout, checkoutSettings: checkoutSettings, customizationProps: customizationProps }, others)));
|
|
62427
62475
|
};
|
|
62428
62476
|
var _id_ = mobxReactLite.observer(CheckoutPage);
|
|
62429
62477
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
62430
|
-
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect,
|
|
62478
|
+
var id, locale, settings, storefront, themeLocalization, salesChannel, routing, redirect, checkoutSettings, componentDirs, isLocal, serverRuntimeConfig, currentLocale, nextI18nConf, i18nReader, translations, checkoutPage, checkoutComponent, customizationProps;
|
|
62431
62479
|
var _a;
|
|
62432
62480
|
return __generator(this, function (_b) {
|
|
62433
62481
|
switch (_b.label) {
|
|
@@ -62465,12 +62513,8 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62465
62513
|
if (!id || typeof id !== "string") {
|
|
62466
62514
|
return [2 /*return*/, redirect()];
|
|
62467
62515
|
}
|
|
62468
|
-
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
62469
|
-
case 2:
|
|
62470
|
-
checkout = _b.sent();
|
|
62471
|
-
if (!checkout) return [3 /*break*/, 5];
|
|
62472
62516
|
return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
|
|
62473
|
-
case
|
|
62517
|
+
case 2:
|
|
62474
62518
|
checkoutSettings = _b.sent();
|
|
62475
62519
|
componentDirs = ["common", CHECKOUT_TRANSLATION_NAMESPACE];
|
|
62476
62520
|
isLocal = process.env.NEXT_PUBLIC_ENV === "local";
|
|
@@ -62479,7 +62523,7 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62479
62523
|
nextI18nConf = serverRuntimeConfig.nextI18nConf;
|
|
62480
62524
|
i18nReader = new I18NFileReader(currentLocale, componentDirs, isLocal ? undefined : nextI18nConf.localePath);
|
|
62481
62525
|
return [4 /*yield*/, i18nReader.read()];
|
|
62482
|
-
case
|
|
62526
|
+
case 3:
|
|
62483
62527
|
translations = _b.sent();
|
|
62484
62528
|
IkasStorefrontConfig.translations = translations;
|
|
62485
62529
|
checkoutPage = themeLocalization.themeJson.pages.find(function (p) { return p.type === exports.IkasThemePageType.CHECKOUT; });
|
|
@@ -62506,7 +62550,7 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62506
62550
|
};
|
|
62507
62551
|
return [2 /*return*/, {
|
|
62508
62552
|
props: {
|
|
62509
|
-
|
|
62553
|
+
checkoutId: id,
|
|
62510
62554
|
checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
|
|
62511
62555
|
: null,
|
|
62512
62556
|
customizationProps: customizationProps,
|
|
@@ -62517,7 +62561,6 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
62517
62561
|
queryParams: context.query,
|
|
62518
62562
|
},
|
|
62519
62563
|
}];
|
|
62520
|
-
case 5: return [2 /*return*/, redirect()];
|
|
62521
62564
|
}
|
|
62522
62565
|
});
|
|
62523
62566
|
}); };
|
|
@@ -4,7 +4,7 @@ import { GetServerSideProps } from "next";
|
|
|
4
4
|
import { ParsedUrlQuery } from "querystring";
|
|
5
5
|
import { IkasCheckoutCustomizationProps } from "../../components/checkout/index";
|
|
6
6
|
declare type Props = {
|
|
7
|
-
|
|
7
|
+
checkoutId: string;
|
|
8
8
|
checkoutSettingsStr: string | null;
|
|
9
9
|
customizationProps: IkasCheckoutCustomizationProps;
|
|
10
10
|
returnPolicy: string;
|