@faststore/core 3.44.1 → 3.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +122 -57
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/react-loadable-manifest.json +66 -74
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/129.js +1 -0
- package/.next/server/chunks/1506.js +1 -1
- package/.next/server/chunks/1999.js +1 -0
- package/.next/server/chunks/2091.js +1 -0
- package/.next/server/chunks/2230.js +1 -0
- package/.next/server/chunks/2773.js +1 -0
- package/.next/server/chunks/2880.js +1 -1
- package/.next/server/chunks/3006.js +1 -0
- package/.next/server/chunks/4289.js +2 -2
- package/.next/server/chunks/4559.js +16 -3
- package/.next/server/chunks/4746.js +1 -1
- package/.next/server/chunks/5636.js +2 -0
- package/.next/server/chunks/5772.js +1 -0
- package/.next/server/chunks/6594.js +1 -1
- package/.next/server/chunks/674.js +1 -1
- package/.next/server/chunks/7228.js +1 -1
- package/.next/server/chunks/8038.js +1 -0
- package/.next/server/chunks/804.js +1 -1
- package/.next/server/chunks/8307.js +1 -0
- package/.next/server/chunks/831.js +1 -1
- package/.next/server/chunks/8562.js +1 -1
- package/.next/server/chunks/8646.js +1 -1
- package/.next/server/chunks/9559.js +9 -0
- package/.next/server/chunks/9664.js +1 -0
- package/.next/server/chunks/UIBannerText.js +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/account/403.js +1 -0
- package/.next/server/pages/account/403.js.nft.json +1 -0
- package/.next/server/pages/account/404.js +1 -0
- package/.next/server/pages/account/404.js.nft.json +1 -0
- package/.next/server/pages/account/[...unknown].js +1 -0
- package/.next/server/pages/account/[...unknown].js.nft.json +1 -0
- package/.next/server/pages/account/orders/[id].js +1 -0
- package/.next/server/pages/account/orders/[id].js.nft.json +1 -0
- package/.next/server/pages/account/orders.js +1 -0
- package/.next/server/pages/account/orders.js.nft.json +1 -0
- package/.next/server/pages/account/profile.js +1 -1
- package/.next/server/pages/account/profile.js.nft.json +1 -1
- package/.next/server/pages/account/security.js +1 -0
- package/.next/server/pages/account/security.js.nft.json +1 -0
- package/.next/server/pages/account/user-details.js +1 -0
- package/.next/server/pages/account/user-details.js.nft.json +1 -0
- package/.next/server/pages/account.js +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +2 -2
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js +1 -1
- package/.next/server/pages/api/preview.js.nft.json +1 -1
- package/.next/server/pages/checkout.js +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/account/403.html +28 -0
- package/.next/server/pages/en-US/account/403.json +1 -0
- package/.next/server/pages/en-US/account/404.html +28 -0
- package/.next/server/pages/en-US/account/404.json +1 -0
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/index.js +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js +1 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/{1552.8751332da83cadc5.js → 1552.2705dd1ff3aee879.js} +1 -1
- package/.next/static/chunks/4349-e6912711a345e5b6.js +1 -0
- package/.next/static/chunks/4625-a77d5db94b3a2b8f.js +1 -0
- package/.next/static/chunks/4746.f94ab461c31311bb.js +1 -0
- package/.next/static/chunks/4774.0450cb0efbfe76f4.js +1 -0
- package/.next/static/chunks/5836.92639eae2107d7af.js +1 -0
- package/.next/static/chunks/630.a3bf6c7cd8c945e1.js +6 -0
- package/.next/static/chunks/6335-580edc7c2c0fb418.js +1 -0
- package/.next/static/chunks/{2004.a778e11dd3802b72.js → 6410.bd3fa399df59cc80.js} +1 -1
- package/.next/static/chunks/6536.be112cd4a3efe253.js +1 -0
- package/.next/static/chunks/6867.27c1cb57ed76dd02.js +1 -0
- package/.next/static/chunks/7498-9b4ed9d4a65914cc.js +1 -0
- package/.next/static/chunks/7959.df78bb2e81b8d29c.js +1 -0
- package/.next/static/chunks/{9.89f24163370f3a22.js → 9.1db9e34673fbd5c9.js} +1 -1
- package/.next/static/chunks/9540.19d844fec8517602.js +1 -0
- package/.next/static/chunks/{1418-e86227bcf9a5d486.js → 9770-6f30493e3f7ab51b.js} +3 -3
- package/.next/static/chunks/BannerNewsletter.3031c9944928c34a.js +1 -0
- package/.next/static/chunks/BannerText.ca4ae220fed6bdd6.js +1 -0
- package/.next/static/chunks/CartSidebar.3d23093834f2c79a.js +1 -0
- package/.next/static/chunks/{Dropdown.7fe839c5ffce4687.js → Dropdown.534482865327310f.js} +1 -1
- package/.next/static/chunks/{DropdownButton.3991a37657e1d194.js → DropdownButton.90e7cb14e5866e74.js} +1 -1
- package/.next/static/chunks/{DropdownItem.0b3c39f881ca0832.js → DropdownItem.e74df13f69f8c3aa.js} +1 -1
- package/.next/static/chunks/{DropdownMenu.943b2d11ffa50ff6.js → DropdownMenu.56cde48e9fbbefe5.js} +1 -1
- package/.next/static/chunks/{Footer.1f83637df0884013.js → Footer.4bb5645e731073e7.js} +1 -1
- package/.next/static/chunks/Newsletter.f87cd1eca34af5e1.js +1 -0
- package/.next/static/chunks/ProductShelf.9b64813b3d1f4c9a.js +1 -0
- package/.next/static/chunks/ProductTiles.ebf02b46a32f5a53.js +1 -0
- package/.next/static/chunks/RegionModal.cdf4facd086a88e0.js +1 -0
- package/.next/static/chunks/Toast.fbfeced8149ed940.js +1 -0
- package/.next/static/chunks/{UIBannerText.45cf608e46cde628.js → UIBannerText.ef0582cb5cb01720.js} +1 -1
- package/.next/static/chunks/UISKUMatrixSidebar.64a50464062c77e9.js +1 -0
- package/.next/static/chunks/UIToast.22fea5cca8ee2b21.js +1 -0
- package/.next/static/chunks/pages/{404-6300c433469b7262.js → 404-e89b928faf6b9125.js} +1 -1
- package/.next/static/chunks/pages/{500-2d1dd344c8a8827f.js → 500-604704ba70e1e80a.js} +1 -1
- package/.next/static/chunks/pages/[...slug]-f80d7d8c8c7948a4.js +1 -0
- package/.next/static/chunks/pages/[slug]/p-748d6a1dbe59a2c8.js +1 -0
- package/.next/static/chunks/pages/_app-1be58ebde3e0b964.js +1 -0
- package/.next/static/chunks/pages/account/403-e4e6145815eeef01.js +1 -0
- package/.next/static/chunks/pages/account/404-ecfebfad41d655e9.js +1 -0
- package/.next/static/chunks/pages/account/[...unknown]-b233f92b64bd80cb.js +1 -0
- package/.next/static/chunks/pages/account/orders/[id]-8ab11c6c528911e9.js +1 -0
- package/.next/static/chunks/pages/account/orders-41bc5ef76c592a64.js +1 -0
- package/.next/static/chunks/pages/account/profile-2f501aabce910508.js +1 -0
- package/.next/static/chunks/pages/account/security-10e9e41318110950.js +1 -0
- package/.next/static/chunks/pages/account/user-details-5a7f30c290c25ec9.js +1 -0
- package/.next/static/chunks/pages/{checkout-93b647fc45454d97.js → checkout-cf3d3c3669a5e50b.js} +1 -1
- package/.next/static/chunks/pages/{index-07bc320fc045538c.js → index-e79b4e1ce52a8ea0.js} +1 -1
- package/.next/static/chunks/pages/{login-2454f1cd309c27d2.js → login-013b1f7a2b4bb9e0.js} +1 -1
- package/.next/static/chunks/pages/s-deeb7a0bdb02aaa9.js +1 -0
- package/.next/static/chunks/webpack-72d55466bef693ae.js +1 -0
- package/.next/static/css/2557aa3eaecf6ef0.css +1 -0
- package/.next/static/css/5347dbc8b71de47d.css +1 -0
- package/.next/static/css/84d35f475d0dc928.css +1 -0
- package/.next/static/css/9d1abf05f9ffaf8f.css +1 -0
- package/.next/static/css/b7bba8fce075688b.css +1 -0
- package/.next/static/css/{b8945ac5f5327c34.css → ec42ef906960d09f.css} +1 -1
- package/.next/static/iXgIvAYuYuXvEl83Xy7jT/_buildManifest.js +1 -0
- package/.next/static/iXgIvAYuYuXvEl83Xy7jT/_ssgManifest.js +1 -0
- package/.next/trace +129 -112
- package/.turbo/turbo-build.log +40 -30
- package/.turbo/turbo-test.log +5 -5
- package/@generated/gql.ts +34 -2
- package/@generated/graphql.ts +1566 -2
- package/@generated/persisted-documents.json +4 -1
- package/@generated/schema.graphql +748 -0
- package/CHANGELOG.md +12 -0
- package/discovery.config.default.js +1 -1
- package/package.json +7 -8
- package/public/icons.svg +106 -0
- package/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawer.tsx +68 -0
- package/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawerBody.tsx +21 -0
- package/src/components/account/MyAccountDrawer/OrganizationDrawer/OrganizationDrawerHeader.tsx +39 -0
- package/src/components/account/MyAccountDrawer/OrganizationDrawer/index.ts +3 -0
- package/src/components/account/MyAccountDrawer/OrganizationDrawer/section.module.scss +121 -0
- package/src/components/account/MyAccountDrawer/OrganizationSignInButton/OrganizationSignInButton.tsx +50 -0
- package/src/components/account/MyAccountDrawer/OrganizationSignInButton/index.ts +1 -0
- package/src/components/account/MyAccountDrawer/ProfileSummary/ProfileSummary.tsx +67 -0
- package/src/components/account/MyAccountDrawer/ProfileSummary/profile-summary.scss +91 -0
- package/src/components/account/MyAccountLayout/MyAccountLayout.tsx +2 -2
- package/src/components/account/MyAccountLayout/styles.scss +8 -4
- package/src/components/account/MyAccountMenu/styles.scss +3 -2
- package/src/components/account/components/BottomSheet/BottomSheet.tsx +58 -0
- package/src/components/account/components/BottomSheet/styles.scss +35 -0
- package/src/components/account/components/MyAccountAccordion/MyAccountAccordion.tsx +13 -0
- package/src/components/account/components/MyAccountAccordion/MyAccountAccordionButton.tsx +35 -0
- package/src/components/account/components/MyAccountAccordion/MyAccountAccordionItem.tsx +21 -0
- package/src/components/account/components/MyAccountAccordion/MyAccountAccordionPanel.tsx +16 -0
- package/src/components/account/components/MyAccountAccordion/index.ts +4 -0
- package/src/components/account/components/MyAccountAccordion/styles.scss +88 -0
- package/src/components/account/components/MyAccountCard/MyAccountCard.tsx +13 -0
- package/src/components/account/components/MyAccountCard/index.ts +1 -0
- package/src/components/account/components/MyAccountCard/styles.scss +23 -0
- package/src/components/account/components/MyAccountStatusBadge/MyAccountStatusBadge.tsx +28 -0
- package/src/components/account/components/MyAccountStatusBadge/index.ts +1 -0
- package/src/components/account/components/MyAccountStatusBadge/styles.scss +54 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange/MyAccountFilterFacetDateRange.tsx +113 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange/index.ts +2 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterFacetDateRange/styles.scss +43 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/MyAccountFilterSlider.tsx +209 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/index.ts +1 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountFilterSlider/section.module.scss +24 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrders.tsx +296 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersEmptyState/MyAccountListOrdersEmptyState.tsx +20 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersEmptyState/index.ts +1 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersEmptyState/styles.scss +43 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/MyAccountListOrdersTable.tsx +210 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/index.ts +1 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountListOrdersTable/styles.scss +153 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/MyAccountSelectedTags.tsx +119 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/index.ts +1 -0
- package/src/components/account/orders/MyAccountListOrders/MyAccountSelectedTags/styles.scss +69 -0
- package/src/components/account/orders/MyAccountListOrders/index.ts +1 -0
- package/src/components/account/orders/MyAccountListOrders/styles.module.scss +100 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryCard/MyAccountDeliveryCard.tsx +47 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryCard/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryCard/styles.scss +44 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordion.tsx +93 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordionDeliveryInfo.tsx +86 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/MyAccountDeliveryOptionAccordionProducts.tsx +74 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/index.ts +6 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountDeliveryOptionAccordion/styles.scss +193 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/MyAccountMoreInformationCard.tsx +31 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/styles.scss +22 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/MyAccountOrderActionModal.tsx +121 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/index.ts +2 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/styles.module.scss +40 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal/useOrderActionModal.ts +38 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/MyAccountOrderActions.tsx +154 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/styles.scss +33 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderDetails.tsx +106 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderedByCard/MyAccountOrderedByCard.tsx +54 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderedByCard/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderedByCard/styles.scss +65 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountPaymentCard/MyAccountPaymentCard.tsx +157 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountPaymentCard/MyAccountPaymentFlagsIcon.tsx +106 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountPaymentCard/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountPaymentCard/styles.scss +76 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/MyAccountStatusCard.tsx +276 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/styles.scss +205 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard/useConnectorPositioning.ts +74 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountSummaryCard/MyAccountSummaryCard.tsx +92 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountSummaryCard/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountSummaryCard/styles.scss +45 -0
- package/src/components/account/orders/MyAccountOrderDetails/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/section.module.scss +114 -0
- package/src/components/account/utils/useFormatPrice.ts +18 -0
- package/src/components/cms/RenderSections.tsx +1 -1
- package/src/components/navigation/Navbar/Navbar.tsx +16 -1
- package/src/components/navigation/NavbarSlider/NavbarSlider.tsx +18 -3
- package/src/customizations/src/myAccount/extensions/orders/[id]/after.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/orders/[id]/before.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/orders/after.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/orders/before.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/profile/after.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/profile/before.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/security/after.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/security/before.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/user-details/after.tsx +7 -0
- package/src/customizations/src/myAccount/extensions/user-details/before.tsx +7 -0
- package/src/experimental/myAccountSeverSideProps.ts +12 -1
- package/src/pages/account/403.tsx +103 -0
- package/src/pages/account/404.tsx +95 -0
- package/src/pages/account/[...unknown].tsx +39 -0
- package/src/pages/account/index.tsx +8 -16
- package/src/pages/account/orders/[id].tsx +764 -0
- package/src/pages/account/orders/index.tsx +273 -0
- package/src/pages/account/orders/styles.module.scss +35 -0
- package/src/pages/account/profile.tsx +62 -17
- package/src/pages/account/security.tsx +94 -0
- package/src/pages/account/user-details.tsx +94 -0
- package/src/sdk/account/getMyAccountRoutes.ts +13 -12
- package/src/sdk/account/useApproveOrder.ts +53 -0
- package/src/sdk/account/useCancelOrder.ts +34 -0
- package/src/sdk/account/useDebounce.ts +23 -0
- package/src/sdk/account/useRejectOrder.ts +53 -0
- package/src/sdk/error/MissingContentError/MissingContentError.ts +2 -2
- package/src/sdk/error/MultipleContentError/MultipleContentError.ts +2 -2
- package/src/sdk/search/useMyAccountFilter.ts +157 -0
- package/src/sdk/session/index.ts +8 -0
- package/src/utils/myAccountRedirect.tsx +36 -0
- package/src/utils/userOrderStatus.ts +141 -0
- package/src/utils/utilities.ts +35 -3
- package/test/server/index.test.ts +9 -1
- package/.next/server/chunks/1246.js +0 -1
- package/.next/server/chunks/2443.js +0 -1
- package/.next/server/chunks/4725.js +0 -1
- package/.next/server/chunks/563.js +0 -1
- package/.next/server/chunks/6968.js +0 -10
- package/.next/server/chunks/7468.js +0 -1
- package/.next/server/chunks/8355.js +0 -1
- package/.next/static/chunks/1173.ca14a5bc4e1264f4.js +0 -1
- package/.next/static/chunks/2206.44239ce81a09bc17.js +0 -1
- package/.next/static/chunks/4349-87a956a73b97519c.js +0 -1
- package/.next/static/chunks/4625-553d20c86b0ca577.js +0 -1
- package/.next/static/chunks/4746.2e16ec0663a3873f.js +0 -1
- package/.next/static/chunks/4774.8e70c01dcd0ed4b3.js +0 -1
- package/.next/static/chunks/4865.4017be0f8e7c8cf0.js +0 -1
- package/.next/static/chunks/5259-90f7ef92cf24e49a.js +0 -1
- package/.next/static/chunks/5836.c5c244a8cbfa7f7d.js +0 -1
- package/.next/static/chunks/630.13d3dd939b789798.js +0 -6
- package/.next/static/chunks/6335-6eb4ff84af184b88.js +0 -1
- package/.next/static/chunks/6536.d5260107222db13c.js +0 -1
- package/.next/static/chunks/7498-72289e704e7c7056.js +0 -1
- package/.next/static/chunks/7959.7c721505286572c0.js +0 -1
- package/.next/static/chunks/BannerNewsletter.8982f42e60ed8828.js +0 -1
- package/.next/static/chunks/BannerText.5b250db1cf67e44f.js +0 -1
- package/.next/static/chunks/CartSidebar.aa9e43be37034654.js +0 -1
- package/.next/static/chunks/Newsletter.9db4df2d4fb33227.js +0 -1
- package/.next/static/chunks/ProductShelf.9cea36116836c161.js +0 -1
- package/.next/static/chunks/ProductTiles.059a4a6360e1d4ea.js +0 -1
- package/.next/static/chunks/RegionModal.4594b707a1092551.js +0 -1
- package/.next/static/chunks/Toast.01d4ac8bf14c1be5.js +0 -1
- package/.next/static/chunks/UIButton.3186f933c0ecfb31.js +0 -1
- package/.next/static/chunks/UISKUMatrixSidebar.9ac3980a60cfc358.js +0 -1
- package/.next/static/chunks/UIToast.221eb10681d2f642.js +0 -1
- package/.next/static/chunks/pages/[...slug]-c1a62d58f5940747.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-555dc09a5e78260e.js +0 -1
- package/.next/static/chunks/pages/_app-d5641120092ee13b.js +0 -1
- package/.next/static/chunks/pages/account/profile-23b2e9fbbd95a30b.js +0 -1
- package/.next/static/chunks/pages/s-9901e6857f517b8b.js +0 -1
- package/.next/static/chunks/webpack-11f8d9f83a4d695c.js +0 -1
- package/.next/static/css/249b9deaabc0d32d.css +0 -1
- package/.next/static/f3BfFJ3uIpcQCIGQ6fQQ4/_buildManifest.js +0 -1
- package/.next/static/f3BfFJ3uIpcQCIGQ6fQQ4/_ssgManifest.js +0 -1
package/src/components/account/orders/MyAccountOrderDetails/MyAccountMoreInformationCard/styles.scss
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[data-fs-order-more-information-card] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for More Information Card
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
grid-column: span 2;
|
|
7
|
+
|
|
8
|
+
[data-fs-order-more-information-card-content] {
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: repeat(3, 1fr);
|
|
11
|
+
gap: 1.75rem;
|
|
12
|
+
|
|
13
|
+
@include media("<tablet") {
|
|
14
|
+
grid-template-columns: 1fr;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[data-fs-order-more-information-card-title] {
|
|
18
|
+
font-size: 0.875rem;
|
|
19
|
+
color: var(--fs-color-text-light);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Modal as UIModal,
|
|
3
|
+
ModalHeader as UIModalHeader,
|
|
4
|
+
ModalBody as UIModalBody,
|
|
5
|
+
ModalFooter as UIModalFooter,
|
|
6
|
+
Button as UIButton,
|
|
7
|
+
} from '@faststore/ui'
|
|
8
|
+
import useScreenResize from 'src/sdk/ui/useScreenResize'
|
|
9
|
+
import BottomSheet from 'src/components/account/components/BottomSheet/BottomSheet'
|
|
10
|
+
import styles from './styles.module.scss'
|
|
11
|
+
|
|
12
|
+
export type OrderActionType = 'cancel' | 'reject' | 'approve'
|
|
13
|
+
|
|
14
|
+
interface OrderActionConfig {
|
|
15
|
+
title: string
|
|
16
|
+
message: string
|
|
17
|
+
confirmText: string
|
|
18
|
+
cancelText: string
|
|
19
|
+
confirmVariant: 'primary' | 'secondary' | 'tertiary'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ACTION_CONFIGS: Record<OrderActionType, OrderActionConfig> = {
|
|
23
|
+
cancel: {
|
|
24
|
+
title: 'Cancel order',
|
|
25
|
+
message:
|
|
26
|
+
"Are you sure you want to cancel this order? This action can't be undone.",
|
|
27
|
+
confirmText: 'Cancel order',
|
|
28
|
+
cancelText: 'Not now',
|
|
29
|
+
confirmVariant: 'secondary',
|
|
30
|
+
},
|
|
31
|
+
reject: {
|
|
32
|
+
title: 'Reject order',
|
|
33
|
+
message:
|
|
34
|
+
"Are you sure you want to reject this order? This action can't be undone.",
|
|
35
|
+
confirmText: 'Reject',
|
|
36
|
+
cancelText: 'Cancel',
|
|
37
|
+
confirmVariant: 'primary',
|
|
38
|
+
},
|
|
39
|
+
approve: {
|
|
40
|
+
title: 'Approve order',
|
|
41
|
+
message: 'Are you sure you want to approve this order?',
|
|
42
|
+
confirmText: 'Approve',
|
|
43
|
+
cancelText: 'Cancel',
|
|
44
|
+
confirmVariant: 'primary',
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface MyAccountOrderActionModalProps {
|
|
49
|
+
isOpen: boolean
|
|
50
|
+
loading?: boolean
|
|
51
|
+
fade?: 'in' | 'out'
|
|
52
|
+
actionType: OrderActionType | null
|
|
53
|
+
onClose: (actionType: OrderActionType) => void
|
|
54
|
+
onConfirm: (actionType: OrderActionType) => void
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default function MyAccountOrderActionModal({
|
|
58
|
+
isOpen = false,
|
|
59
|
+
loading = false,
|
|
60
|
+
fade = 'out',
|
|
61
|
+
actionType,
|
|
62
|
+
onClose,
|
|
63
|
+
onConfirm,
|
|
64
|
+
}: MyAccountOrderActionModalProps) {
|
|
65
|
+
const { isMobile, isTablet } = useScreenResize()
|
|
66
|
+
|
|
67
|
+
const config: OrderActionConfig | null =
|
|
68
|
+
actionType && ACTION_CONFIGS[actionType]
|
|
69
|
+
const dialogContent = (
|
|
70
|
+
<>
|
|
71
|
+
<UIModalHeader
|
|
72
|
+
title={config?.title}
|
|
73
|
+
onClose={() => onClose(actionType)}
|
|
74
|
+
/>
|
|
75
|
+
<UIModalBody>
|
|
76
|
+
<p data-fs-order-details-action-modal-message>{config?.message}</p>
|
|
77
|
+
</UIModalBody>
|
|
78
|
+
<UIModalFooter>
|
|
79
|
+
<UIButton variant="tertiary" onClick={() => onClose(actionType)}>
|
|
80
|
+
{config?.cancelText}
|
|
81
|
+
</UIButton>
|
|
82
|
+
<UIButton
|
|
83
|
+
variant={config?.confirmVariant}
|
|
84
|
+
onClick={() => onConfirm(actionType)}
|
|
85
|
+
loading={loading}
|
|
86
|
+
>
|
|
87
|
+
{config?.confirmText}
|
|
88
|
+
</UIButton>
|
|
89
|
+
</UIModalFooter>
|
|
90
|
+
</>
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
if (isMobile || isTablet) {
|
|
94
|
+
return (
|
|
95
|
+
<BottomSheet
|
|
96
|
+
data-fs-order-details-action-modal
|
|
97
|
+
isOpen={isOpen}
|
|
98
|
+
onDismiss={() => onClose(actionType)}
|
|
99
|
+
fade={fade}
|
|
100
|
+
overlayProps={{
|
|
101
|
+
className: styles.orderActionsModal,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
{dialogContent}
|
|
105
|
+
</BottomSheet>
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<UIModal
|
|
111
|
+
data-fs-order-details-action-modal
|
|
112
|
+
isOpen={isOpen}
|
|
113
|
+
onDismiss={() => onClose(actionType)}
|
|
114
|
+
overlayProps={{
|
|
115
|
+
className: styles.orderActionsModal,
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
{dialogContent}
|
|
119
|
+
</UIModal>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.orderActionsModal {
|
|
3
|
+
@import "@faststore/ui/src/components/atoms/Loader/styles.scss";
|
|
4
|
+
@import "@faststore/ui/src/components/atoms/Icon/styles.scss";
|
|
5
|
+
@import "@faststore/ui/src/components/atoms/Button/styles.scss";
|
|
6
|
+
@import "@faststore/ui/src/components/molecules/Modal/styles.scss";
|
|
7
|
+
@import "src/components/account/components/BottomSheet/styles.scss";
|
|
8
|
+
|
|
9
|
+
[data-fs-order-details-action-modal] {
|
|
10
|
+
[data-fs-modal-body] {
|
|
11
|
+
[data-fs-order-details-action-modal-message] {
|
|
12
|
+
font-size: var(--fs-text-size-body);
|
|
13
|
+
line-height: 1.5;
|
|
14
|
+
color: var(--fs-color-text);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[data-fs-modal-footer] {
|
|
19
|
+
@include media("<=tablet") {
|
|
20
|
+
padding: var(--fs-spacing-3) 0 var(--fs-spacing-3);
|
|
21
|
+
|
|
22
|
+
[data-fs-modal-footer-actions] {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-flow: row wrap;
|
|
25
|
+
gap: var(--fs-spacing-3);
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: flex-end;
|
|
28
|
+
max-width: 25rem;
|
|
29
|
+
padding: var(--fs-spacing-1) var(--fs-spacing-4);
|
|
30
|
+
margin-left: auto;
|
|
31
|
+
|
|
32
|
+
> * {
|
|
33
|
+
flex-grow: 1;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useFadeEffect } from '@faststore/ui'
|
|
2
|
+
import { useCallback, useState } from 'react'
|
|
3
|
+
import type { OrderActionType } from './MyAccountOrderActionModal'
|
|
4
|
+
|
|
5
|
+
export function useOrderActionModal() {
|
|
6
|
+
const { fade, fadeOut, fadeIn } = useFadeEffect()
|
|
7
|
+
|
|
8
|
+
const [dialogState, setDialogState] = useState<{
|
|
9
|
+
isOpen: boolean
|
|
10
|
+
actionType: OrderActionType | null
|
|
11
|
+
}>({
|
|
12
|
+
isOpen: false,
|
|
13
|
+
actionType: null,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const openDialog = useCallback((actionType: OrderActionType) => {
|
|
17
|
+
setDialogState({
|
|
18
|
+
isOpen: true,
|
|
19
|
+
actionType,
|
|
20
|
+
})
|
|
21
|
+
fadeIn()
|
|
22
|
+
}, [])
|
|
23
|
+
|
|
24
|
+
const closeDialog = useCallback(() => {
|
|
25
|
+
setDialogState({
|
|
26
|
+
isOpen: false,
|
|
27
|
+
actionType: null,
|
|
28
|
+
})
|
|
29
|
+
fadeOut()
|
|
30
|
+
}, [])
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
...dialogState,
|
|
34
|
+
fade,
|
|
35
|
+
openDialog,
|
|
36
|
+
closeDialog,
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button as UIButton,
|
|
3
|
+
Icon as UIIcon,
|
|
4
|
+
IconButton as UIIconButton,
|
|
5
|
+
useUI,
|
|
6
|
+
} from '@faststore/ui'
|
|
7
|
+
import useScreenResize from 'src/sdk/ui/useScreenResize'
|
|
8
|
+
import MyAccountOrderActionModal, {
|
|
9
|
+
useOrderActionModal,
|
|
10
|
+
} from 'src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal'
|
|
11
|
+
import { useCancelOrder } from 'src/sdk/account/useCancelOrder'
|
|
12
|
+
import { useApproveOrder } from 'src/sdk/account/useApproveOrder'
|
|
13
|
+
import { useRejectOrder } from 'src/sdk/account/useRejectOrder'
|
|
14
|
+
|
|
15
|
+
const TOASTS_CONFIG = {
|
|
16
|
+
cancel: {
|
|
17
|
+
success: 'Order canceled successfully',
|
|
18
|
+
error: "Order couldn't be canceled due to a technical issue. Try again.",
|
|
19
|
+
},
|
|
20
|
+
approve: {
|
|
21
|
+
success: 'Order approved successfully',
|
|
22
|
+
error: "Order couldn't be approved due to a technical issue. Try again.",
|
|
23
|
+
},
|
|
24
|
+
reject: {
|
|
25
|
+
success: 'Order rejected successfully',
|
|
26
|
+
error: "Order couldn't be rejected due to a technical issue. Try again.",
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface MyAccountOrderActionsProps {
|
|
31
|
+
orderId: string
|
|
32
|
+
customerEmail?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default function MyAccountOrderActions({
|
|
36
|
+
orderId,
|
|
37
|
+
customerEmail,
|
|
38
|
+
}: MyAccountOrderActionsProps) {
|
|
39
|
+
const { isMobile, isTablet } = useScreenResize()
|
|
40
|
+
const { isOpen, actionType, fade, openDialog, closeDialog } =
|
|
41
|
+
useOrderActionModal()
|
|
42
|
+
const { pushToast } = useUI()
|
|
43
|
+
|
|
44
|
+
const { cancelOrder, loading: cancelLoading } = useCancelOrder()
|
|
45
|
+
const { approveOrder, loading: approveLoading } = useApproveOrder()
|
|
46
|
+
const { rejectOrder, loading: rejectLoading } = useRejectOrder()
|
|
47
|
+
|
|
48
|
+
const loading =
|
|
49
|
+
(actionType === 'cancel' && cancelLoading) ||
|
|
50
|
+
(actionType === 'approve' && approveLoading) ||
|
|
51
|
+
(actionType === 'reject' && rejectLoading)
|
|
52
|
+
|
|
53
|
+
const handleConfirm = async (type: string) => {
|
|
54
|
+
const data = {
|
|
55
|
+
orderId,
|
|
56
|
+
customerEmail,
|
|
57
|
+
// TODO: We don't have a reason for action yet
|
|
58
|
+
reason: '',
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const actions = {
|
|
62
|
+
cancel: cancelOrder,
|
|
63
|
+
approve: approveOrder,
|
|
64
|
+
reject: rejectOrder,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
const action = actions[type as keyof typeof actions]
|
|
69
|
+
|
|
70
|
+
if (!action) {
|
|
71
|
+
throw new Error(`Invalid action type: ${type}`)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Execute the action
|
|
75
|
+
await action({ data: data })
|
|
76
|
+
|
|
77
|
+
closeDialog()
|
|
78
|
+
pushToast({
|
|
79
|
+
status: 'INFO',
|
|
80
|
+
message: TOASTS_CONFIG[type as keyof typeof TOASTS_CONFIG].success,
|
|
81
|
+
icon: <UIIcon width={30} height={30} name="CircleWavyCheck" />,
|
|
82
|
+
})
|
|
83
|
+
} catch (error) {
|
|
84
|
+
pushToast({
|
|
85
|
+
status: 'ERROR',
|
|
86
|
+
message: TOASTS_CONFIG[type as keyof typeof TOASTS_CONFIG].error,
|
|
87
|
+
icon: <UIIcon width={30} height={30} name="CircleWavyWarning" />,
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<div data-fs-order-details-header-actions>
|
|
95
|
+
<UIButton
|
|
96
|
+
variant="secondary"
|
|
97
|
+
data-fs-order-details-header-actions-cancel
|
|
98
|
+
size={isMobile || isTablet ? 'regular' : 'small'}
|
|
99
|
+
type="button"
|
|
100
|
+
onClick={() => openDialog('cancel')}
|
|
101
|
+
>
|
|
102
|
+
Cancel order
|
|
103
|
+
</UIButton>
|
|
104
|
+
{isMobile || isTablet ? (
|
|
105
|
+
<UIIconButton
|
|
106
|
+
aria-label="Reject"
|
|
107
|
+
icon={<UIIcon name="XCircle" />}
|
|
108
|
+
variant="tertiary"
|
|
109
|
+
type="button"
|
|
110
|
+
onClick={() => openDialog('reject')}
|
|
111
|
+
/>
|
|
112
|
+
) : (
|
|
113
|
+
<UIButton
|
|
114
|
+
variant="secondary"
|
|
115
|
+
size="small"
|
|
116
|
+
icon={<UIIcon name="XCircle" />}
|
|
117
|
+
type="button"
|
|
118
|
+
onClick={() => openDialog('reject')}
|
|
119
|
+
>
|
|
120
|
+
Reject
|
|
121
|
+
</UIButton>
|
|
122
|
+
)}
|
|
123
|
+
{isMobile || isTablet ? (
|
|
124
|
+
<UIIconButton
|
|
125
|
+
aria-label="Approve"
|
|
126
|
+
icon={<UIIcon name="CircleCheck" />}
|
|
127
|
+
variant="primary"
|
|
128
|
+
type="button"
|
|
129
|
+
onClick={() => openDialog('approve')}
|
|
130
|
+
/>
|
|
131
|
+
) : (
|
|
132
|
+
<UIButton
|
|
133
|
+
variant="primary"
|
|
134
|
+
size="small"
|
|
135
|
+
icon={<UIIcon name="CircleCheck" />}
|
|
136
|
+
type="button"
|
|
137
|
+
onClick={() => openDialog('approve')}
|
|
138
|
+
>
|
|
139
|
+
Approve
|
|
140
|
+
</UIButton>
|
|
141
|
+
)}
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<MyAccountOrderActionModal
|
|
145
|
+
isOpen={isOpen}
|
|
146
|
+
loading={loading}
|
|
147
|
+
fade={fade}
|
|
148
|
+
actionType={actionType}
|
|
149
|
+
onClose={closeDialog}
|
|
150
|
+
onConfirm={handleConfirm}
|
|
151
|
+
/>
|
|
152
|
+
</>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MyAccountOrderActions'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[data-fs-order-details-header-actions] {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-flow: row wrap;
|
|
4
|
+
align-items: center;
|
|
5
|
+
|
|
6
|
+
[data-fs-order-details-header-actions-cancel] {
|
|
7
|
+
--fs-button-secondary-text-color: var(--fs-color-danger-text);
|
|
8
|
+
--fs-button-secondary-bkg-color-hover: var(--fs-button-secondary-text-color);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include media("<=tablet") {
|
|
12
|
+
position: fixed;
|
|
13
|
+
right: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
z-index: var(--fs-z-index-top);
|
|
17
|
+
gap: var(--fs-spacing-1);
|
|
18
|
+
justify-content: flex-end;
|
|
19
|
+
padding: 1.25rem;
|
|
20
|
+
background: var(--fs-color-body-bkg);
|
|
21
|
+
border-top: var(--fs-border-width) solid var(--fs-color-neutral-2);
|
|
22
|
+
box-shadow: 0 -1px 15px 0 rgb(0 0 0 / 10.2%);
|
|
23
|
+
|
|
24
|
+
[data-fs-order-details-header-actions-cancel] {
|
|
25
|
+
margin-right: auto;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@include media(">tablet") {
|
|
30
|
+
flex-flow: row;
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
2
|
+
|
|
3
|
+
import { Icon as UIIcon, IconButton as UIIconButton } from '@faststore/ui'
|
|
4
|
+
import MyAccountStatusCard from 'src/components/account/orders/MyAccountOrderDetails/MyAccountStatusCard'
|
|
5
|
+
import MyAccountDeliveryCard from './MyAccountDeliveryCard'
|
|
6
|
+
import { MyAccountDeliveryOptionAccordion } from './MyAccountDeliveryOptionAccordion'
|
|
7
|
+
import MyAccountOrderActions from './MyAccountOrderActions'
|
|
8
|
+
import MyAccountOrderedByCard from './MyAccountOrderedByCard'
|
|
9
|
+
import MyAccountPaymentCard from './MyAccountPaymentCard'
|
|
10
|
+
import MyAccountSummaryCard from './MyAccountSummaryCard'
|
|
11
|
+
|
|
12
|
+
import { useRouter } from 'next/router'
|
|
13
|
+
import type { OrderStatusKey } from 'src/utils/userOrderStatus'
|
|
14
|
+
import MyAccountStatusBadge from '../../components/MyAccountStatusBadge'
|
|
15
|
+
import MyAccountMoreInformationCard from './MyAccountMoreInformationCard'
|
|
16
|
+
import styles from './section.module.scss'
|
|
17
|
+
|
|
18
|
+
export interface MyAccountOrderDetailsProps {
|
|
19
|
+
order: ServerOrderDetailsQueryQuery['userOrder']
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// This constant is used to determine if we should go back in history or redirect to the orders page
|
|
23
|
+
const MIN_HISTORY_LENGTH_TO_GO_BACK = 2
|
|
24
|
+
|
|
25
|
+
export default function MyAccountOrderDetails({
|
|
26
|
+
order,
|
|
27
|
+
}: MyAccountOrderDetailsProps) {
|
|
28
|
+
const router = useRouter()
|
|
29
|
+
|
|
30
|
+
const handleBack = () => {
|
|
31
|
+
if (window.history.length > MIN_HISTORY_LENGTH_TO_GO_BACK) {
|
|
32
|
+
router.back()
|
|
33
|
+
} else {
|
|
34
|
+
router.push('/account/orders')
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const moreInformationCustomFields = order?.customFields.find(
|
|
39
|
+
(field) => field.type === 'order'
|
|
40
|
+
)?.fields
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className={styles.page} data-fs-order-details>
|
|
44
|
+
<header data-fs-order-details-header>
|
|
45
|
+
<div data-fs-order-details-header-title>
|
|
46
|
+
<UIIconButton
|
|
47
|
+
data-fs-order-details-header-back-button
|
|
48
|
+
size="small"
|
|
49
|
+
aria-label="Go back"
|
|
50
|
+
icon={<UIIcon height={24} width={24} name="ArrowLeft" />}
|
|
51
|
+
type="button"
|
|
52
|
+
onClick={handleBack}
|
|
53
|
+
/>
|
|
54
|
+
<div data-fs-order-details-header-title-wrapper>
|
|
55
|
+
<h1 data-fs-order-details-header-title-text>
|
|
56
|
+
Order #{order.orderId}
|
|
57
|
+
</h1>
|
|
58
|
+
<MyAccountStatusBadge
|
|
59
|
+
status={order.status}
|
|
60
|
+
statusFallback={order.statusDescription}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<MyAccountOrderActions
|
|
65
|
+
orderId={order.orderId}
|
|
66
|
+
customerEmail={order.clientProfileData?.email}
|
|
67
|
+
/>
|
|
68
|
+
</header>
|
|
69
|
+
<main data-fs-order-details-content>
|
|
70
|
+
<MyAccountOrderedByCard clientProfileData={order.clientProfileData} />
|
|
71
|
+
<MyAccountDeliveryCard
|
|
72
|
+
deliveryOptionsData={order.deliveryOptionsData}
|
|
73
|
+
fields={
|
|
74
|
+
order.customFields.find((field) => field.type === 'address')?.fields
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
77
|
+
<MyAccountStatusCard status={order.status as OrderStatusKey} />
|
|
78
|
+
<MyAccountPaymentCard
|
|
79
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
80
|
+
paymentData={order.paymentData}
|
|
81
|
+
allowCancellation={order.allowCancellation}
|
|
82
|
+
/>
|
|
83
|
+
<MyAccountSummaryCard
|
|
84
|
+
totals={order.totals}
|
|
85
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
86
|
+
transactions={order.paymentData.transactions}
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
{order.deliveryOptionsData.deliveryOptions.map((option) => (
|
|
90
|
+
<MyAccountDeliveryOptionAccordion
|
|
91
|
+
key={option.friendlyDeliveryOptionName}
|
|
92
|
+
deliveryOption={option}
|
|
93
|
+
contact={order.deliveryOptionsData.contact}
|
|
94
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
95
|
+
customFields={order.customFields.filter(
|
|
96
|
+
(field) => field.type === 'item'
|
|
97
|
+
)}
|
|
98
|
+
/>
|
|
99
|
+
))}
|
|
100
|
+
{moreInformationCustomFields?.length > 0 && (
|
|
101
|
+
<MyAccountMoreInformationCard fields={moreInformationCustomFields} />
|
|
102
|
+
)}
|
|
103
|
+
</main>
|
|
104
|
+
</div>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
2
|
+
import MyAccountCard from '../../../components/MyAccountCard'
|
|
3
|
+
|
|
4
|
+
interface MyAccountOrderedByCardProps {
|
|
5
|
+
clientProfileData: Pick<
|
|
6
|
+
ServerOrderDetailsQueryQuery['userOrder']['clientProfileData'],
|
|
7
|
+
| 'firstName'
|
|
8
|
+
| 'lastName'
|
|
9
|
+
| 'email'
|
|
10
|
+
| 'phone'
|
|
11
|
+
| 'corporateName'
|
|
12
|
+
| 'isCorporate'
|
|
13
|
+
>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function MyAccountOrderedByCard({
|
|
17
|
+
clientProfileData,
|
|
18
|
+
}: MyAccountOrderedByCardProps) {
|
|
19
|
+
const firstName = clientProfileData?.firstName
|
|
20
|
+
const lastName = clientProfileData?.lastName
|
|
21
|
+
const email = clientProfileData?.email
|
|
22
|
+
const phone = clientProfileData?.phone
|
|
23
|
+
const corporateName = clientProfileData?.corporateName
|
|
24
|
+
const isCorporate = clientProfileData?.isCorporate
|
|
25
|
+
|
|
26
|
+
const getFirstLetter = (name: string) => {
|
|
27
|
+
return name.charAt(0).toUpperCase()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<MyAccountCard title="Ordered by" data-fs-order-ordered-by-card>
|
|
32
|
+
{isCorporate && corporateName && (
|
|
33
|
+
<div data-fs-ordered-by-org>
|
|
34
|
+
<div data-fs-ordered-by-avatar>{getFirstLetter(corporateName)}</div>
|
|
35
|
+
<p data-fs-ordered-by-org-name>{corporateName}</p>
|
|
36
|
+
</div>
|
|
37
|
+
)}
|
|
38
|
+
<div data-fs-ordered-by-client-info>
|
|
39
|
+
<p
|
|
40
|
+
data-fs-ordered-by-client-name
|
|
41
|
+
>{`${firstName ?? ''} ${lastName ?? ''}`}</p>
|
|
42
|
+
{(phone || email) && (
|
|
43
|
+
<p>
|
|
44
|
+
{phone && <>{phone}</>}
|
|
45
|
+
{phone && email && <br />}
|
|
46
|
+
{email}
|
|
47
|
+
</p>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
</MyAccountCard>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default MyAccountOrderedByCard
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MyAccountOrderedByCard'
|
package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderedByCard/styles.scss
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
[data-fs-order-ordered-by-card] {
|
|
2
|
+
// --------------------------------------------------------
|
|
3
|
+
// Design Tokens for Ordered By Card
|
|
4
|
+
// --------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
// Default properties
|
|
7
|
+
--fs-ordered-by-avatar-size : 24px;
|
|
8
|
+
--fs-ordered-by-avatar-bg : var(--fs-color-primary-bkg);
|
|
9
|
+
--fs-ordered-by-avatar-color : var(--fs-color-primary-text);
|
|
10
|
+
|
|
11
|
+
--fs-ordered-by-text-size : var(--fs-text-size-2);
|
|
12
|
+
--fs-ordered-by-text-line-height : 24px;
|
|
13
|
+
--fs-ordered-by-text-letter-spacing : -2%;
|
|
14
|
+
--fs-ordered-by-text-client-weight : var(--fs-text-weight-regular);
|
|
15
|
+
--fs-ordered-by-text-client-strong-weight : var(--fs-text-weight-medium);
|
|
16
|
+
--fs-ordered-by-text-corporate-weight : var(--fs-text-weight-semibold);
|
|
17
|
+
|
|
18
|
+
[data-fs-card-body] {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: var(--fs-spacing-3);
|
|
22
|
+
|
|
23
|
+
[data-fs-ordered-by-org] {
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: var(--fs-spacing-1);
|
|
26
|
+
align-items: center;
|
|
27
|
+
|
|
28
|
+
[data-fs-ordered-by-avatar] {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
width: var(--fs-ordered-by-avatar-size);
|
|
33
|
+
height: var(--fs-ordered-by-avatar-size);
|
|
34
|
+
font-size: var(--fs-text-size-1);
|
|
35
|
+
font-weight: var(--fs-text-weight-semibold);
|
|
36
|
+
color: var(--fs-color-main-2);
|
|
37
|
+
background-color: var(--fs-color-accent-0);
|
|
38
|
+
border-radius: var(--fs-border-radius-pill);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[data-fs-ordered-by-org-name] {
|
|
42
|
+
font-size: var(--fs-ordered-by-text-size);
|
|
43
|
+
font-weight: var(--fs-ordered-by-text-corporate-weight);
|
|
44
|
+
line-height: var(--fs-ordered-by-text-line-height);
|
|
45
|
+
letter-spacing: var(--fs-ordered-by-text-letter-spacing);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-fs-ordered-by-client-info] {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
gap: var(--fs-spacing-1);
|
|
53
|
+
|
|
54
|
+
p {
|
|
55
|
+
font-size: var(--fs-ordered-by-text-size);
|
|
56
|
+
font-weight: var(--fs-ordered-by-text-client-weight);
|
|
57
|
+
letter-spacing: var(--fs-ordered-by-text-letter-spacing);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-fs-ordered-by-client-name] {
|
|
61
|
+
font-weight: var(--fs-ordered-by-text-client-strong-weight);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|