@ikas/storefront 1.0.21 → 2.0.0-alpha.1
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/ikas +12055 -0
- package/package.json +22 -21
- package/src/.DS_Store +0 -0
- package/src/__generated__/global-types.ts +753 -0
- package/src/analytics/analytics.ts +497 -0
- package/src/analytics/events.ts +115 -0
- package/src/analytics/facebookPixel.ts +226 -0
- package/src/analytics/googleTagManager.ts +334 -0
- package/src/analytics/head/index.tsx +81 -0
- package/src/analytics/ikas.ts +545 -0
- package/{build/analytics/index.d.ts → src/analytics/index.ts} +2 -2
- package/src/api/.DS_Store +0 -0
- package/src/api/apollo.ts +91 -0
- package/src/api/back-in-stock-reminder/__generated__/listProductBackInStockRemind.ts +36 -0
- package/src/api/back-in-stock-reminder/__generated__/saveProductBackInStockRemind.ts +31 -0
- package/src/api/back-in-stock-reminder/index.ts +131 -0
- package/src/api/blog/__generated__/getBlog.ts +101 -0
- package/src/api/blog/__generated__/listBlog.ts +104 -0
- package/src/api/blog/__generated__/listBlogCategory.ts +52 -0
- package/src/api/blog/__generated__/listBlogMetaData.ts +42 -0
- package/src/api/blog/index.ts +415 -0
- package/src/api/brand/__generated__/listProductBrand.ts +63 -0
- package/src/api/brand/index.ts +127 -0
- package/src/api/cart/__generated__/getCart.ts +104 -0
- package/src/api/cart/__generated__/saveItemToCart.ts +91 -0
- package/src/api/cart/index.ts +213 -0
- package/src/api/category/__generated__/listCategory.ts +68 -0
- package/src/api/category/__generated__/listCategoryPaths.ts +37 -0
- package/src/api/category/index.ts +223 -0
- package/src/api/checkout/__generated__/addCouponCodeToCheckout.ts +22 -0
- package/src/api/checkout/__generated__/checkStocks.ts +31 -0
- package/src/api/checkout/__generated__/createSaleTransactionWithCheckout.ts +35 -0
- package/src/api/checkout/__generated__/getCheckoutByCartId.ts +21 -0
- package/src/api/checkout/__generated__/getCheckoutById.ts +270 -0
- package/src/api/checkout/__generated__/getOrder.ts +248 -0
- package/src/api/checkout/__generated__/listCheckoutSettings.ts +48 -0
- package/src/api/checkout/__generated__/listPaymentGateway.ts +57 -0
- package/src/api/checkout/__generated__/retrieveInstallmentInfo.ts +36 -0
- package/src/api/checkout/__generated__/saveCheckout.ts +23 -0
- package/src/api/checkout/index.ts +884 -0
- package/src/api/city/__generated__/listCity.ts +26 -0
- package/src/api/city/index.ts +56 -0
- package/src/api/contact-form/__generated__/sendContactFormToMerchant.ts +19 -0
- package/src/api/contact-form/index.ts +54 -0
- package/src/api/country/__generated__/getAvailableShippingCountries.ts +16 -0
- package/src/api/country/__generated__/getMyCountry.ts +12 -0
- package/src/api/country/__generated__/listCountry.ts +36 -0
- package/src/api/country/index.ts +129 -0
- package/src/api/customer/__generated__/checkCustomerEmail.ts +21 -0
- package/src/api/customer/__generated__/createCustomerEmailSubscription.ts +23 -0
- package/src/api/customer/__generated__/createOrderRefundRequest.ts +248 -0
- package/src/api/customer/__generated__/customerForgotPassword.ts +17 -0
- package/src/api/customer/__generated__/customerLogin.ts +88 -0
- package/src/api/customer/__generated__/customerRecoverPassword.ts +18 -0
- package/src/api/customer/__generated__/customerRefreshToken.ts +22 -0
- package/src/api/customer/__generated__/getCustomerOrders.ts +248 -0
- package/src/api/customer/__generated__/getLastViewedProducts.ts +27 -0
- package/src/api/customer/__generated__/getMyCustomer.ts +75 -0
- package/src/api/customer/__generated__/listOrderRefundSettings.ts +25 -0
- package/src/api/customer/__generated__/listOrderTransactions.ts +68 -0
- package/src/api/customer/__generated__/registerCustomer.ts +90 -0
- package/src/api/customer/__generated__/saveLastViewedProducts.ts +23 -0
- package/src/api/customer/__generated__/saveMyCustomer.ts +80 -0
- package/src/api/customer/index.ts +1147 -0
- package/src/api/customer-review/__generated__/createCustomerReview.ts +23 -0
- package/src/api/customer-review/__generated__/listCustomerReviews.ts +38 -0
- package/src/api/customer-review/index.ts +122 -0
- package/src/api/district/__generated__/listDistrict.ts +25 -0
- package/src/api/district/index.ts +59 -0
- package/src/api/favorite-product/__generated__/isFavoriteProduct.ts +16 -0
- package/src/api/favorite-product/__generated__/listFavoriteProducts.ts +22 -0
- package/src/api/favorite-product/__generated__/saveFavoriteProduct.ts +17 -0
- package/src/api/favorite-product/index.ts +100 -0
- package/src/api/html-meta-data/__generated__/listHTMLMetaData.ts +30 -0
- package/src/api/html-meta-data/index.ts +72 -0
- package/src/api/index.ts +23 -0
- package/src/api/merchant/__generated__/listMerchantSettings.ts +19 -0
- package/src/api/merchant/index.ts +43 -0
- package/src/api/product-attribute/__generated__/listProductAttribute.ts +54 -0
- package/src/api/product-attribute/index.ts +69 -0
- package/src/api/product-option-set/__generated__/ListProductOptionSet.ts +111 -0
- package/src/api/product-option-set/index.ts +114 -0
- package/src/api/product-search/__generated__/getProductFilterData.ts +69 -0
- package/src/api/product-search/__generated__/searchProducts.ts +40 -0
- package/src/api/product-search/index.ts +329 -0
- package/src/api/raffle/__generated__/getRafflesByCustomerId.ts +55 -0
- package/src/api/raffle/__generated__/listRaffle.ts +74 -0
- package/src/api/raffle/__generated__/listRaffleMetaData.ts +33 -0
- package/src/api/raffle/__generated__/saveRaffleParticipant.ts +43 -0
- package/src/api/raffle/index.ts +369 -0
- package/src/api/state/__generated__/listState.ts +25 -0
- package/src/api/state/index.ts +45 -0
- package/src/api/stock-location/__generated__/listStockLocation.ts +17 -0
- package/src/api/stock-location/index.ts +30 -0
- package/src/api/storefront/__generated__/getStorefront.ts +67 -0
- package/src/api/storefront/index.ts +76 -0
- package/src/api/variant-type/__generated__/listVariantType.ts +54 -0
- package/src/api/variant-type/index.ts +86 -0
- package/{build → src}/assets/translations/checkout/en.js +0 -0
- package/{build → src}/assets/translations/checkout/tr.js +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/checkout/components/address-form/index.tsx +360 -0
- package/src/components/checkout/components/address-form/model.ts +366 -0
- package/src/components/checkout/components/button/index.tsx +34 -0
- package/src/components/checkout/components/button/style.module.scss +103 -0
- package/src/components/checkout/components/cart-summary/cart-item/index.tsx +146 -0
- package/src/components/checkout/components/cart-summary/cart-item/style.module.scss +107 -0
- package/src/components/checkout/components/cart-summary/index.tsx +458 -0
- package/src/components/checkout/components/cart-summary/style.module.scss +237 -0
- package/src/components/checkout/components/checkbox/check.tsx +23 -0
- package/src/components/checkout/components/checkbox/index.tsx +50 -0
- package/src/components/checkout/components/checkbox/style.module.scss +72 -0
- package/src/components/checkout/components/credit-card-form/index.tsx +121 -0
- package/src/components/checkout/components/credit-card-form/model.ts +56 -0
- package/src/components/checkout/components/credit-card-form/style.module.scss +6 -0
- package/src/components/checkout/components/credit-card-form/svg/amex.tsx +30 -0
- package/src/components/checkout/components/credit-card-form/svg/master-card.tsx +38 -0
- package/src/components/checkout/components/credit-card-form/svg/troy.tsx +54 -0
- package/src/components/checkout/components/credit-card-form/svg/visa.tsx +46 -0
- package/src/components/checkout/components/customer-addresses/index.tsx +167 -0
- package/src/components/checkout/components/customer-addresses/model.ts +126 -0
- package/src/components/checkout/components/customer-addresses/style.module.scss +20 -0
- package/src/components/checkout/components/error/customer-login-required-error/index.tsx +23 -0
- package/src/components/checkout/components/error/index.tsx +54 -0
- package/src/components/checkout/components/error/no-shipping-error/index.tsx +19 -0
- package/src/components/checkout/components/error/payment-error/index.tsx +21 -0
- package/src/components/checkout/components/error/stock-error/index.tsx +72 -0
- package/src/components/checkout/components/error/stock-error/style.module.scss +11 -0
- package/src/components/checkout/components/error/unknown-error/index.tsx +19 -0
- package/src/components/checkout/components/expandable-section/index.tsx +37 -0
- package/src/components/checkout/components/expandable-section/style.module.scss +29 -0
- package/src/components/checkout/components/form-item/caret-down.tsx +20 -0
- package/src/components/checkout/components/form-item/index.tsx +205 -0
- package/src/components/checkout/components/form-item/model.ts +131 -0
- package/src/components/checkout/components/form-item/style.module.scss +213 -0
- package/src/components/checkout/components/fullscreen-loading/index.tsx +10 -0
- package/src/components/checkout/components/fullscreen-loading/style.module.scss +56 -0
- package/src/components/checkout/components/input-with-button/index.tsx +53 -0
- package/src/components/checkout/components/input-with-button/style.module.scss +104 -0
- package/src/components/checkout/components/modal/index.tsx +50 -0
- package/src/components/checkout/components/modal/style.module.scss +68 -0
- package/src/components/checkout/components/notification-box/index.tsx +70 -0
- package/src/components/checkout/components/notification-box/style.module.scss +69 -0
- package/src/components/checkout/components/select-box/index.tsx +60 -0
- package/src/components/checkout/components/select-box/style.module.scss +55 -0
- package/src/components/checkout/components/step-container/index.tsx +107 -0
- package/src/components/checkout/components/step-container/style.module.scss +86 -0
- package/src/components/checkout/components/svg/arrow-down.tsx +23 -0
- package/src/components/checkout/components/svg/arrow-left.tsx +23 -0
- package/src/components/checkout/components/svg/arrow-right.tsx +23 -0
- package/src/components/checkout/components/svg/cross.tsx +23 -0
- package/src/components/checkout/components/svg/discount.tsx +34 -0
- package/src/components/checkout/components/svg/external.tsx +101 -0
- package/src/components/checkout/components/svg/gift.tsx +40 -0
- package/src/components/checkout/components/svg/ikas.tsx +39 -0
- package/src/components/checkout/components/svg/lock.tsx +23 -0
- package/src/components/checkout/components/svg/shopping-cart.tsx +23 -0
- package/src/components/checkout/components/svg/success-circle.tsx +26 -0
- package/src/components/checkout/components/svg/tag.tsx +23 -0
- package/src/components/checkout/components/svg/warning.tsx +30 -0
- package/src/components/checkout/components/toggle/index.tsx +51 -0
- package/src/components/checkout/components/toggle/style.module.scss +75 -0
- package/src/components/checkout/components/tooltip/index.tsx +27 -0
- package/src/components/checkout/components/tooltip/style.module.scss +86 -0
- package/src/components/checkout/index.tsx +476 -0
- package/src/components/checkout/model.ts +1007 -0
- package/src/components/checkout/steps/step-info/index.tsx +84 -0
- package/src/components/checkout/steps/step-payment/billing-address/index.tsx +40 -0
- package/src/components/checkout/steps/step-payment/index.tsx +105 -0
- package/src/components/checkout/steps/step-payment/payment-gateways/index.tsx +116 -0
- package/src/components/checkout/steps/step-payment/payment-gateways/installments/index.tsx +51 -0
- package/src/components/checkout/steps/step-payment/payment-gateways/installments/style.module.scss +50 -0
- package/src/components/checkout/steps/step-payment/payment-gateways/style.module.scss +15 -0
- package/src/components/checkout/steps/step-payment/style.module.scss +32 -0
- package/src/components/checkout/steps/step-shipping/index.tsx +127 -0
- package/src/components/checkout/steps/step-shipping/style.module.scss +44 -0
- package/src/components/checkout/steps/step-success/index.tsx +437 -0
- package/src/components/checkout/steps/step-success/style.module.scss +160 -0
- package/src/components/checkout/style.module.scss +358 -0
- package/src/components/checkout/styles/common.module.scss +59 -0
- package/src/components/checkout/styles/variables.scss +40 -0
- package/src/components/image/index.tsx +79 -0
- package/src/components/index.ts +4 -0
- package/src/components/page/ThemeComponent.tsx +89 -0
- package/src/components/page/head.tsx +294 -0
- package/src/components/page/index.tsx +216 -0
- package/src/components/page-editor/ThemeComponentEditor.tsx +236 -0
- package/src/components/page-editor/error/index.tsx +18 -0
- package/src/components/page-editor/index.tsx +70 -0
- package/src/components/page-editor/loader/index.tsx +10 -0
- package/src/components/page-editor/loader/style.module.scss +55 -0
- package/src/components/page-editor/model.ts +505 -0
- package/src/index.ts +8 -0
- package/src/models/.DS_Store +0 -0
- package/src/models/data/blog/index.ts +154 -0
- package/src/models/data/brand/index.ts +58 -0
- package/src/models/data/cart/index.ts +82 -0
- package/src/models/data/category/index.ts +130 -0
- package/src/models/data/checkout/index.ts +222 -0
- package/src/models/data/checkout-settings/index.ts +48 -0
- package/src/models/data/city/index.ts +4 -0
- package/src/models/data/contact-form/index.ts +17 -0
- package/src/models/data/country/index.ts +8 -0
- package/src/models/data/customer/address/index.tsx +135 -0
- package/src/models/data/customer/index.ts +65 -0
- package/src/models/data/customer-review/index.ts +43 -0
- package/src/models/data/customer-review-settings/index.ts +4 -0
- package/src/models/data/district/index.ts +4 -0
- package/src/models/data/favorite-product/index.ts +15 -0
- package/src/models/data/html-meta-data/index.ts +56 -0
- package/src/models/data/image/index.ts +34 -0
- package/src/models/data/index.ts +55 -0
- package/src/models/data/installment-info/index.ts +34 -0
- package/src/models/data/merchant-settings/index.ts +14 -0
- package/src/models/data/order/address/index.ts +138 -0
- package/src/models/data/order/adjustment/index.ts +17 -0
- package/src/models/data/order/gift-line/index.ts +4 -0
- package/src/models/data/order/index.ts +289 -0
- package/src/models/data/order/line-item/discount/index.ts +15 -0
- package/src/models/data/order/line-item/index.ts +123 -0
- package/src/models/data/order/line-item/options/index.ts +18 -0
- package/src/models/data/order/line-item/options/options-value/index.ts +11 -0
- package/src/models/data/order/line-item/variant/index.ts +75 -0
- package/src/models/data/order/refund/index.ts +18 -0
- package/src/models/data/order/refund/refund-line-item/index.ts +13 -0
- package/src/models/data/order/refund/settings.ts +15 -0
- package/src/models/data/order/shipping-line/index.ts +7 -0
- package/src/models/data/order-transaction/index.ts +105 -0
- package/src/models/data/payment-gateway/index.ts +150 -0
- package/src/models/data/product/attribute-value/index.ts +42 -0
- package/src/models/data/product/index.ts +95 -0
- package/src/models/data/product/variant/index.ts +93 -0
- package/src/models/data/product/variant/price/index.ts +38 -0
- package/src/models/data/product/variant-type/index.ts +24 -0
- package/src/models/data/product-attribute/index.ts +75 -0
- package/src/models/data/product-attribute/product-attribute-option/index.ts +13 -0
- package/src/models/data/product-attribute/product-attribute-table-cell/index.ts +13 -0
- package/src/models/data/product-attribute/product-attribute-table-template/index.ts +18 -0
- package/src/models/data/product-back-in-stock-settings/index.ts +3 -0
- package/src/models/data/product-cart-item-options/index.ts +15 -0
- package/src/models/data/product-filter/index.ts +412 -0
- package/src/models/data/product-option-set/index.ts +392 -0
- package/src/models/data/product-tag/index.ts +13 -0
- package/src/models/data/raffle/index.ts +159 -0
- package/src/models/data/sales-channel/index.ts +41 -0
- package/src/models/data/simple-product/index.ts +154 -0
- package/src/models/data/state/index.ts +5 -0
- package/src/models/data/storefront/domain/index.ts +19 -0
- package/src/models/data/storefront/index.ts +56 -0
- package/src/models/data/storefront/localization/index.tsx +13 -0
- package/src/models/data/storefront/routing/index.tsx +17 -0
- package/src/models/data/storefront/theme/index.tsx +22 -0
- package/src/models/data/storefront/theme-localization/index.tsx +26 -0
- package/src/models/data/variant-type/index.ts +77 -0
- package/src/models/data/variant-type/variant-value/index.ts +29 -0
- package/src/models/index.ts +3 -0
- package/src/models/theme/component/index.ts +24 -0
- package/src/models/theme/component/prop/index.ts +56 -0
- package/src/models/theme/custom-data/index.ts +71 -0
- package/{build/models/theme/index.d.ts → src/models/theme/index.ts} +26 -18
- package/src/models/theme/page/component/index.ts +21 -0
- package/src/models/theme/page/component/prop-value/attribute-list.ts +18 -0
- package/src/models/theme/page/component/prop-value/attribute.ts +18 -0
- package/src/models/theme/page/component/prop-value/blog-category-list.ts +19 -0
- package/src/models/theme/page/component/prop-value/blog-category.ts +15 -0
- package/src/models/theme/page/component/prop-value/blog-list.ts +25 -0
- package/src/models/theme/page/component/prop-value/blog.ts +15 -0
- package/src/models/theme/page/component/prop-value/brand-list.ts +26 -0
- package/src/models/theme/page/component/prop-value/brand.ts +15 -0
- package/src/models/theme/page/component/prop-value/category-list.ts +26 -0
- package/src/models/theme/page/component/prop-value/category.ts +15 -0
- package/src/models/theme/page/component/prop-value/link.ts +38 -0
- package/src/models/theme/page/component/prop-value/product-detail.ts +17 -0
- package/src/models/theme/page/component/prop-value/product-list.ts +41 -0
- package/src/models/theme/page/component/prop-value/raffle-list.ts +16 -0
- package/src/models/theme/page/component/prop-value/raffle.ts +15 -0
- package/src/models/theme/page/index.ts +71 -0
- package/src/models/theme/settings/.DS_Store +0 -0
- package/src/models/theme/settings/index.ts +27 -0
- package/src/models/theme/settings/prop/color/index.ts +18 -0
- package/src/models/theme/settings/prop/favicon/index.ts +11 -0
- package/src/models/theme/theme.ts +202 -0
- package/src/models/ui/blog-category-list/index.ts +199 -0
- package/src/models/ui/blog-list/index.ts +202 -0
- package/src/models/ui/brand-list/index.ts +239 -0
- package/src/models/ui/category-list/index.ts +239 -0
- package/src/models/ui/component-renderer/index.ts +9 -0
- package/src/models/ui/customer-review-list/index.ts +171 -0
- package/src/models/ui/index.ts +41 -0
- package/src/models/ui/navigation-link/index.ts +22 -0
- package/src/models/ui/product-attribute-detail/index.ts +29 -0
- package/src/models/ui/product-attribute-list/index.ts +53 -0
- package/src/models/ui/product-detail/index.ts +269 -0
- package/src/models/ui/product-list/index.ts +959 -0
- package/src/models/ui/raffle-list/index.ts +208 -0
- package/src/models/ui/validator/form/account-info.ts +155 -0
- package/src/models/ui/validator/form/address.ts +436 -0
- package/src/models/ui/validator/form/contact-form.ts +180 -0
- package/src/models/ui/validator/form/customer-review.ts +134 -0
- package/src/models/ui/validator/form/forgot-password.ts +98 -0
- package/src/models/ui/validator/form/login.ts +130 -0
- package/src/models/ui/validator/form/raffle-form.ts +271 -0
- package/src/models/ui/validator/form/recover-password.ts +150 -0
- package/src/models/ui/validator/form/register.ts +200 -0
- package/src/models/ui/validator/index.ts +121 -0
- package/src/models/ui/validator/rules/index.ts +309 -0
- package/src/pages/.DS_Store +0 -0
- package/src/pages/404.tsx +29 -0
- package/src/pages/[slug]/index.tsx +28 -0
- package/src/pages/account/addresses.tsx +20 -0
- package/src/pages/account/favorite-products.tsx +20 -0
- package/src/pages/account/forgot-password.tsx +20 -0
- package/src/pages/account/index.tsx +20 -0
- package/src/pages/account/login.tsx +20 -0
- package/src/pages/account/orders/[id].tsx +20 -0
- package/src/pages/account/orders/index.tsx +20 -0
- package/src/pages/account/raffles.tsx +20 -0
- package/src/pages/account/recover-password.tsx +20 -0
- package/src/pages/account/register.tsx +20 -0
- package/src/pages/api/getComponentDirs.ts +39 -0
- package/src/pages/api/getTheme.ts +22 -0
- package/src/pages/api/index.ts +14 -0
- package/src/pages/api/middleware.ts +24 -0
- package/src/pages/api/updateTheme.ts +31 -0
- package/src/pages/api/uploadTheme.ts +276 -0
- package/src/pages/blog/[slug].tsx +27 -0
- package/src/pages/blog/index.tsx +20 -0
- package/src/pages/cart.tsx +20 -0
- package/src/pages/checkout.tsx +172 -0
- package/src/pages/editor.tsx +40 -0
- package/src/pages/home.tsx +20 -0
- package/src/pages/index.ts +22 -0
- package/src/pages/pages/[slug].tsx +82 -0
- package/src/pages/raffle/[slug].tsx +27 -0
- package/src/pages/raffle/index.tsx +20 -0
- package/src/pages/search.tsx +20 -0
- package/src/providers/helpers/raffles.ts +68 -0
- package/src/providers/page-data-get.ts +569 -0
- package/src/providers/page-data-init.ts +956 -0
- package/src/providers/page-data-next.ts +422 -0
- package/src/providers/placeholders.ts +39 -0
- package/src/providers/prop-value/attribute-list.ts +73 -0
- package/src/providers/prop-value/attribute.ts +73 -0
- package/src/providers/prop-value/blog-category-list.ts +25 -0
- package/src/providers/prop-value/blog-category.ts +40 -0
- package/src/providers/prop-value/blog-list.ts +56 -0
- package/src/providers/prop-value/blog.ts +37 -0
- package/src/providers/prop-value/boolean.ts +14 -0
- package/src/providers/prop-value/brand-list.ts +21 -0
- package/src/providers/prop-value/brand.ts +47 -0
- package/src/providers/prop-value/category-list.ts +21 -0
- package/src/providers/prop-value/category.ts +47 -0
- package/src/providers/prop-value/color.ts +14 -0
- package/src/providers/prop-value/custom.ts +548 -0
- package/src/providers/prop-value/image-list.ts +15 -0
- package/src/providers/prop-value/image.ts +15 -0
- package/{build/providers/prop-value/index.d.ts → src/providers/prop-value/index.ts} +3 -3
- package/src/providers/prop-value/link.ts +214 -0
- package/src/providers/prop-value/product-detail.ts +87 -0
- package/src/providers/prop-value/product-list.ts +69 -0
- package/src/providers/prop-value/raffle-list.ts +14 -0
- package/src/providers/prop-value/raffle.ts +43 -0
- package/src/providers/prop-value/rich-text.ts +14 -0
- package/src/providers/prop-value/text.ts +14 -0
- package/src/scripts/generators/api/index.ts +24 -0
- package/src/scripts/generators/api/info.ts +47 -0
- package/src/scripts/generators/components/index.ts +235 -0
- package/src/scripts/generators/config/content.ts +125 -0
- package/src/scripts/generators/config/index.ts +93 -0
- package/src/scripts/generators/pages/index.ts +95 -0
- package/src/scripts/generators/pages/info.ts +156 -0
- package/src/scripts/generators/store/content.ts +14 -0
- package/src/scripts/generators/store/index.ts +22 -0
- package/src/scripts/generators/theme/index.ts +37 -0
- package/src/scripts/ikas.ts +47 -0
- package/src/store/base.ts +143 -0
- package/src/store/cart.ts +311 -0
- package/src/store/customer.ts +510 -0
- package/{build/store/index.d.ts → src/store/index.ts} +1 -1
- package/src/storefront/index.ts +96 -0
- package/src/typings/global.d.ts +7 -0
- package/src/utils/currency.ts +229 -0
- package/src/utils/fs.ts +84 -0
- package/src/utils/helper.ts +133 -0
- package/src/utils/i18n.ts +204 -0
- package/{build/utils/index.d.ts → src/utils/index.ts} +3 -3
- package/build/__generated__/global-types.d.ts +0 -632
- package/build/analytics/analytics.d.ts +0 -37
- package/build/analytics/events.d.ts +0 -36
- package/build/analytics/facebookPixel.d.ts +0 -15
- package/build/analytics/googleTagManager.d.ts +0 -201
- package/build/analytics/head/index.d.ts +0 -7
- package/build/analytics/ikas.d.ts +0 -133
- package/build/api/apollo.d.ts +0 -10
- package/build/api/back-in-stock-reminder/__generated__/listProductBackInStockRemind.d.ts +0 -24
- package/build/api/back-in-stock-reminder/__generated__/saveProductBackInStockRemind.d.ts +0 -19
- package/build/api/back-in-stock-reminder/index.d.ts +0 -23
- package/build/api/blog/__generated__/getBlog.d.ts +0 -106
- package/build/api/blog/__generated__/listBlog.d.ts +0 -109
- package/build/api/blog/__generated__/listBlogCategory.d.ts +0 -61
- package/build/api/blog/__generated__/listBlogMetaData.d.ts +0 -53
- package/build/api/blog/index.d.ts +0 -32
- package/build/api/brand/__generated__/listProductBrand.d.ts +0 -88
- package/build/api/brand/index.d.ts +0 -16
- package/build/api/cart/__generated__/getCart.d.ts +0 -176
- package/build/api/cart/__generated__/saveItemToCart.d.ts +0 -185
- package/build/api/cart/index.d.ts +0 -5
- package/build/api/category/__generated__/listCategory.d.ts +0 -99
- package/build/api/category/__generated__/listCategoryPaths.d.ts +0 -32
- package/build/api/category/index.d.ts +0 -18
- package/build/api/checkout/__generated__/addCouponCodeToCheckout.d.ts +0 -11
- package/build/api/checkout/__generated__/checkStocks.d.ts +0 -18
- package/build/api/checkout/__generated__/createSaleTransactionWithCheckout.d.ts +0 -22
- package/build/api/checkout/__generated__/getCheckoutByCartId.d.ts +0 -10
- package/build/api/checkout/__generated__/getCheckoutById.d.ts +0 -572
- package/build/api/checkout/__generated__/getOrder.d.ts +0 -614
- package/build/api/checkout/__generated__/listCheckoutSettings.d.ts +0 -34
- package/build/api/checkout/__generated__/listPaymentGateway.d.ts +0 -42
- package/build/api/checkout/__generated__/retrieveInstallmentInfo.d.ts +0 -23
- package/build/api/checkout/__generated__/saveCheckout.d.ts +0 -11
- package/build/api/checkout/index.d.ts +0 -29
- package/build/api/city/__generated__/listCity.d.ts +0 -20
- package/build/api/city/index.d.ts +0 -4
- package/build/api/contact-form/__generated__/sendContactFormToMerchant.d.ts +0 -9
- package/build/api/contact-form/index.d.ts +0 -10
- package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +0 -6
- package/build/api/country/__generated__/getMyCountry.d.ts +0 -3
- package/build/api/country/__generated__/listCountry.d.ts +0 -41
- package/build/api/country/index.d.ts +0 -6
- package/build/api/customer/__generated__/checkCustomerEmail.d.ts +0 -10
- package/build/api/customer/__generated__/createCustomerEmailSubscription.d.ts +0 -11
- package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +0 -584
- package/build/api/customer/__generated__/customerForgotPassword.d.ts +0 -7
- package/build/api/customer/__generated__/customerLogin.d.ts +0 -162
- package/build/api/customer/__generated__/customerRecoverPassword.d.ts +0 -8
- package/build/api/customer/__generated__/customerRefreshToken.d.ts +0 -11
- package/build/api/customer/__generated__/customerSocialLogin.d.ts +0 -161
- package/build/api/customer/__generated__/getCustomerOrders.d.ts +0 -614
- package/build/api/customer/__generated__/getLastViewedProducts.d.ts +0 -15
- package/build/api/customer/__generated__/getMyCustomer.d.ts +0 -140
- package/build/api/customer/__generated__/listOrderRefundSettings.d.ts +0 -13
- package/build/api/customer/__generated__/listOrderTransactions.d.ts +0 -53
- package/build/api/customer/__generated__/registerCustomer.d.ts +0 -158
- package/build/api/customer/__generated__/saveLastViewedProducts.d.ts +0 -11
- package/build/api/customer/__generated__/saveMyCustomer.d.ts +0 -155
- package/build/api/customer/index.d.ts +0 -49
- package/build/api/customer-review/__generated__/createCustomerReview.d.ts +0 -11
- package/build/api/customer-review/__generated__/listCustomerReviews.d.ts +0 -48
- package/build/api/customer-review/index.d.ts +0 -24
- package/build/api/district/__generated__/listDistrict.d.ts +0 -16
- package/build/api/district/index.d.ts +0 -4
- package/build/api/favorite-product/__generated__/isFavoriteProduct.d.ts +0 -6
- package/build/api/favorite-product/__generated__/listFavoriteProducts.d.ts +0 -12
- package/build/api/favorite-product/__generated__/saveFavoriteProduct.d.ts +0 -7
- package/build/api/favorite-product/index.d.ts +0 -6
- package/build/api/html-meta-data/__generated__/listHTMLMetaData.d.ts +0 -28
- package/build/api/html-meta-data/index.d.ts +0 -4
- package/build/api/index.d.ts +0 -21
- package/build/api/merchant/__generated__/listMerchantSettings.d.ts +0 -9
- package/build/api/merchant/index.d.ts +0 -4
- package/build/api/product-attribute/__generated__/listProductAttribute.d.ts +0 -72
- package/build/api/product-attribute/index.d.ts +0 -4
- package/build/api/product-option-set/__generated__/ListProductOptionSet.d.ts +0 -90
- package/build/api/product-option-set/index.d.ts +0 -6
- package/build/api/product-search/__generated__/getProductFilterData.d.ts +0 -61
- package/build/api/product-search/__generated__/searchProducts.d.ts +0 -26
- package/build/api/product-search/index.d.ts +0 -20
- package/build/api/state/__generated__/listState.d.ts +0 -19
- package/build/api/state/index.d.ts +0 -4
- package/build/api/stock-location/__generated__/listStockLocation.d.ts +0 -7
- package/build/api/stock-location/index.d.ts +0 -4
- package/build/api/storefront/__generated__/getStorefront.d.ts +0 -52
- package/build/api/storefront/index.d.ts +0 -4
- package/build/api/variant-type/__generated__/listVariantType.d.ts +0 -72
- package/build/api/variant-type/index.d.ts +0 -4
- package/build/components/checkout/components/address-form/index.d.ts +0 -3
- package/build/components/checkout/components/address-form/model.d.ts +0 -131
- package/build/components/checkout/components/button/index.d.ts +0 -12
- package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +0 -10
- package/build/components/checkout/components/cart-summary/index.d.ts +0 -8
- package/build/components/checkout/components/checkbox/check.d.ts +0 -6
- package/build/components/checkout/components/checkbox/index.d.ts +0 -10
- package/build/components/checkout/components/credit-card-form/index.d.ts +0 -7
- package/build/components/checkout/components/credit-card-form/model.d.ts +0 -26
- package/build/components/checkout/components/credit-card-form/svg/amex.d.ts +0 -6
- package/build/components/checkout/components/credit-card-form/svg/master-card.d.ts +0 -6
- package/build/components/checkout/components/credit-card-form/svg/troy.d.ts +0 -6
- package/build/components/checkout/components/credit-card-form/svg/visa.d.ts +0 -6
- package/build/components/checkout/components/customer-addresses/index.d.ts +0 -15
- package/build/components/checkout/components/customer-addresses/model.d.ts +0 -21
- package/build/components/checkout/components/error/customer-login-required-error/index.d.ts +0 -8
- package/build/components/checkout/components/error/index.d.ts +0 -7
- package/build/components/checkout/components/error/no-shipping-error/index.d.ts +0 -6
- package/build/components/checkout/components/error/payment-error/index.d.ts +0 -8
- package/build/components/checkout/components/error/stock-error/index.d.ts +0 -8
- package/build/components/checkout/components/error/unknown-error/index.d.ts +0 -6
- package/build/components/checkout/components/expandable-section/index.d.ts +0 -6
- package/build/components/checkout/components/form-item/caret-down.d.ts +0 -6
- package/build/components/checkout/components/form-item/index.d.ts +0 -3
- package/build/components/checkout/components/form-item/model.d.ts +0 -59
- package/build/components/checkout/components/fullscreen-loading/index.d.ts +0 -2
- package/build/components/checkout/components/input-with-button/index.d.ts +0 -11
- package/build/components/checkout/components/modal/index.d.ts +0 -8
- package/build/components/checkout/components/notification-box/index.d.ts +0 -9
- package/build/components/checkout/components/select-box/index.d.ts +0 -13
- package/build/components/checkout/components/step-container/index.d.ts +0 -15
- package/build/components/checkout/components/svg/arrow-down.d.ts +0 -6
- package/build/components/checkout/components/svg/arrow-left.d.ts +0 -6
- package/build/components/checkout/components/svg/arrow-right.d.ts +0 -6
- package/build/components/checkout/components/svg/cross.d.ts +0 -6
- package/build/components/checkout/components/svg/discount.d.ts +0 -6
- package/build/components/checkout/components/svg/external.d.ts +0 -6
- package/build/components/checkout/components/svg/gift.d.ts +0 -7
- package/build/components/checkout/components/svg/ikas.d.ts +0 -6
- package/build/components/checkout/components/svg/lock.d.ts +0 -6
- package/build/components/checkout/components/svg/shopping-cart.d.ts +0 -6
- package/build/components/checkout/components/svg/success-circle.d.ts +0 -6
- package/build/components/checkout/components/svg/tag.d.ts +0 -6
- package/build/components/checkout/components/svg/warning.d.ts +0 -6
- package/build/components/checkout/components/toggle/index.d.ts +0 -10
- package/build/components/checkout/components/tooltip/index.d.ts +0 -8
- package/build/components/checkout/index.d.ts +0 -32
- package/build/components/checkout/model.d.ts +0 -122
- package/build/components/checkout/steps/step-info/index.d.ts +0 -7
- package/build/components/checkout/steps/step-payment/billing-address/index.d.ts +0 -7
- package/build/components/checkout/steps/step-payment/index.d.ts +0 -7
- package/build/components/checkout/steps/step-payment/payment-gateways/index.d.ts +0 -7
- package/build/components/checkout/steps/step-payment/payment-gateways/installments/index.d.ts +0 -7
- package/build/components/checkout/steps/step-shipping/index.d.ts +0 -7
- package/build/components/checkout/steps/step-success/index.d.ts +0 -7
- package/build/components/error/index.d.ts +0 -5
- package/build/components/image/index.d.ts +0 -36
- package/build/components/index.d.ts +0 -4
- package/build/components/page/ThemeComponent.d.ts +0 -10
- package/build/components/page/head.d.ts +0 -12
- package/build/components/page/index.d.ts +0 -17
- package/build/components/page-editor/ThemeComponentEditor.d.ts +0 -9
- package/build/components/page-editor/index.d.ts +0 -2
- package/build/components/page-editor/model.d.ts +0 -65
- package/build/index.css +0 -1521
- package/build/index.d.ts +0 -8
- package/build/index.es.css +0 -1521
- package/build/index.es.js +0 -74627
- package/build/index.js +0 -74756
- package/build/models/data/blog/index.d.ts +0 -67
- package/build/models/data/brand/index.d.ts +0 -21
- package/build/models/data/cart/index.d.ts +0 -47
- package/build/models/data/category/index.d.ts +0 -52
- package/build/models/data/checkout/index.d.ts +0 -103
- package/build/models/data/checkout-settings/index.d.ts +0 -25
- package/build/models/data/city/index.d.ts +0 -4
- package/build/models/data/contact-form/index.d.ts +0 -7
- package/build/models/data/country/index.d.ts +0 -8
- package/build/models/data/customer/address/index.d.ts +0 -52
- package/build/models/data/customer/index.d.ts +0 -33
- package/build/models/data/customer-review/index.d.ts +0 -23
- package/build/models/data/customer-review-settings/index.d.ts +0 -4
- package/build/models/data/district/index.d.ts +0 -4
- package/build/models/data/favorite-product/index.d.ts +0 -6
- package/build/models/data/html-meta-data/index.d.ts +0 -23
- package/build/models/data/image/index.d.ts +0 -8
- package/build/models/data/index.d.ts +0 -33
- package/build/models/data/installment-info/index.d.ts +0 -30
- package/build/models/data/merchant-settings/index.d.ts +0 -8
- package/build/models/data/order/address/index.d.ts +0 -51
- package/build/models/data/order/adjustment/index.d.ts +0 -16
- package/build/models/data/order/gift-line/index.d.ts +0 -4
- package/build/models/data/order/index.d.ts +0 -146
- package/build/models/data/order/line-item/discount/index.d.ts +0 -11
- package/build/models/data/order/line-item/index.d.ts +0 -43
- package/build/models/data/order/line-item/options/index.d.ts +0 -10
- package/build/models/data/order/line-item/options/options-value/index.d.ts +0 -6
- package/build/models/data/order/line-item/variant/index.d.ts +0 -25
- package/build/models/data/order/refund/index.d.ts +0 -6
- package/build/models/data/order/refund/refund-line-item/index.d.ts +0 -5
- package/build/models/data/order/refund/settings.d.ts +0 -6
- package/build/models/data/order/shipping-line/index.d.ts +0 -7
- package/build/models/data/order-transaction/index.d.ts +0 -74
- package/build/models/data/payment-gateway/index.d.ts +0 -61
- package/build/models/data/product/attribute-value/index.d.ts +0 -20
- package/build/models/data/product/index.d.ts +0 -35
- package/build/models/data/product/variant/index.d.ts +0 -24
- package/build/models/data/product/variant/price/index.d.ts +0 -11
- package/build/models/data/product/variant-type/index.d.ts +0 -6
- package/build/models/data/product-attribute/index.d.ts +0 -34
- package/build/models/data/product-attribute/product-attribute-option/index.d.ts +0 -5
- package/build/models/data/product-attribute/product-attribute-table-cell/index.d.ts +0 -5
- package/build/models/data/product-attribute/product-attribute-table-template/index.d.ts +0 -6
- package/build/models/data/product-back-in-stock-settings/index.d.ts +0 -3
- package/build/models/data/product-cart-item-options/index.d.ts +0 -6
- package/build/models/data/product-filter/index.d.ts +0 -109
- package/build/models/data/product-option-set/index.d.ts +0 -104
- package/build/models/data/product-tag/index.d.ts +0 -5
- package/build/models/data/sales-channel/index.d.ts +0 -18
- package/build/models/data/simple-product/index.d.ts +0 -136
- package/build/models/data/state/index.d.ts +0 -5
- package/build/models/data/storefront/domain/index.d.ts +0 -8
- package/build/models/data/storefront/index.d.ts +0 -23
- package/build/models/data/storefront/localization/index.d.ts +0 -7
- package/build/models/data/storefront/routing/index.d.ts +0 -9
- package/build/models/data/storefront/theme/index.d.ts +0 -13
- package/build/models/data/storefront/theme-localization/index.d.ts +0 -12
- package/build/models/data/variant-type/index.d.ts +0 -26
- package/build/models/data/variant-type/variant-value/index.d.ts +0 -11
- package/build/models/index.d.ts +0 -3
- package/build/models/theme/component/index.d.ts +0 -10
- package/build/models/theme/component/prop/index.d.ts +0 -40
- package/build/models/theme/custom-data/index.d.ts +0 -24
- package/build/models/theme/page/component/index.d.ts +0 -6
- package/build/models/theme/page/component/prop-value/attribute-list.d.ts +0 -7
- package/build/models/theme/page/component/prop-value/attribute.d.ts +0 -7
- package/build/models/theme/page/component/prop-value/blog-category-list.d.ts +0 -7
- package/build/models/theme/page/component/prop-value/blog-category.d.ts +0 -5
- package/build/models/theme/page/component/prop-value/blog-list.d.ts +0 -9
- package/build/models/theme/page/component/prop-value/blog.d.ts +0 -5
- package/build/models/theme/page/component/prop-value/brand-list.d.ts +0 -9
- package/build/models/theme/page/component/prop-value/brand.d.ts +0 -5
- package/build/models/theme/page/component/prop-value/category-list.d.ts +0 -9
- package/build/models/theme/page/component/prop-value/category.d.ts +0 -5
- package/build/models/theme/page/component/prop-value/link.d.ts +0 -19
- package/build/models/theme/page/component/prop-value/product-detail.d.ts +0 -6
- package/build/models/theme/page/component/prop-value/product-list.d.ts +0 -17
- package/build/models/theme/page/index.d.ts +0 -40
- package/build/models/theme/settings/index.d.ts +0 -13
- package/build/models/theme/settings/prop/color/index.d.ts +0 -7
- package/build/models/theme/settings/prop/favicon/index.d.ts +0 -4
- package/build/models/theme/theme.d.ts +0 -16
- package/build/models/ui/blog-category-list/index.d.ts +0 -52
- package/build/models/ui/blog-list/index.d.ts +0 -56
- package/build/models/ui/brand-list/index.d.ts +0 -61
- package/build/models/ui/category-list/index.d.ts +0 -61
- package/build/models/ui/component-renderer/index.d.ts +0 -7
- package/build/models/ui/customer-review-list/index.d.ts +0 -43
- package/build/models/ui/index.d.ts +0 -22
- package/build/models/ui/navigation-link/index.d.ts +0 -8
- package/build/models/ui/product-attribute-detail/index.d.ts +0 -8
- package/build/models/ui/product-attribute-list/index.d.ts +0 -9
- package/build/models/ui/product-detail/index.d.ts +0 -28
- package/build/models/ui/product-list/index.d.ts +0 -132
- package/build/models/ui/validator/form/account-info.d.ts +0 -40
- package/build/models/ui/validator/form/address.d.ts +0 -75
- package/build/models/ui/validator/form/contact-form.d.ts +0 -45
- package/build/models/ui/validator/form/customer-review.d.ts +0 -37
- package/build/models/ui/validator/form/forgot-password.d.ts +0 -29
- package/build/models/ui/validator/form/login.d.ts +0 -35
- package/build/models/ui/validator/form/recover-password.d.ts +0 -36
- package/build/models/ui/validator/form/register.d.ts +0 -48
- package/build/models/ui/validator/index.d.ts +0 -27
- package/build/models/ui/validator/rules/index.d.ts +0 -87
- package/build/pages/404.d.ts +0 -6
- package/build/pages/[slug]/index.d.ts +0 -7
- package/build/pages/account/addresses.d.ts +0 -6
- package/build/pages/account/favorite-products.d.ts +0 -6
- package/build/pages/account/forgot-password.d.ts +0 -6
- package/build/pages/account/index.d.ts +0 -6
- package/build/pages/account/login.d.ts +0 -6
- package/build/pages/account/orders/[id].d.ts +0 -6
- package/build/pages/account/orders/index.d.ts +0 -6
- package/build/pages/account/recover-password.d.ts +0 -6
- package/build/pages/account/register.d.ts +0 -6
- package/build/pages/blog/[slug].d.ts +0 -7
- package/build/pages/blog/index.d.ts +0 -6
- package/build/pages/cart.d.ts +0 -6
- package/build/pages/checkout.d.ts +0 -18
- package/build/pages/editor.d.ts +0 -8
- package/build/pages/home.d.ts +0 -6
- package/build/pages/index.d.ts +0 -20
- package/build/pages/pages/[slug].d.ts +0 -7
- package/build/pages/search.d.ts +0 -6
- package/build/providers/page-data-get.d.ts +0 -61
- package/build/providers/page-data-init.d.ts +0 -58
- package/build/providers/page-data-next.d.ts +0 -243
- package/build/providers/placeholders.d.ts +0 -6
- package/build/providers/prop-value/attribute-list.d.ts +0 -12
- package/build/providers/prop-value/attribute.d.ts +0 -12
- package/build/providers/prop-value/blog-category-list.d.ts +0 -7
- package/build/providers/prop-value/blog-category.d.ts +0 -11
- package/build/providers/prop-value/blog-list.d.ts +0 -9
- package/build/providers/prop-value/blog.d.ts +0 -11
- package/build/providers/prop-value/boolean.d.ts +0 -6
- package/build/providers/prop-value/brand-list.d.ts +0 -7
- package/build/providers/prop-value/brand.d.ts +0 -11
- package/build/providers/prop-value/category-list.d.ts +0 -7
- package/build/providers/prop-value/category.d.ts +0 -11
- package/build/providers/prop-value/checkout.d.ts +0 -4
- package/build/providers/prop-value/color.d.ts +0 -6
- package/build/providers/prop-value/custom.d.ts +0 -42
- package/build/providers/prop-value/image-list.d.ts +0 -7
- package/build/providers/prop-value/image.d.ts +0 -7
- package/build/providers/prop-value/link.d.ts +0 -16
- package/build/providers/prop-value/product-detail.d.ts +0 -11
- package/build/providers/prop-value/product-list.d.ts +0 -9
- package/build/providers/prop-value/rich-text.d.ts +0 -6
- package/build/providers/prop-value/text.d.ts +0 -6
- package/build/store/base.d.ts +0 -25
- package/build/store/cart.d.ts +0 -30
- package/build/store/customer.d.ts +0 -91
- package/build/storefront/index.d.ts +0 -55
- package/build/utils/currency.d.ts +0 -7
- package/build/utils/helper.d.ts +0 -8
- package/build/utils/i18n.d.ts +0 -20
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const SVGVisa: React.FC<Props> = ({ className }) => (
|
|
8
|
+
<svg
|
|
9
|
+
width="32"
|
|
10
|
+
height="24"
|
|
11
|
+
viewBox="0 0 32 24"
|
|
12
|
+
fill="none"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
className={className}
|
|
15
|
+
>
|
|
16
|
+
<path
|
|
17
|
+
d="M2 0.5H30C30.8284 0.5 31.5 1.17157 31.5 2V22C31.5 22.8284 30.8284 23.5 30 23.5H2C1.17157 23.5 0.5 22.8284 0.5 22V2C0.5 1.17157 1.17157 0.5 2 0.5Z"
|
|
18
|
+
fill="white"
|
|
19
|
+
stroke="#E5E4E9"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
fillRule="evenodd"
|
|
23
|
+
clipRule="evenodd"
|
|
24
|
+
d="M12.6875 15.1655H14.5025L15.6385 8.50391H13.8228L12.6875 15.1655Z"
|
|
25
|
+
fill="#1A1876"
|
|
26
|
+
/>
|
|
27
|
+
<path
|
|
28
|
+
fillRule="evenodd"
|
|
29
|
+
clipRule="evenodd"
|
|
30
|
+
d="M19.2995 11.1787C18.6651 10.8705 18.2762 10.6646 18.2804 10.3529C18.2804 10.076 18.6095 9.77969 19.3204 9.77969C19.902 9.77065 20.3709 9.88891 20.8425 10.1115L21.0888 8.66735C20.7291 8.53239 20.1656 8.3877 19.4616 8.3877C17.6675 8.3877 16.4035 9.29135 16.3931 10.586C16.3827 11.5432 17.2954 12.0774 17.9841 12.396C18.6909 12.7223 18.9288 12.931 18.9253 13.2225C18.9211 13.6691 18.3611 13.8729 17.8387 13.8729C17.0331 13.8729 16.6269 13.7484 15.8957 13.4173L15.6411 14.9087C16.0655 15.0945 16.8495 15.2559 17.6641 15.2642C19.5729 15.2642 20.8119 14.371 20.8258 12.988C20.8307 12.2305 20.3472 11.6538 19.2995 11.1787Z"
|
|
31
|
+
fill="#1A1876"
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d="M25.7438 8.50977H24.3407C23.9059 8.50977 23.581 8.62872 23.3897 9.06211L20.6934 15.1672H22.6001C22.6001 15.1672 22.9118 14.3463 22.9827 14.1661C23.1914 14.1661 25.0433 14.1689 25.3083 14.1689C25.3626 14.4019 25.5295 15.1672 25.5295 15.1672H27.2144L25.7438 8.50977ZM23.5052 12.804C23.5803 12.612 24.3212 10.7094 24.4694 10.3059C24.7149 11.4545 24.4756 10.34 25.0127 12.804H23.5052Z"
|
|
35
|
+
fill="#1A1876"
|
|
36
|
+
/>
|
|
37
|
+
<path
|
|
38
|
+
fillRule="evenodd"
|
|
39
|
+
clipRule="evenodd"
|
|
40
|
+
d="M11.1646 8.50906L9.38648 13.0517L9.19726 12.1285L8.56074 9.06697C8.45083 8.6454 8.13222 8.51949 7.73778 8.50488H4.80909L4.78613 8.64332C5.49848 8.81584 6.135 9.06488 6.69361 9.37375L8.30822 15.1595L10.2296 15.1574L13.088 8.50836H11.1646V8.50906Z"
|
|
41
|
+
fill="#1A1876"
|
|
42
|
+
/>
|
|
43
|
+
</svg>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export default SVGVisa;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import checkoutStyles from "../../style.module.scss";
|
|
4
|
+
import SelectBox from "../select-box";
|
|
5
|
+
|
|
6
|
+
import { AddressForm } from "../address-form";
|
|
7
|
+
import { Checkbox } from "../checkbox";
|
|
8
|
+
import { FormItem } from "../form-item";
|
|
9
|
+
import { FormItemType } from "../form-item/model";
|
|
10
|
+
|
|
11
|
+
import styles from "./style.module.scss";
|
|
12
|
+
import commonStyles from "../../styles/common.module.scss";
|
|
13
|
+
import { Button } from "../button";
|
|
14
|
+
import CustomerAddressesViewModel from "./model";
|
|
15
|
+
import { useTranslation } from "../../../../utils";
|
|
16
|
+
|
|
17
|
+
type Props = {
|
|
18
|
+
vm: CustomerAddressesViewModel;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const CustomerAddresses: React.FC<Props> = ({ vm }) => {
|
|
22
|
+
const { t } = useTranslation();
|
|
23
|
+
const addressForm = React.useMemo(
|
|
24
|
+
() => (
|
|
25
|
+
<div>
|
|
26
|
+
<CustomerAddressForm vm={vm} />
|
|
27
|
+
<SaveAddressCheckboxAndTitle vm={vm} />
|
|
28
|
+
</div>
|
|
29
|
+
),
|
|
30
|
+
[vm]
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<React.Fragment>
|
|
35
|
+
<div className={commonStyles.FormSectionTitle}>
|
|
36
|
+
<div className={commonStyles.Title}>
|
|
37
|
+
{vm.editingCustomerAddress
|
|
38
|
+
? t("checkout-page:editAddress")
|
|
39
|
+
: vm.addressType === "billing"
|
|
40
|
+
? t("checkout-page:billingAddress")
|
|
41
|
+
: t("checkout-page:shippingAddress")}
|
|
42
|
+
</div>
|
|
43
|
+
{!!vm.editingCustomerAddress && (
|
|
44
|
+
<div
|
|
45
|
+
className={styles.CancelEdit}
|
|
46
|
+
onClick={vm.onCancelEditAddressClick}
|
|
47
|
+
>
|
|
48
|
+
{t("checkout-page:actions.cancel")}
|
|
49
|
+
</div>
|
|
50
|
+
)}
|
|
51
|
+
</div>
|
|
52
|
+
{!!vm.vm.store.customerStore.customer && !vm.editingCustomerAddress && (
|
|
53
|
+
<div className={checkoutStyles.RowPB}>
|
|
54
|
+
{vm.vm.store.customerStore.customer.addresses.map((address) => (
|
|
55
|
+
<SelectBox
|
|
56
|
+
key={address.id}
|
|
57
|
+
label={address.title || ""}
|
|
58
|
+
isSelected={address.id === vm.selectedAddressId}
|
|
59
|
+
rightContent={
|
|
60
|
+
<div onClick={() => vm.onEditAddressClick(address)}>
|
|
61
|
+
{t("checkout-page:actions.edit")}
|
|
62
|
+
</div>
|
|
63
|
+
}
|
|
64
|
+
bottomContent={
|
|
65
|
+
<div className={styles.AddressText}>{address.addressText}</div>
|
|
66
|
+
}
|
|
67
|
+
bottomContentVisible={true}
|
|
68
|
+
hasError={!address.isValid}
|
|
69
|
+
errorText={t("checkout-page:missingAddressFields")}
|
|
70
|
+
onClick={() =>
|
|
71
|
+
address.id !== vm.selectedAddressId &&
|
|
72
|
+
vm.onAddressSelect(address)
|
|
73
|
+
}
|
|
74
|
+
/>
|
|
75
|
+
))}
|
|
76
|
+
<SelectBox
|
|
77
|
+
label={t("checkout-page:newAddress")}
|
|
78
|
+
isSelected={"-1" === vm.selectedAddressId}
|
|
79
|
+
bottomContent={addressForm}
|
|
80
|
+
onClick={() =>
|
|
81
|
+
vm.selectedAddressId !== "-1" && vm.onAddressSelect()
|
|
82
|
+
}
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
{!vm.vm.store.customerStore.customer && addressForm}
|
|
87
|
+
{!!vm.editingCustomerAddress && <CustomerAddressForm vm={vm} />}
|
|
88
|
+
{!!vm.editingCustomerAddress && (
|
|
89
|
+
<div className={styles.EditAddressActions}>
|
|
90
|
+
<Button
|
|
91
|
+
style={{
|
|
92
|
+
width: "100%",
|
|
93
|
+
}}
|
|
94
|
+
text={t("checkout-page:deleteAddress")}
|
|
95
|
+
isLine={true}
|
|
96
|
+
isLoading={vm.isDeleteAddressLoading}
|
|
97
|
+
isDisabled={vm.isEditAddressLoading}
|
|
98
|
+
onClick={vm.onDeleteAddressClick}
|
|
99
|
+
/>
|
|
100
|
+
<Button
|
|
101
|
+
style={{
|
|
102
|
+
width: "100%",
|
|
103
|
+
marginTop: vm.vm.store.customerStore.customer ? "0px" : "32px",
|
|
104
|
+
}}
|
|
105
|
+
text={t("checkout-page:actions.save")}
|
|
106
|
+
isLoading={vm.isEditAddressLoading}
|
|
107
|
+
isDisabled={vm.isDeleteAddressLoading}
|
|
108
|
+
onClick={vm.onSaveAddressClick}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
)}
|
|
112
|
+
</React.Fragment>
|
|
113
|
+
);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export default observer(CustomerAddresses);
|
|
117
|
+
|
|
118
|
+
type CustomerAddressFormProps = {
|
|
119
|
+
vm: CustomerAddressesViewModel;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const CustomerAddressForm: React.FC<CustomerAddressFormProps> = observer(
|
|
123
|
+
({ vm }) => {
|
|
124
|
+
return (
|
|
125
|
+
<AddressForm
|
|
126
|
+
address={vm.editingCustomerAddress || vm.address!}
|
|
127
|
+
isErrorsVisible={vm.isEditAddressErrorsVisible || vm.vm.isErrorsVisible}
|
|
128
|
+
allowedCountryIds={vm.vm.shippingCountryIds || undefined}
|
|
129
|
+
allowCorporateInfo={vm.addressType === "billing"}
|
|
130
|
+
firstNameChangeCallback={vm.firstNameChangeCallback}
|
|
131
|
+
lastNameChangeCallback={vm.lastNameChangeCallback}
|
|
132
|
+
allowTitleChange={!!vm.editingCustomerAddress}
|
|
133
|
+
/>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
type SaveAddressProps = {
|
|
139
|
+
vm: CustomerAddressesViewModel;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const SaveAddressCheckboxAndTitle: React.FC<SaveAddressProps> = observer(
|
|
143
|
+
({ vm }) => {
|
|
144
|
+
const { t } = useTranslation();
|
|
145
|
+
|
|
146
|
+
return !!vm.vm.store.customerStore.customer &&
|
|
147
|
+
vm.selectedAddressId === "-1" ? (
|
|
148
|
+
<div style={{ marginTop: "12px" }}>
|
|
149
|
+
<Checkbox
|
|
150
|
+
value={vm.vm.shouldSaveAddress}
|
|
151
|
+
label={t("checkout-page:saveAddressCta")}
|
|
152
|
+
onChange={vm.vm.setShouldSaveAddress}
|
|
153
|
+
/>
|
|
154
|
+
{vm.vm.shouldSaveAddress && (
|
|
155
|
+
<div style={{ marginTop: "8px" }}>
|
|
156
|
+
<FormItem
|
|
157
|
+
type={FormItemType.TEXT}
|
|
158
|
+
label={t("checkout-page:addressTitle")}
|
|
159
|
+
value={vm.vm.addressTitle}
|
|
160
|
+
onChange={vm.vm.setAddressTitle}
|
|
161
|
+
/>
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
</div>
|
|
165
|
+
) : null;
|
|
166
|
+
}
|
|
167
|
+
);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { IkasCustomerAddress } from "../../../../models";
|
|
2
|
+
import { makeAutoObservable } from "mobx";
|
|
3
|
+
import CheckoutViewModel from "../../model";
|
|
4
|
+
import _cloneDeep from "lodash/cloneDeep";
|
|
5
|
+
|
|
6
|
+
export type AddressType = "shipping" | "billing";
|
|
7
|
+
|
|
8
|
+
export default class CustomerAddressesViewModel {
|
|
9
|
+
vm: CheckoutViewModel;
|
|
10
|
+
addressType: AddressType;
|
|
11
|
+
|
|
12
|
+
editingCustomerAddress: IkasCustomerAddress | null = null;
|
|
13
|
+
isDeleteAddressLoading = false;
|
|
14
|
+
isEditAddressLoading = false;
|
|
15
|
+
isEditAddressErrorsVisible = false;
|
|
16
|
+
|
|
17
|
+
constructor(vm: CheckoutViewModel, addressType: AddressType) {
|
|
18
|
+
this.vm = vm;
|
|
19
|
+
this.addressType = addressType;
|
|
20
|
+
|
|
21
|
+
makeAutoObservable(this);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get address() {
|
|
25
|
+
if (this.addressType === "shipping")
|
|
26
|
+
return this.vm.checkout.shippingAddress;
|
|
27
|
+
else return this.vm.checkout.billingAddress;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get selectedAddressId() {
|
|
31
|
+
if (this.addressType === "shipping")
|
|
32
|
+
return this.vm.selectedShippingAddressId;
|
|
33
|
+
else return this.vm.selectedBillingAddressId;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onAddressSelect = (address?: IkasCustomerAddress) => {
|
|
37
|
+
const setAddressId =
|
|
38
|
+
this.addressType === "shipping"
|
|
39
|
+
? this.vm.onSelectedShippingAddressIdChange
|
|
40
|
+
: this.vm.onSelectedBillingAddressIdChange;
|
|
41
|
+
|
|
42
|
+
setAddressId(address?.id || "-1");
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
onEditAddressClick = (address?: IkasCustomerAddress) => {
|
|
46
|
+
const _address = new IkasCustomerAddress(_cloneDeep(address) as any);
|
|
47
|
+
_address.checkoutSettings = this.vm.checkoutSettings;
|
|
48
|
+
this.editingCustomerAddress = _address;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
onCancelEditAddressClick = () => {
|
|
52
|
+
if (this.isDeleteAddressLoading || this.isEditAddressLoading) return;
|
|
53
|
+
this.editingCustomerAddress = null;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
onDeleteAddressClick = async () => {
|
|
57
|
+
const addressIndex = this.vm.store.customerStore.customer?.addresses.findIndex(
|
|
58
|
+
(a) => a.id === this.editingCustomerAddress?.id
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
if (addressIndex !== -1 && addressIndex !== undefined) {
|
|
62
|
+
const customer = _cloneDeep(this.vm.store.customerStore.customer)!;
|
|
63
|
+
customer.addresses.splice(addressIndex, 1);
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
this.isDeleteAddressLoading = true;
|
|
67
|
+
const saveSuccess = await this.vm.store.customerStore.saveCustomer(
|
|
68
|
+
customer
|
|
69
|
+
);
|
|
70
|
+
if (saveSuccess) {
|
|
71
|
+
this.editingCustomerAddress = null;
|
|
72
|
+
}
|
|
73
|
+
} catch {
|
|
74
|
+
// TODO show error
|
|
75
|
+
} finally {
|
|
76
|
+
this.isDeleteAddressLoading = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
onSaveAddressClick = async () => {
|
|
82
|
+
if (this.isDeleteAddressLoading || this.isEditAddressLoading) return;
|
|
83
|
+
|
|
84
|
+
if (!this.editingCustomerAddress?.isValid) {
|
|
85
|
+
this.isEditAddressErrorsVisible = true;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const addressIndex = this.vm.store.customerStore.customer?.addresses.findIndex(
|
|
90
|
+
(a) => a.id === this.editingCustomerAddress?.id
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
if (addressIndex !== -1 && addressIndex !== undefined) {
|
|
94
|
+
const customer = _cloneDeep(this.vm.store.customerStore.customer)!;
|
|
95
|
+
customer.addresses[addressIndex] = this.editingCustomerAddress!;
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
this.isEditAddressLoading = true;
|
|
99
|
+
const saveSuccess = await this.vm.store.customerStore.saveCustomer(
|
|
100
|
+
customer
|
|
101
|
+
);
|
|
102
|
+
if (saveSuccess) {
|
|
103
|
+
this.onAddressSelect(this.editingCustomerAddress);
|
|
104
|
+
this.editingCustomerAddress = null;
|
|
105
|
+
this.isEditAddressErrorsVisible = false;
|
|
106
|
+
}
|
|
107
|
+
} catch {
|
|
108
|
+
// TODO show error
|
|
109
|
+
} finally {
|
|
110
|
+
this.isEditAddressLoading = false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
firstNameChangeCallback = (value: string) => {
|
|
116
|
+
if (!this.vm.checkout.hasCustomer && this.addressType === "shipping") {
|
|
117
|
+
this.vm.checkout.customer!.firstName = value;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
lastNameChangeCallback = (value: string) => {
|
|
122
|
+
if (!this.vm.checkout.hasCustomer && this.addressType === "shipping") {
|
|
123
|
+
this.vm.checkout.customer!.lastName = value;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import "../../styles/variables.scss";
|
|
2
|
+
|
|
3
|
+
.AddressText {
|
|
4
|
+
padding-left: 32px;
|
|
5
|
+
color: $secondaryTextColor;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.CancelEdit {
|
|
9
|
+
font-size: 16px;
|
|
10
|
+
padding-bottom: 16px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
user-select: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.EditAddressActions {
|
|
16
|
+
display: grid;
|
|
17
|
+
grid-template-columns: 1fr 1fr;
|
|
18
|
+
grid-gap: 16px;
|
|
19
|
+
margin-top: 16px;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import NotificationBox from "../../notification-box";
|
|
4
|
+
import CheckoutViewModel from "../../../../../components/checkout/model";
|
|
5
|
+
import { useTranslation } from "../../../../../utils";
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
vm: CheckoutViewModel;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const CustomerLoginRequiredError: React.FC<Props> = observer(
|
|
13
|
+
({ vm, onClose }) => {
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
return (
|
|
16
|
+
<NotificationBox
|
|
17
|
+
type="warning"
|
|
18
|
+
content={<div>{t("checkout-page:errorCustomerRequired")}</div>}
|
|
19
|
+
onClose={onClose}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import CheckoutViewModel, { ErrorType } from "../../model";
|
|
4
|
+
|
|
5
|
+
import { UnknownError } from "./unknown-error";
|
|
6
|
+
import { PaymentError } from "./payment-error";
|
|
7
|
+
import { NoShippingError } from "./no-shipping-error";
|
|
8
|
+
import { CustomerLoginRequiredError } from "./customer-login-required-error";
|
|
9
|
+
|
|
10
|
+
type CommonProps = {
|
|
11
|
+
vm: CheckoutViewModel;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Errors: React.FC<CommonProps> = ({ vm }) => {
|
|
15
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
16
|
+
const onErrorClose = React.useCallback(() => {
|
|
17
|
+
vm.error = undefined;
|
|
18
|
+
}, [vm]);
|
|
19
|
+
|
|
20
|
+
let error: React.ReactElement | null = null;
|
|
21
|
+
|
|
22
|
+
switch (vm.error?.type) {
|
|
23
|
+
case ErrorType.PAYMENT_ERROR:
|
|
24
|
+
error = <PaymentError error={vm.error} onClose={onErrorClose} />;
|
|
25
|
+
break;
|
|
26
|
+
case ErrorType.NO_SHIPPING_ERROR:
|
|
27
|
+
error = <NoShippingError onClose={onErrorClose} />;
|
|
28
|
+
break;
|
|
29
|
+
case ErrorType.CUSTOMER_LOGIN_REQUIRED_ERROR:
|
|
30
|
+
error = <CustomerLoginRequiredError vm={vm} onClose={onErrorClose} />;
|
|
31
|
+
break;
|
|
32
|
+
case ErrorType.API_ERROR:
|
|
33
|
+
case ErrorType.UNKNOWN:
|
|
34
|
+
error = <UnknownError onClose={onErrorClose} />;
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
default:
|
|
38
|
+
error = null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!error) return null;
|
|
42
|
+
|
|
43
|
+
if (ref.current) {
|
|
44
|
+
ref.current.scrollIntoView();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div ref={ref} style={{ marginBottom: "24px" }}>
|
|
49
|
+
{error}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default observer(Errors);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import NotificationBox from "../../notification-box";
|
|
4
|
+
import { useTranslation } from "../../../../../utils";
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const NoShippingError: React.FC<Props> = observer(({ onClose }) => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
return (
|
|
13
|
+
<NotificationBox
|
|
14
|
+
type="warning"
|
|
15
|
+
content={t("checkout-page:errorNoShipping")}
|
|
16
|
+
onClose={onClose}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import { CheckoutError } from "../../../../../components/checkout/model";
|
|
4
|
+
import NotificationBox from "../../notification-box";
|
|
5
|
+
import { useTranslation } from "../../../../../utils";
|
|
6
|
+
|
|
7
|
+
type Props = {
|
|
8
|
+
error?: CheckoutError | null;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const PaymentError: React.FC<Props> = observer(({ error, onClose }) => {
|
|
13
|
+
const { t } = useTranslation();
|
|
14
|
+
return (
|
|
15
|
+
<NotificationBox
|
|
16
|
+
type="error"
|
|
17
|
+
content={error?.data || t("checkout-page:errorPayment")}
|
|
18
|
+
onClose={onClose}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import CheckoutViewModel, {
|
|
4
|
+
CheckoutError,
|
|
5
|
+
} from "../../../../../components/checkout/model";
|
|
6
|
+
import NotificationBox from "../../notification-box";
|
|
7
|
+
import { IkasOrderLineItem } from "../../../../../models";
|
|
8
|
+
import { CartItem } from "../../cart-summary/cart-item";
|
|
9
|
+
import styles from "./style.module.scss";
|
|
10
|
+
import { Button } from "../../button";
|
|
11
|
+
import { useTranslation } from "../../../../../utils";
|
|
12
|
+
|
|
13
|
+
type Props = {
|
|
14
|
+
vm: CheckoutViewModel;
|
|
15
|
+
error: CheckoutError;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const StockError: React.FC<Props> = observer(({ vm, error }) => {
|
|
19
|
+
const { t } = useTranslation();
|
|
20
|
+
const [isLoading, setLoading] = React.useState(false);
|
|
21
|
+
const data = error.data as IkasOrderLineItem[];
|
|
22
|
+
|
|
23
|
+
const onContinueClick = React.useCallback(async () => {
|
|
24
|
+
setLoading(true);
|
|
25
|
+
await vm.removeUnavailableItems(data);
|
|
26
|
+
|
|
27
|
+
if (data.length === vm.cart?.items.length) vm.onBackToShoppingClick();
|
|
28
|
+
else window.location.reload();
|
|
29
|
+
}, [vm]);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<NotificationBox
|
|
33
|
+
type="warning"
|
|
34
|
+
title={t("checkout-page:errorStockTitle")}
|
|
35
|
+
content={
|
|
36
|
+
<div>
|
|
37
|
+
<div className={styles.Description}>
|
|
38
|
+
{t("checkout-page:errorStockDescription")}
|
|
39
|
+
</div>
|
|
40
|
+
{data.map((item, index) => (
|
|
41
|
+
<div key={index}>
|
|
42
|
+
<CartItem
|
|
43
|
+
vm={vm}
|
|
44
|
+
cartItem={item}
|
|
45
|
+
currencyCode={vm.checkout.cart?.currencyCode || ""}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
))}
|
|
49
|
+
<div className={styles.Actions}>
|
|
50
|
+
<Button
|
|
51
|
+
style={{
|
|
52
|
+
width: "100%",
|
|
53
|
+
}}
|
|
54
|
+
text={t("checkout-page:actions.backToCart")}
|
|
55
|
+
isLine={true}
|
|
56
|
+
isDisabled={isLoading}
|
|
57
|
+
onClick={vm.onGoToCartClick}
|
|
58
|
+
/>
|
|
59
|
+
<Button
|
|
60
|
+
style={{
|
|
61
|
+
width: "100%",
|
|
62
|
+
}}
|
|
63
|
+
text={t("checkout-page:actions.continue")}
|
|
64
|
+
isLoading={isLoading}
|
|
65
|
+
onClick={onContinueClick}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import NotificationBox from "../../notification-box";
|
|
4
|
+
import { useTranslation } from "../../../../../utils";
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const UnknownError: React.FC<Props> = observer(({ onClose }) => {
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
return (
|
|
13
|
+
<NotificationBox
|
|
14
|
+
type="error"
|
|
15
|
+
content={<div>{t("checkout-page:errorUnknown")}</div>}
|
|
16
|
+
onClose={onClose}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { observer } from "mobx-react-lite";
|
|
3
|
+
import styles from "./style.module.scss";
|
|
4
|
+
import { useTranslation } from "../../../../utils";
|
|
5
|
+
|
|
6
|
+
type ExpandableSectionProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const ExpandableSection: React.FC<ExpandableSectionProps> = ({
|
|
11
|
+
title,
|
|
12
|
+
children,
|
|
13
|
+
}) => {
|
|
14
|
+
const { t } = useTranslation();
|
|
15
|
+
const [isExpanded, setExpanded] = React.useState(false);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className={styles.ExpandableSection}>
|
|
19
|
+
<div className={styles.Top}>
|
|
20
|
+
<div className={styles.Title}>{title}</div>
|
|
21
|
+
<div
|
|
22
|
+
className={styles.HideBtn}
|
|
23
|
+
onClick={() => setExpanded(!isExpanded)}
|
|
24
|
+
>
|
|
25
|
+
{isExpanded
|
|
26
|
+
? t("checkout-page:actions.hide")
|
|
27
|
+
: t("checkout-page:actions.show")}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
{isExpanded && !!children && (
|
|
31
|
+
<div className={styles.Content}>{children}</div>
|
|
32
|
+
)}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default observer(ExpandableSection);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@import "../../styles/variables.scss";
|
|
2
|
+
|
|
3
|
+
.ExpandableSection {
|
|
4
|
+
border-bottom: 1px solid $borderColor;
|
|
5
|
+
|
|
6
|
+
.Top {
|
|
7
|
+
padding: 24px 0;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: center;
|
|
11
|
+
user-select: none;
|
|
12
|
+
|
|
13
|
+
.Title {
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
font-size: 20px;
|
|
16
|
+
line-height: 32px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.HideBtn {
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.Content {
|
|
27
|
+
padding-bottom: 24px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const SVGCaretDown: React.FC<Props> = ({ className }) => (
|
|
8
|
+
<svg
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
width="24"
|
|
12
|
+
height="24"
|
|
13
|
+
className={className}
|
|
14
|
+
>
|
|
15
|
+
<path fill="none" d="M0 0h24v24H0z" />
|
|
16
|
+
<path fill="currentColor" d="M12 16l-6-6h12z" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export default SVGCaretDown;
|