@faststore/core 3.97.0-dev.1 → 3.97.0-dev.3
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 +80 -75
- 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 +118 -126
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/1174.js +1 -0
- package/.next/server/chunks/1405.js +1 -0
- package/.next/server/chunks/1734.js +1 -0
- package/.next/server/chunks/1780.js +1 -1
- package/.next/server/chunks/1962.js +1 -0
- package/.next/server/chunks/2081.js +1 -0
- package/.next/server/chunks/{3922.js → 2115.js} +1 -1
- package/.next/server/chunks/222.js +6 -0
- package/.next/server/chunks/2430.js +1 -1
- package/.next/server/chunks/294.js +1 -1
- package/.next/server/chunks/315.js +1 -0
- package/.next/server/chunks/3475.js +1 -0
- package/.next/server/chunks/{1972.js → 3734.js} +1 -1
- package/.next/server/chunks/3741.js +1 -0
- package/.next/server/chunks/3836.js +1 -1
- package/.next/server/chunks/3998.js +1 -0
- package/.next/server/chunks/4005.js +1 -0
- package/.next/server/chunks/4184.js +1 -0
- package/.next/server/chunks/4278.js +1 -0
- package/.next/server/chunks/4471.js +1 -0
- package/.next/server/chunks/4521.js +1 -0
- package/.next/server/chunks/4617.js +1 -0
- package/.next/server/chunks/4803.js +1 -1
- package/.next/server/chunks/5209.js +1 -0
- package/.next/server/chunks/5341.js +1 -0
- package/.next/server/chunks/5796.js +1 -1
- package/.next/server/chunks/5815.js +1 -0
- package/.next/server/chunks/582.js +1 -0
- package/.next/server/chunks/6084.js +1 -0
- package/.next/server/chunks/{9088.js → 6130.js} +1 -1
- package/.next/server/chunks/6321.js +1 -0
- package/.next/server/chunks/6789.js +1 -1
- package/.next/server/chunks/6859.js +1 -0
- package/.next/server/chunks/6886.js +1 -1
- package/.next/server/chunks/6950.js +1 -0
- package/.next/server/chunks/7098.js +2 -2
- package/.next/server/chunks/7167.js +1 -0
- package/.next/server/chunks/83.js +1 -1
- package/.next/server/chunks/{4451.js → 8413.js} +1 -1
- package/.next/server/chunks/{7169.js → 8483.js} +1 -1
- package/.next/server/chunks/8530.js +1 -0
- package/.next/server/chunks/8687.js +1 -1
- package/.next/server/chunks/9117.js +1 -1
- package/.next/server/chunks/9179.js +1 -0
- package/.next/server/chunks/948.js +2 -2
- package/.next/server/chunks/9563.js +2 -2
- package/.next/server/chunks/9630.js +12 -12
- package/.next/server/chunks/9740.js +1 -1
- package/.next/server/chunks/9853.js +1 -1
- package/.next/server/chunks/ButtonSignIn.js +1 -1
- package/.next/server/chunks/Dropdown.js +1 -1
- package/.next/server/chunks/DropdownButton.js +1 -1
- package/.next/server/chunks/DropdownItem.js +1 -1
- package/.next/server/chunks/DropdownMenu.js +1 -1
- package/.next/server/chunks/FilterSkeleton.js +1 -1
- package/.next/server/chunks/ScrollToTopButton.js +1 -1
- package/.next/server/chunks/UIBannerText.js +1 -1
- package/.next/server/chunks/UINavbarSlider.js +1 -1
- package/.next/server/chunks/UISKUMatrixSidebar.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 +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 +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/api/fs/logout.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js +3 -3
- 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.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 +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- 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/pvt/account/403.js +1 -1
- package/.next/server/pages/pvt/account/403.js.nft.json +1 -1
- package/.next/server/pages/pvt/account/404.js +1 -1
- package/.next/server/pages/pvt/account/404.js.nft.json +1 -1
- package/.next/server/pages/pvt/account/[...unknown].js +1 -1
- package/.next/server/pages/pvt/account/[...unknown].js.nft.json +1 -1
- package/.next/server/pages/pvt/account/orders/[id].js +1 -1
- package/.next/server/pages/pvt/account/orders/[id].js.nft.json +1 -1
- package/.next/server/pages/pvt/account/orders.js +1 -1
- package/.next/server/pages/pvt/account/orders.js.nft.json +1 -1
- package/.next/server/pages/pvt/account/profile.js +1 -1
- package/.next/server/pages/pvt/account/profile.js.nft.json +1 -1
- package/.next/server/pages/pvt/account/security.js +1 -1
- package/.next/server/pages/pvt/account/security.js.nft.json +1 -1
- package/.next/server/pages/pvt/account/user-details.js +1 -1
- package/.next/server/pages/pvt/account/user-details.js.nft.json +1 -1
- package/.next/server/pages/pvt/account.js +1 -1
- package/.next/server/pages/pvt/account.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/6skPsTs9THh3repcOD2W9/_buildManifest.js +1 -0
- package/.next/static/chunks/2219.b5af5db1fbe57c6a.js +1 -0
- package/.next/static/chunks/2284.80457d3024d18d6e.js +1 -0
- package/.next/static/chunks/294.7b0a27e1283125e4.js +1 -0
- package/.next/static/chunks/3155.6d33ba8740143bd9.js +1 -0
- package/.next/static/chunks/3399.ba6f11302d9dbef2.js +1 -0
- package/.next/static/chunks/357.3b4914b86fae2989.js +1 -0
- package/.next/static/chunks/3802.67828bf6e944fa03.js +1 -0
- package/.next/static/chunks/3836.dedaf7ea23e1f09c.js +1 -0
- package/.next/static/chunks/4013.f06ff429d42490e5.js +1 -0
- package/.next/static/chunks/4132.47d4651d0980d5c1.js +1 -0
- package/.next/static/chunks/4330.f109e9f5a57b55f1.js +1 -0
- package/.next/static/chunks/4803.19e2fd0edbf6e494.js +1 -0
- package/.next/static/chunks/5625-a3bbdaa990c3e541.js +28 -0
- package/.next/static/chunks/5796.244380273a508a74.js +1 -0
- package/.next/static/chunks/{5859.3bc094416cffd966.js → 5859.e8dab61ef115a1da.js} +1 -1
- package/.next/static/chunks/6700.667327fa7d7f7348.js +1 -0
- package/.next/static/chunks/6789.e79c87ba27c51cc9.js +1 -0
- package/.next/static/chunks/7191-6c41898b7a10949d.js +1 -0
- package/.next/static/chunks/8129-582e407134af3f1a.js +1 -0
- package/.next/static/chunks/83.9fdb5b94d5c3bef6.js +1 -0
- package/.next/static/chunks/8325.9671795d268dfdb2.js +1 -0
- package/.next/static/chunks/8356.4635439dbf902925.js +1 -0
- package/.next/static/chunks/8447-6efec389fde51b6e.js +1 -0
- package/.next/static/chunks/{1208-9118a8f14ecf05c8.js → 8781-4af93d17573b3e9a.js} +2 -2
- package/.next/static/chunks/9111.69a1a8de40078f1a.js +1 -0
- package/.next/static/chunks/9173-cbad8ffbbf569a6c.js +1 -0
- package/.next/static/chunks/9179.ef14810b121dc48b.js +1 -0
- package/.next/static/chunks/996.e96733e3bdade217.js +1 -0
- package/.next/static/chunks/BannerNewsletter.91ff30fc775602eb.js +1 -0
- package/.next/static/chunks/BannerText.65a54c10ba0f7f56.js +1 -0
- package/.next/static/chunks/ButtonSignIn.c070c7396def00a3.js +1 -0
- package/.next/static/chunks/CartItem.29cbcf78eb695107.js +1 -0
- package/.next/static/chunks/CartSidebar.6238f6136febd636.js +1 -0
- package/.next/static/chunks/{Dropdown.38b48c749bad6b60.js → Dropdown.0f0a34d48adc2e77.js} +1 -1
- package/.next/static/chunks/DropdownButton.07bf10dec5988014.js +1 -0
- package/.next/static/chunks/{DropdownItem.38b8f5a07c7f422a.js → DropdownItem.a31b8afe9ee16164.js} +1 -1
- package/.next/static/chunks/{DropdownMenu.48b11521a24c6efd.js → DropdownMenu.c1aa48ff3605ed70.js} +1 -1
- package/.next/static/chunks/EmptyCart.ae29f391ae20e238.js +1 -0
- package/.next/static/chunks/{FilterSkeleton.7ab99e28f92341c9.js → FilterSkeleton.4a1ebda6c14c643e.js} +1 -1
- package/.next/static/chunks/Footer.94763d2da6ad156c.js +1 -0
- package/.next/static/chunks/Gift.6af1dea212bfeaf4.js +1 -0
- package/.next/static/chunks/Newsletter.fa7a7fcd860b5953.js +1 -0
- package/.next/static/chunks/OrderSummary.b3aca286bc4a6a32.js +1 -0
- package/.next/static/chunks/PreviewTag.ca63f423d71dab1e.js +1 -0
- package/.next/static/chunks/ProductShelf.da431705dda86dd9.js +1 -0
- package/.next/static/chunks/ProductTiles.e292be350f9732c3.js +1 -0
- package/.next/static/chunks/RegionModal.57d35e7cf2021937.js +1 -0
- package/.next/static/chunks/RegionSlider.878ad647cc085802.js +1 -0
- package/.next/static/chunks/ScrollToTopButton.aafc72a9514cee59.js +1 -0
- package/.next/static/chunks/Toast.58362a2d887a6ced.js +1 -0
- package/.next/static/chunks/UIBannerText.d2b439bcc5437ad5.js +1 -0
- package/.next/static/chunks/UISKUMatrixSidebar.d737170a59178c6e.js +1 -0
- package/.next/static/chunks/UIToast.c4250a6c006ff759.js +1 -0
- package/.next/static/chunks/pages/404-a2c3556b918d8548.js +1 -0
- package/.next/static/chunks/pages/500-de18520f64d225ec.js +1 -0
- package/.next/static/chunks/pages/{[...slug]-3579b3b8b8309552.js → [...slug]-fa1b54edd221c4f1.js} +1 -1
- package/.next/static/chunks/pages/[slug]/p-4d21953f31212833.js +1 -0
- package/.next/static/chunks/pages/_app-c8d9fffc5023f6bc.js +1 -0
- package/.next/static/chunks/pages/{checkout-dc07d72b3514c83d.js → checkout-06816d32d87d8edb.js} +1 -1
- package/.next/static/chunks/pages/index-27f4a375d63843ad.js +1 -0
- package/.next/static/chunks/pages/login-0f546641ef1b07f3.js +1 -0
- package/.next/static/chunks/pages/pvt/account/403-40ec6b109593186f.js +1 -0
- package/.next/static/chunks/pages/pvt/account/404-d413687fd89136d0.js +1 -0
- package/.next/static/chunks/pages/pvt/account/orders/[id]-79f5d6e25ada41b5.js +1 -0
- package/.next/static/chunks/pages/pvt/account/orders-7024ac3fcdf846ff.js +1 -0
- package/.next/static/chunks/pages/pvt/account/{profile-b6cdbf02d4682544.js → profile-eb040e581a53e019.js} +1 -1
- package/.next/static/chunks/pages/pvt/account/security-896ae26d01848b2d.js +1 -0
- package/.next/static/chunks/pages/pvt/account/{user-details-fba1822e52e7de26.js → user-details-5ab9233272d5b563.js} +1 -1
- package/.next/static/chunks/pages/s-06a0aeb10aa0ee53.js +1 -0
- package/.next/static/chunks/webpack-79aa85173d156fd1.js +1 -0
- package/.next/static/css/05b6df3951ba7e9e.css +1 -0
- package/.next/static/css/{5eecefd2c6deeee4.css → 08d03445f1797608.css} +1 -1
- package/.next/static/css/146571b0d2ad7ca7.css +1 -0
- package/.next/static/css/718d49681a48458e.css +1 -0
- package/.next/trace +140 -139
- package/.turbo/turbo-build.log +20 -20
- package/.turbo/turbo-test.log +7 -6
- package/@generated/gql.ts +2 -2
- package/@generated/graphql.ts +54 -1
- package/@generated/persisted-documents.json +1 -1
- package/@generated/schema.graphql +41 -0
- package/CHANGELOG.md +12 -0
- package/package.json +7 -7
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountBudgetsCard/MyAccountBudgetsCard.tsx +119 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountBudgetsCard/index.ts +1 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountBudgetsCard/styles.scss +129 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/MyAccountOrderActions.tsx +19 -6
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActions/styles.scss +10 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountOrderDetails.tsx +18 -5
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountReorderButton/MyAccountReorderButton.tsx +37 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountReorderButton/index.ts +2 -0
- package/src/components/account/orders/MyAccountOrderDetails/MyAccountReorderButton/styles.scss +10 -0
- package/src/components/account/orders/MyAccountOrderDetails/section.module.scss +46 -17
- package/src/pages/pvt/account/orders/[id].tsx +19 -1
- package/src/sdk/account/useReorder.ts +148 -0
- package/src/sdk/cart/redirectToCheckout.ts +15 -0
- package/src/sdk/cart/useCheckoutButton.ts +2 -9
- package/src/sdk/error/ReorderError/ReorderError.ts +6 -0
- package/.next/server/chunks/1280.js +0 -1
- package/.next/server/chunks/1454.js +0 -1
- package/.next/server/chunks/2230.js +0 -1
- package/.next/server/chunks/3006.js +0 -1
- package/.next/server/chunks/3060.js +0 -1
- package/.next/server/chunks/3408.js +0 -1
- package/.next/server/chunks/3945.js +0 -1
- package/.next/server/chunks/416.js +0 -1
- package/.next/server/chunks/5402.js +0 -1
- package/.next/server/chunks/5683.js +0 -1
- package/.next/server/chunks/6698.js +0 -1
- package/.next/server/chunks/7228.js +0 -1
- package/.next/server/chunks/7371.js +0 -1
- package/.next/server/chunks/772.js +0 -6
- package/.next/server/chunks/8307.js +0 -1
- package/.next/server/chunks/831.js +0 -1
- package/.next/server/chunks/8482.js +0 -1
- package/.next/server/chunks/8569.js +0 -1
- package/.next/server/chunks/8598.js +0 -1
- package/.next/server/chunks/8737.js +0 -1
- package/.next/server/chunks/9237.js +0 -1
- package/.next/server/chunks/9570.js +0 -1
- package/.next/static/TfWAwIRiLLmgPy8iyBQtG/_buildManifest.js +0 -1
- package/.next/static/chunks/1841.a1b15f2c88e02d32.js +0 -1
- package/.next/static/chunks/2284.dffe7b0e5a5bfb4a.js +0 -1
- package/.next/static/chunks/2500.d6beb5af6ee00a9e.js +0 -1
- package/.next/static/chunks/2851.e68ed3c8d27a032a.js +0 -1
- package/.next/static/chunks/2927.5a79877943a6bf7c.js +0 -1
- package/.next/static/chunks/3155.7bc4c730a79d9ecb.js +0 -1
- package/.next/static/chunks/3399.3e1f685c992c345b.js +0 -1
- package/.next/static/chunks/349.235b18ceb82aa256.js +0 -1
- package/.next/static/chunks/3836.612763339fc4c64c.js +0 -1
- package/.next/static/chunks/4803.9822f0b7e469b933.js +0 -1
- package/.next/static/chunks/5796.4351370494d8b8b6.js +0 -1
- package/.next/static/chunks/6031-b0b111f48a7d504d.js +0 -28
- package/.next/static/chunks/6700.a72869377e81146c.js +0 -1
- package/.next/static/chunks/6789.960162355435a81d.js +0 -1
- package/.next/static/chunks/7191-5ede6e7ef625ea77.js +0 -1
- package/.next/static/chunks/7522-9010743f5d7e8aca.js +0 -1
- package/.next/static/chunks/83.98ce246c274ee7e4.js +0 -1
- package/.next/static/chunks/8325.dabe9aa22eaadeed.js +0 -1
- package/.next/static/chunks/8587.53c8ce185ed1a2cb.js +0 -1
- package/.next/static/chunks/9173-ab3c4d9d8f978c4b.js +0 -1
- package/.next/static/chunks/9237.7555603703f81bf7.js +0 -1
- package/.next/static/chunks/9465.e09b81f7e6195587.js +0 -1
- package/.next/static/chunks/9701.b0e8741551995fbb.js +0 -1
- package/.next/static/chunks/9979.aedbc094bdc2c599.js +0 -1
- package/.next/static/chunks/BannerNewsletter.90d4a98c15a35cea.js +0 -1
- package/.next/static/chunks/BannerText.4061ccfc191e6b96.js +0 -1
- package/.next/static/chunks/ButtonSignIn.f6e210eaca873e48.js +0 -1
- package/.next/static/chunks/CartItem.092df07db9e8b271.js +0 -1
- package/.next/static/chunks/CartSidebar.3342e22b115732a3.js +0 -1
- package/.next/static/chunks/DropdownButton.66fa6b25dddb3a07.js +0 -1
- package/.next/static/chunks/EmptyCart.320e2f94a0d5e6b1.js +0 -1
- package/.next/static/chunks/Footer.63a7682a81a96f8e.js +0 -1
- package/.next/static/chunks/Gift.08db4da8c89cacf1.js +0 -1
- package/.next/static/chunks/Newsletter.dbf35a8ea6d2067e.js +0 -1
- package/.next/static/chunks/OrderSummary.f9adad5622605046.js +0 -1
- package/.next/static/chunks/PreviewTag.f4f0c8710a7bcad9.js +0 -1
- package/.next/static/chunks/ProductShelf.7ebce1c763b4508e.js +0 -1
- package/.next/static/chunks/ProductTiles.18f55314e61957f4.js +0 -1
- package/.next/static/chunks/RegionModal.a7be32d2d7832ba4.js +0 -1
- package/.next/static/chunks/RegionSlider.b4dd4e7c0483966d.js +0 -1
- package/.next/static/chunks/ScrollToTopButton.c15431f2e8bb93ef.js +0 -1
- package/.next/static/chunks/Toast.2e9b26159af29889.js +0 -1
- package/.next/static/chunks/UIBannerText.7315b16af4457059.js +0 -1
- package/.next/static/chunks/UISKUMatrixSidebar.87ba393b7d738e99.js +0 -1
- package/.next/static/chunks/UIToast.19a8664c01a00d3a.js +0 -1
- package/.next/static/chunks/pages/404-4b3f1e22c77f849a.js +0 -1
- package/.next/static/chunks/pages/500-bb2de0c11524b2b8.js +0 -1
- package/.next/static/chunks/pages/[slug]/p-7ac98274c47b0ff4.js +0 -1
- package/.next/static/chunks/pages/_app-dbee0add24c249fe.js +0 -1
- package/.next/static/chunks/pages/index-1f8bf0fb351b90f4.js +0 -1
- package/.next/static/chunks/pages/login-e97ef92769456bf6.js +0 -1
- package/.next/static/chunks/pages/pvt/account/403-91597100f8956385.js +0 -1
- package/.next/static/chunks/pages/pvt/account/404-c68124bed7cb7c48.js +0 -1
- package/.next/static/chunks/pages/pvt/account/orders/[id]-dc662a778c5b8876.js +0 -1
- package/.next/static/chunks/pages/pvt/account/orders-12a215899ae6f3eb.js +0 -1
- package/.next/static/chunks/pages/pvt/account/security-e6289a40e745d3c4.js +0 -1
- package/.next/static/chunks/pages/s-41cffb20de1d2617.js +0 -1
- package/.next/static/chunks/webpack-c6f7dbc72e738310.js +0 -1
- package/.next/static/css/31380ebc6e671486.css +0 -1
- package/.next/static/css/a6a4ebbe01adbbad.css +0 -1
- /package/.next/static/{TfWAwIRiLLmgPy8iyBQtG → 6skPsTs9THh3repcOD2W9}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
[data-fs-order-budgets-card] {
|
|
2
|
+
--fs-budgets-gap: var(--fs-spacing-3);
|
|
3
|
+
--fs-budgets-padding-y: var(--fs-spacing-2);
|
|
4
|
+
--fs-budgets-row-padding: var(--fs-spacing-3) 0;
|
|
5
|
+
--fs-budgets-font-size: var(--fs-text-size-2);
|
|
6
|
+
--fs-budgets-font-size-sm: var(--fs-text-size-1);
|
|
7
|
+
--fs-budgets-weight-regular: var(--fs-text-weight-regular);
|
|
8
|
+
--fs-budgets-weight-semibold: var(--fs-text-weight-semibold);
|
|
9
|
+
--fs-budgets-text: var(--fs-color-text);
|
|
10
|
+
--fs-budgets-text-secondary: var(--fs-color-text-secondary);
|
|
11
|
+
--fs-budgets-border-color: var(--fs-border-color-light);
|
|
12
|
+
--fs-budgets-cols-mobile: 2fr 1fr 1fr;
|
|
13
|
+
--fs-budgets-cols-desktop: 2fr 1fr 1fr 1fr;
|
|
14
|
+
|
|
15
|
+
[data-fs-budgets-table] {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-fs-budgets-table-header] {
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: var(--fs-budgets-cols-mobile);
|
|
24
|
+
gap: var(--fs-budgets-gap);
|
|
25
|
+
padding: var(--fs-budgets-padding-y) 0;
|
|
26
|
+
font-size: var(--fs-budgets-font-size);
|
|
27
|
+
font-weight: var(--fs-budgets-weight-regular);
|
|
28
|
+
color: var(--fs-budgets-text-secondary);
|
|
29
|
+
border-bottom: 1px solid var(--fs-budgets-border-color);
|
|
30
|
+
|
|
31
|
+
[data-fs-budgets-header-name] {
|
|
32
|
+
text-align: left;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-fs-budgets-header-available],
|
|
36
|
+
[data-fs-budgets-header-to-be-spent],
|
|
37
|
+
[data-fs-budgets-header-remaining] {
|
|
38
|
+
text-align: right;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include media('>=tablet') {
|
|
43
|
+
grid-template-columns: var(--fs-budgets-cols-desktop);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[data-fs-budgets-header-available] {
|
|
47
|
+
@include media('<tablet') {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[data-fs-budgets-table-body] {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
|
|
57
|
+
[data-fs-budgets-row] {
|
|
58
|
+
display: grid;
|
|
59
|
+
grid-template-columns: var(--fs-budgets-cols-mobile);
|
|
60
|
+
gap: var(--fs-budgets-gap);
|
|
61
|
+
padding: var(--fs-budgets-row-padding);
|
|
62
|
+
border-bottom: 1px solid var(--fs-budgets-border-color);
|
|
63
|
+
|
|
64
|
+
// Prevent long content from forcing the grid to overflow
|
|
65
|
+
> * {
|
|
66
|
+
min-width: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:last-child {
|
|
70
|
+
border-bottom: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@include media('>=tablet') {
|
|
74
|
+
grid-template-columns: var(--fs-budgets-cols-desktop);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[data-fs-budgets-available] {
|
|
79
|
+
@include media('<tablet') {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
[data-fs-budgets-name] {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: var(--fs-spacing-0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[data-fs-budgets-name-primary] {
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
font-size: var(--fs-budgets-font-size);
|
|
94
|
+
font-weight: var(--fs-budgets-weight-semibold);
|
|
95
|
+
line-height: 1.4;
|
|
96
|
+
color: var(--fs-budgets-text);
|
|
97
|
+
text-overflow: ellipsis;
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[data-fs-budgets-name-secondary] {
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
font-size: var(--fs-budgets-font-size-sm);
|
|
104
|
+
font-weight: var(--fs-budgets-weight-regular);
|
|
105
|
+
line-height: 1.4;
|
|
106
|
+
color: var(--fs-budgets-text-secondary);
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[data-fs-budgets-available],
|
|
112
|
+
[data-fs-budgets-to-be-spent],
|
|
113
|
+
[data-fs-budgets-remaining] {
|
|
114
|
+
font-size: var(--fs-budgets-font-size);
|
|
115
|
+
font-weight: var(--fs-budgets-weight-regular);
|
|
116
|
+
color: var(--fs-budgets-text);
|
|
117
|
+
text-align: right;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-fs-budgets-remaining] {
|
|
121
|
+
strong {
|
|
122
|
+
font-weight: var(--fs-budgets-weight-semibold);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-fs-budgets-to-be-spent] {
|
|
127
|
+
color: var(--fs-budgets-text-secondary);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -9,22 +9,29 @@ import {
|
|
|
9
9
|
import { useState } from 'react'
|
|
10
10
|
import MyAccountOrderActionModal from 'src/components/account/orders/MyAccountOrderDetails/MyAccountOrderActionModal'
|
|
11
11
|
import { useCancelOrder } from 'src/sdk/account/useCancelOrder'
|
|
12
|
+
import { useReorder } from 'src/sdk/account/useReorder'
|
|
13
|
+
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
14
|
+
|
|
15
|
+
type Order = ServerOrderDetailsQueryQuery['userOrder']
|
|
12
16
|
|
|
13
17
|
interface MyAccountOrderActionsProps {
|
|
14
18
|
allowCancellation: boolean
|
|
15
19
|
orderId: string
|
|
16
20
|
customerEmail?: string
|
|
21
|
+
order: Order
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
export default function MyAccountOrderActions({
|
|
20
25
|
allowCancellation,
|
|
21
26
|
orderId,
|
|
22
27
|
customerEmail,
|
|
28
|
+
order,
|
|
23
29
|
}: MyAccountOrderActionsProps) {
|
|
24
30
|
const [isCancelOpen, setIsCancelOpen] = useState<boolean>(false)
|
|
25
31
|
const { pushToast } = useUI()
|
|
26
32
|
|
|
27
33
|
const { cancelOrder, loading } = useCancelOrder()
|
|
34
|
+
const { reorder } = useReorder()
|
|
28
35
|
|
|
29
36
|
const handleCancel = async () => {
|
|
30
37
|
const data = {
|
|
@@ -54,9 +61,8 @@ export default function MyAccountOrderActions({
|
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return null
|
|
64
|
+
const handleReorder = () => {
|
|
65
|
+
reorder(order)
|
|
60
66
|
}
|
|
61
67
|
|
|
62
68
|
return (
|
|
@@ -67,13 +73,20 @@ export default function MyAccountOrderActions({
|
|
|
67
73
|
<UIIcon name="DotsThree" data-fs-dropdown-icon />
|
|
68
74
|
</DropdownButton>
|
|
69
75
|
<DropdownMenu align="right">
|
|
76
|
+
<DropdownItem
|
|
77
|
+
type="button"
|
|
78
|
+
onClick={handleReorder}
|
|
79
|
+
data-fs-order-actions-item
|
|
80
|
+
data-fs-order-actions-item-reorder
|
|
81
|
+
>
|
|
82
|
+
Reorder
|
|
83
|
+
</DropdownItem>
|
|
70
84
|
{allowCancellation && (
|
|
71
85
|
<DropdownItem
|
|
72
86
|
type="button"
|
|
73
87
|
onClick={() => setIsCancelOpen(true)}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}}
|
|
88
|
+
data-fs-order-actions-item
|
|
89
|
+
data-fs-order-actions-item-cancel
|
|
77
90
|
>
|
|
78
91
|
Cancel order
|
|
79
92
|
</DropdownItem>
|
|
@@ -6,7 +6,9 @@ import { MyAccountDeliveryOptionAccordion } from './MyAccountDeliveryOptionAccor
|
|
|
6
6
|
import MyAccountOrderActions from './MyAccountOrderActions'
|
|
7
7
|
import MyAccountOrderedByCard from './MyAccountOrderedByCard'
|
|
8
8
|
import MyAccountPaymentCard from './MyAccountPaymentCard'
|
|
9
|
+
import MyAccountReorderButton from './MyAccountReorderButton'
|
|
9
10
|
import MyAccountSummaryCard from './MyAccountSummaryCard'
|
|
11
|
+
import MyAccountBudgetsCard from './MyAccountBudgetsCard'
|
|
10
12
|
|
|
11
13
|
import type {
|
|
12
14
|
ServerOrderDetailsQueryQuery,
|
|
@@ -55,11 +57,15 @@ export default function MyAccountOrderDetails({
|
|
|
55
57
|
</div>
|
|
56
58
|
</div>
|
|
57
59
|
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
<div data-fs-order-details-header-actions>
|
|
61
|
+
<MyAccountReorderButton order={order} />
|
|
62
|
+
<MyAccountOrderActions
|
|
63
|
+
allowCancellation={order.allowCancellation}
|
|
64
|
+
orderId={order.orderId}
|
|
65
|
+
customerEmail={order.clientProfileData?.email}
|
|
66
|
+
order={order}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
63
69
|
</header>
|
|
64
70
|
|
|
65
71
|
<main data-fs-order-details-content>
|
|
@@ -117,6 +123,13 @@ export default function MyAccountOrderDetails({
|
|
|
117
123
|
{moreInformationCustomFields?.length > 0 && (
|
|
118
124
|
<MyAccountMoreInformationCard fields={moreInformationCustomFields} />
|
|
119
125
|
)}
|
|
126
|
+
|
|
127
|
+
{order.budgetData && (
|
|
128
|
+
<MyAccountBudgetsCard
|
|
129
|
+
budgetData={order.budgetData}
|
|
130
|
+
currencyCode={order.storePreferencesData.currencyCode}
|
|
131
|
+
/>
|
|
132
|
+
)}
|
|
120
133
|
</main>
|
|
121
134
|
</div>
|
|
122
135
|
)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Button } from '@faststore/ui'
|
|
2
|
+
import { useReorder } from 'src/sdk/account/useReorder'
|
|
3
|
+
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
4
|
+
|
|
5
|
+
type Order = ServerOrderDetailsQueryQuery['userOrder']
|
|
6
|
+
|
|
7
|
+
export interface MyAccountReorderButtonProps {
|
|
8
|
+
order: Order
|
|
9
|
+
onClick?: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function MyAccountReorderButton({
|
|
13
|
+
order,
|
|
14
|
+
onClick,
|
|
15
|
+
}: MyAccountReorderButtonProps) {
|
|
16
|
+
const { reorder, loading } = useReorder()
|
|
17
|
+
|
|
18
|
+
const handleClick = async () => {
|
|
19
|
+
try {
|
|
20
|
+
await reorder(order)
|
|
21
|
+
onClick?.()
|
|
22
|
+
} catch (error) {
|
|
23
|
+
console.error(error)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Button
|
|
29
|
+
variant="secondary"
|
|
30
|
+
data-fs-reorder-button
|
|
31
|
+
onClick={handleClick}
|
|
32
|
+
disabled={loading}
|
|
33
|
+
>
|
|
34
|
+
Reorder
|
|
35
|
+
</Button>
|
|
36
|
+
)
|
|
37
|
+
}
|
package/src/components/account/orders/MyAccountOrderDetails/MyAccountReorderButton/styles.scss
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[data-fs-reorder-button] {
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
|
|
4
|
+
&:hover:not(:disabled) {
|
|
5
|
+
--fs-button-secondary-bkg-color: var(--fs-button-primary-bkg-color);
|
|
6
|
+
--fs-button-secondary-text-color: var(--fs-button-primary-text-color);
|
|
7
|
+
--fs-button-secondary-bkg-color-hover: var(--fs-button-primary-bkg-color-hover);
|
|
8
|
+
--fs-button-secondary-bkg-color-active: var(--fs-button-primary-bkg-color-active);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -15,33 +15,35 @@
|
|
|
15
15
|
@import "./MyAccountPaymentCard/styles.scss";
|
|
16
16
|
@import "./MyAccountDeliveryOptionAccordion/styles.scss";
|
|
17
17
|
@import "./MyAccountOrderActions/styles.scss";
|
|
18
|
+
@import "./MyAccountReorderButton/styles.scss";
|
|
18
19
|
@import "./MyAccountStatusCard/styles.scss";
|
|
19
20
|
@import "./MyAccountMoreInformationCard/styles.scss";
|
|
20
21
|
@import "./MyAccountBuyingPolicyAlert/styles.scss";
|
|
22
|
+
@import "./MyAccountBudgetsCard/styles.scss";
|
|
21
23
|
|
|
22
24
|
// --------------------------------------------------------
|
|
23
25
|
// Design Tokens
|
|
24
26
|
// --------------------------------------------------------
|
|
25
27
|
|
|
26
28
|
// Default properties
|
|
27
|
-
--fs-order-details-padding
|
|
29
|
+
--fs-order-details-padding: 0 20px;
|
|
28
30
|
|
|
29
31
|
// Header
|
|
30
|
-
--fs-order-details-header-gap
|
|
31
|
-
--fs-order-details-header-padding
|
|
32
|
-
--fs-order-details-header-weight
|
|
33
|
-
--fs-order-details-header-size
|
|
34
|
-
--fs-order-details-header-line-height
|
|
32
|
+
--fs-order-details-header-gap: var(--fs-spacing-3);
|
|
33
|
+
--fs-order-details-header-padding: var(--fs-spacing-5) 0 var(--fs-spacing-4);
|
|
34
|
+
--fs-order-details-header-weight: var(--fs-text-weight-semibold);
|
|
35
|
+
--fs-order-details-header-size: var(--fs-text-size-4);
|
|
36
|
+
--fs-order-details-header-line-height: 1.33;
|
|
35
37
|
|
|
36
38
|
// Content
|
|
37
|
-
--fs-order-details-content-gap
|
|
39
|
+
--fs-order-details-content-gap: var(--fs-spacing-4);
|
|
38
40
|
|
|
39
41
|
// --------------------------------------------------------
|
|
40
42
|
// Structural Styles
|
|
41
43
|
// --------------------------------------------------------
|
|
42
44
|
|
|
43
|
-
@include media
|
|
44
|
-
--fs-order-details-padding
|
|
45
|
+
@include media(">=notebook") {
|
|
46
|
+
--fs-order-details-padding: 0;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
[data-fs-order-details-header] {
|
|
@@ -52,14 +54,14 @@
|
|
|
52
54
|
justify-content: space-between;
|
|
53
55
|
padding: var(--fs-order-details-header-padding);
|
|
54
56
|
|
|
55
|
-
@include media
|
|
56
|
-
--fs-order-details-header-gap
|
|
57
|
+
@include media(">=tablet") {
|
|
58
|
+
--fs-order-details-header-gap: var(--fs-spacing-2);
|
|
57
59
|
|
|
58
60
|
align-items: center;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
@include media
|
|
62
|
-
--fs-order-details-header-padding
|
|
63
|
+
@include media(">=notebook") {
|
|
64
|
+
--fs-order-details-header-padding: var(--fs-spacing-6) 0;
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
[data-fs-order-details-header-title] {
|
|
@@ -70,11 +72,21 @@
|
|
|
70
72
|
|
|
71
73
|
[data-fs-order-details-header-back-button] {
|
|
72
74
|
flex-shrink: 0;
|
|
73
|
-
margin-top:
|
|
74
|
-
|
|
75
|
+
margin-top:
|
|
76
|
+
calc(
|
|
77
|
+
var(--fs-spacing-2) * -1
|
|
78
|
+
); // Align the back button with the title
|
|
79
|
+
|
|
80
|
+
margin-left:
|
|
81
|
+
calc(
|
|
82
|
+
var(--fs-spacing-2) * -1
|
|
83
|
+
); // Align the back button with the content
|
|
75
84
|
|
|
76
85
|
@include media(">=notebook") {
|
|
77
|
-
margin-top:
|
|
86
|
+
margin-top:
|
|
87
|
+
calc(
|
|
88
|
+
var(--fs-spacing-1) * -1
|
|
89
|
+
); // Align the back button with the title
|
|
78
90
|
}
|
|
79
91
|
}
|
|
80
92
|
|
|
@@ -98,6 +110,19 @@
|
|
|
98
110
|
@include truncate-title(2);
|
|
99
111
|
}
|
|
100
112
|
}
|
|
113
|
+
|
|
114
|
+
[data-fs-order-details-header-actions] {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: row;
|
|
117
|
+
gap: var(--fs-spacing-2);
|
|
118
|
+
align-items: center;
|
|
119
|
+
|
|
120
|
+
[data-fs-reorder-button] {
|
|
121
|
+
@include media("<tablet") {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
101
126
|
}
|
|
102
127
|
|
|
103
128
|
[data-fs-order-details-content] {
|
|
@@ -105,7 +130,7 @@
|
|
|
105
130
|
flex-direction: column;
|
|
106
131
|
gap: var(--fs-order-details-content-gap);
|
|
107
132
|
|
|
108
|
-
@include media
|
|
133
|
+
@include media(">=notebook") {
|
|
109
134
|
display: grid;
|
|
110
135
|
grid-template-columns: repeat(2, 1fr);
|
|
111
136
|
}
|
|
@@ -125,5 +150,9 @@
|
|
|
125
150
|
[data-fs-delivery-option-accordion] {
|
|
126
151
|
grid-column: span 2;
|
|
127
152
|
}
|
|
153
|
+
|
|
154
|
+
[data-fs-order-budgets-card] {
|
|
155
|
+
grid-column: span 2;
|
|
156
|
+
}
|
|
128
157
|
}
|
|
129
158
|
}
|
|
@@ -257,6 +257,22 @@ const query = gql(`
|
|
|
257
257
|
email
|
|
258
258
|
phone
|
|
259
259
|
}
|
|
260
|
+
budgetData {
|
|
261
|
+
budgets {
|
|
262
|
+
id
|
|
263
|
+
name
|
|
264
|
+
balance {
|
|
265
|
+
remaining
|
|
266
|
+
}
|
|
267
|
+
allocations {
|
|
268
|
+
id
|
|
269
|
+
linkedEntity {
|
|
270
|
+
id
|
|
271
|
+
}
|
|
272
|
+
reservations
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
260
276
|
}
|
|
261
277
|
accountProfile {
|
|
262
278
|
name
|
|
@@ -339,10 +355,12 @@ export const getServerSideProps: GetServerSideProps<
|
|
|
339
355
|
globalSectionsFooter,
|
|
340
356
|
})
|
|
341
357
|
|
|
358
|
+
const order = orderDetails.data.userOrder
|
|
359
|
+
|
|
342
360
|
return {
|
|
343
361
|
props: {
|
|
344
362
|
globalSections: globalSectionsResult,
|
|
345
|
-
order
|
|
363
|
+
order,
|
|
346
364
|
accountName: orderDetails.data.accountProfile.name,
|
|
347
365
|
isRepresentative,
|
|
348
366
|
},
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import type { ServerOrderDetailsQueryQuery } from '@generated/graphql'
|
|
3
|
+
import { cartStore, ValidateCartMutation } from '../cart'
|
|
4
|
+
import type {
|
|
5
|
+
IStoreOffer,
|
|
6
|
+
ValidateCartMutationMutation,
|
|
7
|
+
ValidateCartMutationMutationVariables,
|
|
8
|
+
CartItemFragment,
|
|
9
|
+
IStoreCart,
|
|
10
|
+
} from '@generated/graphql'
|
|
11
|
+
import { request } from '../graphql/request'
|
|
12
|
+
import { sessionStore } from '../session'
|
|
13
|
+
import { redirectToCheckout } from '../cart/redirectToCheckout'
|
|
14
|
+
import ReorderError from '../error/ReorderError/ReorderError'
|
|
15
|
+
|
|
16
|
+
type Order = ServerOrderDetailsQueryQuery['userOrder']
|
|
17
|
+
type AdditionalProperties =
|
|
18
|
+
CartItemFragment['itemOffered']['additionalProperty']
|
|
19
|
+
|
|
20
|
+
const getItemId = (item: CartItemFragment) => {
|
|
21
|
+
const propertyIds =
|
|
22
|
+
item.itemOffered.additionalProperty
|
|
23
|
+
?.map((prop) => prop.propertyID)
|
|
24
|
+
.join('-') ?? ''
|
|
25
|
+
|
|
26
|
+
const sellerId = item.seller?.identifier ?? ''
|
|
27
|
+
|
|
28
|
+
return [item.itemOffered.sku, sellerId, propertyIds]
|
|
29
|
+
.filter(Boolean)
|
|
30
|
+
.join('::')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const useReorder = () => {
|
|
34
|
+
const [loading, setLoading] = useState(false)
|
|
35
|
+
const [error, setError] = useState<Error | null>(null)
|
|
36
|
+
|
|
37
|
+
const reorder = async (order: Order | null | undefined) => {
|
|
38
|
+
if (!order) {
|
|
39
|
+
const err = new ReorderError('Order not found')
|
|
40
|
+
setError(err)
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const deliveryOptions = order.deliveryOptionsData?.deliveryOptions ?? []
|
|
45
|
+
const orderItemsWithSeller =
|
|
46
|
+
deliveryOptions.flatMap((option) =>
|
|
47
|
+
(option?.items ?? []).map((item) => ({
|
|
48
|
+
...item,
|
|
49
|
+
seller: option?.seller,
|
|
50
|
+
}))
|
|
51
|
+
) ?? []
|
|
52
|
+
|
|
53
|
+
if (!orderItemsWithSeller || orderItemsWithSeller.length === 0) {
|
|
54
|
+
const err = new ReorderError('No items found in order')
|
|
55
|
+
setError(err)
|
|
56
|
+
return
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
setLoading(true)
|
|
60
|
+
setError(null)
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
const currentCart = cartStore.read()
|
|
64
|
+
|
|
65
|
+
const acceptedOffer: IStoreOffer[] = orderItemsWithSeller
|
|
66
|
+
.filter(
|
|
67
|
+
(item) =>
|
|
68
|
+
item && item.id && item.quantity && item.seller && item.quantity > 0
|
|
69
|
+
)
|
|
70
|
+
.map((item) => ({
|
|
71
|
+
quantity: item.quantity,
|
|
72
|
+
seller: {
|
|
73
|
+
identifier: item.seller,
|
|
74
|
+
},
|
|
75
|
+
price: item.price ?? 0,
|
|
76
|
+
listPrice: item.price ?? 0,
|
|
77
|
+
itemOffered: {
|
|
78
|
+
sku: item.id ?? '',
|
|
79
|
+
image: item.imageUrl
|
|
80
|
+
? [
|
|
81
|
+
{
|
|
82
|
+
url: item.imageUrl,
|
|
83
|
+
alternateName: item.name ?? '',
|
|
84
|
+
},
|
|
85
|
+
]
|
|
86
|
+
: [],
|
|
87
|
+
name: item.name ?? '',
|
|
88
|
+
additionalProperty: [] as AdditionalProperties,
|
|
89
|
+
},
|
|
90
|
+
}))
|
|
91
|
+
|
|
92
|
+
if (acceptedOffer.length === 0) {
|
|
93
|
+
throw new ReorderError('No valid items to reorder')
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const orderPayload: Partial<IStoreCart['order']> & {
|
|
97
|
+
acceptedOffer: IStoreCart['order']['acceptedOffer']
|
|
98
|
+
shouldSplitItem?: IStoreCart['order']['shouldSplitItem']
|
|
99
|
+
} = {
|
|
100
|
+
acceptedOffer,
|
|
101
|
+
shouldSplitItem: false,
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (currentCart.id) {
|
|
105
|
+
orderPayload.orderNumber = currentCart.id
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const { validateCart: validated } = await request<
|
|
109
|
+
ValidateCartMutationMutation,
|
|
110
|
+
ValidateCartMutationMutationVariables
|
|
111
|
+
>(ValidateCartMutation, {
|
|
112
|
+
session: sessionStore.read(),
|
|
113
|
+
cart: {
|
|
114
|
+
order: orderPayload as IStoreCart['order'],
|
|
115
|
+
},
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
if (!validated) {
|
|
119
|
+
throw new ReorderError('Failed to add items to cart')
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const updatedCart = {
|
|
123
|
+
id: validated.order.orderNumber,
|
|
124
|
+
items: validated.order.acceptedOffer.map((item) => ({
|
|
125
|
+
...item,
|
|
126
|
+
id: getItemId(item),
|
|
127
|
+
})),
|
|
128
|
+
messages: validated.messages,
|
|
129
|
+
shouldSplitItem: validated.order.shouldSplitItem,
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
cartStore.set(updatedCart)
|
|
133
|
+
|
|
134
|
+
redirectToCheckout(validated.order.orderNumber)
|
|
135
|
+
} catch (err) {
|
|
136
|
+
setError(err instanceof Error ? err : new ReorderError('Unknown error'))
|
|
137
|
+
console.error('Error reordering:', err)
|
|
138
|
+
} finally {
|
|
139
|
+
setLoading(false)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
reorder,
|
|
145
|
+
loading,
|
|
146
|
+
error,
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import storeConfig from '../../../discovery.config'
|
|
2
|
+
|
|
3
|
+
export const redirectToCheckout = (orderFormId?: string) => {
|
|
4
|
+
const isDevEnv =
|
|
5
|
+
window.location.host.includes('.vtex.app') ||
|
|
6
|
+
window.location.host.includes('localhost')
|
|
7
|
+
|
|
8
|
+
if (!isDevEnv) {
|
|
9
|
+
window.location.href = `${storeConfig.checkoutUrl}`
|
|
10
|
+
} else if (orderFormId) {
|
|
11
|
+
window.location.href = `${storeConfig.checkoutUrl}?orderFormId=${orderFormId}`
|
|
12
|
+
} else {
|
|
13
|
+
window.location.href = `${storeConfig.checkoutUrl}`
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import storeConfig from '../../../discovery.config'
|
|
2
1
|
import { useCart } from './index'
|
|
2
|
+
import { redirectToCheckout } from './redirectToCheckout'
|
|
3
3
|
|
|
4
4
|
export const useCheckoutButton = () => {
|
|
5
5
|
const { isValidating, id } = useCart()
|
|
6
6
|
|
|
7
7
|
const onClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
|
8
8
|
e.preventDefault()
|
|
9
|
-
const isDevEnv =
|
|
10
|
-
window.location.host.includes('.vtex.app') ||
|
|
11
|
-
window.location.host.includes('localhost')
|
|
12
9
|
|
|
13
10
|
if (!isValidating) {
|
|
14
|
-
|
|
15
|
-
window.location.href = `${storeConfig.checkoutUrl}`
|
|
16
|
-
} else if (id) {
|
|
17
|
-
window.location.href = `${storeConfig.checkoutUrl}?orderFormId=${id}`
|
|
18
|
-
}
|
|
11
|
+
redirectToCheckout(id)
|
|
19
12
|
}
|
|
20
13
|
}
|
|
21
14
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=1280,exports.ids=[1280],exports.modules={81280:(e,t,n)=>{var s=n(16689);let o={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},i={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},a="mousemove",c="mouseup";function rotateXYByAngle(e,t){if(0===t)return e;let n=Math.PI/180*t,s=e[0]*Math.cos(n)+e[1]*Math.sin(n),o=e[1]*Math.cos(n)-e[0]*Math.sin(n);return[s,o]}t.QS=function(e){var t,n,r;let u;let{trackMouse:l}=e,p=s.useRef(Object.assign({},i)),h=s.useRef(Object.assign({},o)),g=s.useRef(Object.assign({},h.current));for(u in g.current=Object.assign({},h.current),h.current=Object.assign(Object.assign({},o),e),o)void 0===h.current[u]&&(h.current[u]=o[u]);let[O,v]=s.useMemo(()=>(function(e,t){let onStart=t=>{let n="touches"in t;n&&t.touches.length>1||e((e,s)=>{s.trackMouse&&!n&&(document.addEventListener(a,onMove),document.addEventListener(c,onUp));let{clientX:o,clientY:r}=n?t.touches[0]:t,u=rotateXYByAngle([o,r],s.rotationAngle);return s.onTouchStartOrOnMouseDown&&s.onTouchStartOrOnMouseDown({event:t}),Object.assign(Object.assign(Object.assign({},e),i),{initial:u.slice(),xy:u,start:t.timeStamp||0})})},onMove=t=>{e((e,n)=>{let s="touches"in t;if(s&&t.touches.length>1)return e;if(t.timeStamp-e.start>n.swipeDuration)return e.swiping?Object.assign(Object.assign({},e),{swiping:!1}):e;let{clientX:i,clientY:a}=s?t.touches[0]:t,[c,r]=rotateXYByAngle([i,a],n.rotationAngle),u=c-e.xy[0],l=r-e.xy[1],p=Math.abs(u),h=Math.abs(l),g=(t.timeStamp||0)-e.start,O=Math.sqrt(p*p+h*h)/(g||1),v=[u/(g||1),l/(g||1)],b=p>h?u>0?"Right":"Left":l>0?"Down":"Up",d="number"==typeof n.delta?n.delta:n.delta[b.toLowerCase()]||o.delta;if(p<d&&h<d&&!e.swiping)return e;let S={absX:p,absY:h,deltaX:u,deltaY:l,dir:b,event:t,first:e.first,initial:e.initial,velocity:O,vxvy:v};S.first&&n.onSwipeStart&&n.onSwipeStart(S),n.onSwiping&&n.onSwiping(S);let j=!1;return(n.onSwiping||n.onSwiped||n[`onSwiped${b}`])&&(j=!0),j&&n.preventScrollOnSwipe&&n.trackTouch&&t.cancelable&&t.preventDefault(),Object.assign(Object.assign({},e),{first:!1,eventData:S,swiping:!0})})},onEnd=t=>{e((e,n)=>{let s;if(e.swiping&&e.eventData){if(t.timeStamp-e.start<n.swipeDuration){s=Object.assign(Object.assign({},e.eventData),{event:t}),n.onSwiped&&n.onSwiped(s);let o=n[`onSwiped${s.dir}`];o&&o(s)}}else n.onTap&&n.onTap({event:t});return n.onTouchEndOrOnMouseUp&&n.onTouchEndOrOnMouseUp({event:t}),Object.assign(Object.assign(Object.assign({},e),i),{eventData:s})})},cleanUpMouse=()=>{document.removeEventListener(a,onMove),document.removeEventListener(c,onUp)},onUp=e=>{cleanUpMouse(),onEnd(e)},attachTouch=(e,t)=>{let cleanup=()=>{};if(e&&e.addEventListener){let n=Object.assign(Object.assign({},o.touchEventOptions),t.touchEventOptions),s=[["touchstart",onStart,n],["touchmove",onMove,Object.assign(Object.assign({},n),t.preventScrollOnSwipe?{passive:!1}:{})],["touchend",onEnd,n]];s.forEach(([t,n,s])=>e.addEventListener(t,n,s)),cleanup=()=>s.forEach(([t,n])=>e.removeEventListener(t,n))}return cleanup},n={ref:t=>{null!==t&&e((e,n)=>{if(e.el===t)return e;let s={};return e.el&&e.el!==t&&e.cleanUpTouch&&(e.cleanUpTouch(),s.cleanUpTouch=void 0),n.trackTouch&&t&&(s.cleanUpTouch=attachTouch(t,n)),Object.assign(Object.assign(Object.assign({},e),{el:t}),s)})}};return t.trackMouse&&(n.onMouseDown=onStart),[n,attachTouch]})(e=>p.current=e(p.current,h.current),{trackMouse:l}),[l]);return p.current=(t=p.current,n=h.current,r=g.current,n.trackTouch&&t.el?t.cleanUpTouch?n.preventScrollOnSwipe!==r.preventScrollOnSwipe||n.touchEventOptions.passive!==r.touchEventOptions.passive?(t.cleanUpTouch(),Object.assign(Object.assign({},t),{cleanUpTouch:v(t.el,n)})):t:Object.assign(Object.assign({},t),{cleanUpTouch:v(t.el,n)}):(t.cleanUpTouch&&t.cleanUpTouch(),Object.assign(Object.assign({},t),{cleanUpTouch:void 0}))),O}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.id=1454,exports.ids=[1454],exports.modules={47866:(e,t,r)=>{r.d(t,{Z:()=>i});var a=r(16689),n=r.n(a),s=r(63442);let d=(0,a.forwardRef)(function({testId:e="fs-sku-matrix",children:t,...r},a){return n().createElement("div",{ref:a,"data-fs-sku-matrix":!0,"data-testid":e,...r},n().createElement(s.Z,null,t))}),i=d},27859:(e,t,r)=>{r.d(t,{Z:()=>f});var a=r(16689),n=r.n(a),s=r(83339),d=r(72955);let i=(0,a.forwardRef)(function({children:e,variant:t="secondary",onClick:r,...a},i){let{setIsOpen:f}=(0,d._)();return n().createElement(s.Z,{ref:i,variant:t,onClick:e=>{f(!0),r?.(e)},...a},e)}),f=i}};
|