@salla.sa/twilight-theme-engine 1.0.84 → 1.0.86
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/dist/{AddToCartForm-JUMFLSKN.js → AddToCartForm-5X2WZDWR.js} +3 -3
- package/dist/{AddToCartForm-JUMFLSKN.js.map → AddToCartForm-5X2WZDWR.js.map} +1 -1
- package/dist/{BlogAuthorPage-LFAUMKC7.js → BlogAuthorPage-LO7FSSJR.js} +12 -10
- package/dist/BlogAuthorPage-LO7FSSJR.js.map +1 -0
- package/dist/{BlogCategoryPage-NWYFFPCD.js → BlogCategoryPage-KKFQ3PGR.js} +12 -10
- package/dist/BlogCategoryPage-KKFQ3PGR.js.map +1 -0
- package/dist/{BlogPage-BOHXFV7E.js → BlogPage-VLF3NSGE.js} +11 -9
- package/dist/BlogPage-VLF3NSGE.js.map +1 -0
- package/dist/{BlogSinglePage-FYEXQPMB.js → BlogSinglePage-AVK535IW.js} +11 -9
- package/dist/BlogSinglePage-AVK535IW.js.map +1 -0
- package/dist/{BlogTagPage-DAM3RNVA.js → BlogTagPage-F3T4D7RH.js} +12 -10
- package/dist/BlogTagPage-F3T4D7RH.js.map +1 -0
- package/dist/{BrandsPage-GAKQCE6O.js → BrandsPage-LVSBZSVC.js} +11 -9
- package/dist/BrandsPage-LVSBZSVC.js.map +1 -0
- package/dist/{Breadcrumb-NAYSZNRV.js → Breadcrumb-VLFTXRFC.js} +11 -9
- package/dist/Breadcrumb-VLFTXRFC.js.map +1 -0
- package/dist/{CartItem-ZRVLIZT3.js → CartItem-G3H34GW6.js} +11 -9
- package/dist/CartItem-G3H34GW6.js.map +1 -0
- package/dist/{CartSummary-U2TVLG35.js → CartSummary-VH37RPUI.js} +11 -9
- package/dist/CartSummary-VH37RPUI.js.map +1 -0
- package/dist/{Copyright-2LSBADZD.js → Copyright-HE5ZWINZ.js} +3 -3
- package/dist/{Copyright-2LSBADZD.js.map → Copyright-HE5ZWINZ.js.map} +1 -1
- package/dist/{CustomerLayout-WSKXWI7D.js → CustomerLayout-LKBLOAVW.js} +11 -9
- package/dist/CustomerLayout-LKBLOAVW.js.map +1 -0
- package/dist/{Footer-ONNRJU4G.js → Footer-HHXAST72.js} +5 -5
- package/dist/{Footer-ONNRJU4G.js.map → Footer-HHXAST72.js.map} +1 -1
- package/dist/{Header-C6VXLLUC.js → Header-GEVZM2YG.js} +8 -6
- package/dist/{Header-C6VXLLUC.js.map → Header-GEVZM2YG.js.map} +1 -1
- package/dist/{LoyaltyPage-IG5KSYNO.js → LoyaltyPage-M5CT3CFD.js} +11 -9
- package/dist/LoyaltyPage-M5CT3CFD.js.map +1 -0
- package/dist/{LoyaltyPointsPage-RKO56ZER.js → LoyaltyPointsPage-SDJB52U6.js} +10 -3
- package/dist/LoyaltyPointsPage-SDJB52U6.js.map +1 -0
- package/dist/{MainMenu-USOYTKPU.js → MainMenu-I7EYS752.js} +3 -3
- package/dist/{MainMenu-USOYTKPU.js.map → MainMenu-I7EYS752.js.map} +1 -1
- package/dist/{MasterLayout-2W24ACEK.js → MasterLayout-QDK4T3NE.js} +11 -9
- package/dist/{MasterLayout-2W24ACEK.js.map → MasterLayout-QDK4T3NE.js.map} +1 -1
- package/dist/{MobileMenu-E4X2GOZ3.js → MobileMenu-7VTCWAVJ.js} +11 -9
- package/dist/MobileMenu-7VTCWAVJ.js.map +1 -0
- package/dist/{NotificationsPage-BJ5XVWEG.js → NotificationsPage-QCABE6QD.js} +11 -9
- package/dist/NotificationsPage-QCABE6QD.js.map +1 -0
- package/dist/{OrderSinglePage-544E36FJ.js → OrderSinglePage-2HVBKBG4.js} +11 -9
- package/dist/OrderSinglePage-2HVBKBG4.js.map +1 -0
- package/dist/{OrdersPage-AFBWVTZU.js → OrdersPage-5MNCPCM3.js} +11 -9
- package/dist/OrdersPage-5MNCPCM3.js.map +1 -0
- package/dist/{PageSingle-H2EJIL74.js → PageSingle-EN5XIM2B.js} +3 -3
- package/dist/{PageSingle-H2EJIL74.js.map → PageSingle-EN5XIM2B.js.map} +1 -1
- package/dist/{ProductDetails-SDZHALU6.js → ProductDetails-UEWQPPDZ.js} +13 -6
- package/dist/ProductDetails-UEWQPPDZ.js.map +1 -0
- package/dist/{ProfilePage-V5KV6GQK.js → ProfilePage-TZSU3GHZ.js} +11 -9
- package/dist/ProfilePage-TZSU3GHZ.js.map +1 -0
- package/dist/{ReviewsPage-CXKJABXP.js → ReviewsPage-WYZ6CHF2.js} +3 -3
- package/dist/{ReviewsPage-CXKJABXP.js.map → ReviewsPage-WYZ6CHF2.js.map} +1 -1
- package/dist/{SeoCartWidget-JAV6M3X5.js → SeoCartWidget-5JR5RXQM.js} +11 -9
- package/dist/SeoCartWidget-5JR5RXQM.js.map +1 -0
- package/dist/{SettingsPage-43SUCLQR.js → SettingsPage-DIDRQXMM.js} +11 -9
- package/dist/SettingsPage-DIDRQXMM.js.map +1 -0
- package/dist/{StoreClosedNotification-MINBJOGZ.js → StoreClosedNotification-C2G32E34.js} +12 -10
- package/dist/{StoreClosedNotification-MINBJOGZ.js.map → StoreClosedNotification-C2G32E34.js.map} +1 -1
- package/dist/{TestimonialsPage-RLLIDLOA.js → TestimonialsPage-XPHFRBZ7.js} +3 -3
- package/dist/{TestimonialsPage-RLLIDLOA.js.map → TestimonialsPage-XPHFRBZ7.js.map} +1 -1
- package/dist/{ThankYouPage-52SSZ7FV.js → ThankYouPage-UA6YYFB2.js} +11 -9
- package/dist/ThankYouPage-UA6YYFB2.js.map +1 -0
- package/dist/{WalletPage-4AN4UJ52.js → WalletPage-AJVV7LVL.js} +11 -9
- package/dist/WalletPage-AJVV7LVL.js.map +1 -0
- package/dist/{WishlistPage-L6IYJUJZ.js → WishlistPage-UW6LJLSW.js} +11 -9
- package/dist/WishlistPage-UW6LJLSW.js.map +1 -0
- package/dist/api/advertisement.d.ts +33 -0
- package/dist/api/advertisement.d.ts.map +1 -0
- package/dist/api/advertisement.js +8 -0
- package/dist/api/advertisement.js.map +1 -0
- package/dist/boot/critical-style.d.ts +3 -0
- package/dist/boot/critical-style.d.ts.map +1 -0
- package/dist/boot/index.d.ts +15 -0
- package/dist/boot/index.d.ts.map +1 -0
- package/dist/boot.d.ts +1 -0
- package/dist/boot.js +69 -0
- package/dist/boot.js.map +1 -0
- package/dist/{chunk-R5BQDCDK.js → chunk-2HCCIHU7.js} +4 -4
- package/dist/{chunk-R5BQDCDK.js.map → chunk-2HCCIHU7.js.map} +1 -1
- package/dist/chunk-4FJGZQD3.js +6 -0
- package/dist/chunk-4FJGZQD3.js.map +1 -0
- package/dist/{chunk-UNEZZMQA.js → chunk-4WVJJ7SN.js} +20 -4
- package/dist/chunk-4WVJJ7SN.js.map +1 -0
- package/dist/{chunk-FFWSQJLV.js → chunk-BAYGWTNM.js} +3 -3
- package/dist/{chunk-FFWSQJLV.js.map → chunk-BAYGWTNM.js.map} +1 -1
- package/dist/{chunk-WSRVPR7V.js → chunk-CLBFF2CY.js} +3 -3
- package/dist/{chunk-WSRVPR7V.js.map → chunk-CLBFF2CY.js.map} +1 -1
- package/dist/chunk-DBW7XXNE.js +103 -0
- package/dist/chunk-DBW7XXNE.js.map +1 -0
- package/dist/{chunk-CCUE2FMU.js → chunk-DBXH3EMJ.js} +3 -3
- package/dist/{chunk-CCUE2FMU.js.map → chunk-DBXH3EMJ.js.map} +1 -1
- package/dist/{chunk-MECSOKS7.js → chunk-E26YG3AO.js} +4 -4
- package/dist/{chunk-MECSOKS7.js.map → chunk-E26YG3AO.js.map} +1 -1
- package/dist/{chunk-22SH7OVF.js → chunk-E7WWO3V3.js} +3 -3
- package/dist/{chunk-22SH7OVF.js.map → chunk-E7WWO3V3.js.map} +1 -1
- package/dist/{chunk-IC6XW3PD.js → chunk-HQ7WA37L.js} +7 -7
- package/dist/{chunk-IC6XW3PD.js.map → chunk-HQ7WA37L.js.map} +1 -1
- package/dist/chunk-IVBOLREE.js +29 -0
- package/dist/chunk-IVBOLREE.js.map +1 -0
- package/dist/{chunk-RRGEASAL.js → chunk-KP3VYG4F.js} +6 -6
- package/dist/{chunk-RRGEASAL.js.map → chunk-KP3VYG4F.js.map} +1 -1
- package/dist/{chunk-EFF2WO6W.js → chunk-PWTXR4RR.js} +10 -10
- package/dist/{chunk-EFF2WO6W.js.map → chunk-PWTXR4RR.js.map} +1 -1
- package/dist/chunk-QJYUTRAQ.js +14 -0
- package/dist/{chunk-4EA56R6I.js.map → chunk-QJYUTRAQ.js.map} +1 -1
- package/dist/{chunk-YFQUSAET.js → chunk-U55ZJC2X.js} +4 -4
- package/dist/{chunk-YFQUSAET.js.map → chunk-U55ZJC2X.js.map} +1 -1
- package/dist/{chunk-R54GSKJS.js → chunk-WSDG4ZRI.js} +30 -16
- package/dist/chunk-WSDG4ZRI.js.map +1 -0
- package/dist/{chunk-3PWARKZX.js → chunk-X54QP332.js} +8 -8
- package/dist/chunk-X54QP332.js.map +1 -0
- package/dist/components/cart/index.js +1 -1
- package/dist/components/common/index.js +1 -1
- package/dist/components/drawer/index.js +9 -7
- package/dist/components/home/HomePageRenderer.d.ts +6 -0
- package/dist/components/home/HomePageRenderer.d.ts.map +1 -1
- package/dist/components/home/index.js +11 -9
- package/dist/components/layout/PageAdvertisements.d.ts +7 -0
- package/dist/components/layout/PageAdvertisements.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/layout/index.js +8 -1
- package/dist/components/product/index.js +10 -8
- package/dist/components/store/index.js +11 -9
- package/dist/components/store/index.js.map +1 -1
- package/dist/{document-class-SD6BUMZN.js → document-class-7AXAAWGZ.js} +6 -5
- package/dist/{document-class-SD6BUMZN.js.map → document-class-7AXAAWGZ.js.map} +1 -1
- package/dist/hooks/index.js +9 -7
- package/dist/hooks/useGtm.js +9 -7
- package/dist/hooks/useMoney.js +9 -7
- package/dist/hooks/useStore.js +9 -7
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/{not-found-TUU7WQLL.js → not-found-3EEMQZMU.js} +11 -9
- package/dist/not-found-3EEMQZMU.js.map +1 -0
- package/dist/providers/index.js +9 -7
- package/dist/routes/account/orders.js +1 -1
- package/dist/routes/account.js +6 -6
- package/dist/routes/blog.js +5 -5
- package/dist/routes/brands.js +1 -1
- package/dist/routes/cart.js +13 -11
- package/dist/routes/cart.js.map +1 -1
- package/dist/routes/home.js +12 -10
- package/dist/routes/loyalty.js +2 -2
- package/dist/routes/page.js +1 -1
- package/dist/routes/product-listing.js +11 -9
- package/dist/routes/product-listing.js.map +1 -1
- package/dist/routes/product.js +11 -9
- package/dist/routes/product.js.map +1 -1
- package/dist/routes/root/beforeLoad.d.ts +2 -2
- package/dist/routes/root/beforeLoad.d.ts.map +1 -1
- package/dist/routes/root/head.d.ts.map +1 -1
- package/dist/routes/testimonials.js +2 -2
- package/dist/routes/thank-you.js +1 -1
- package/dist/skeleton.js +12 -10
- package/dist/tanstack/document-class.d.ts.map +1 -1
- package/dist/tanstack/index.d.ts +1 -0
- package/dist/tanstack/index.d.ts.map +1 -1
- package/dist/tanstack/stylesheet.d.ts +15 -0
- package/dist/tanstack/stylesheet.d.ts.map +1 -0
- package/dist/tanstack.js +34 -5
- package/dist/tanstack.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +12 -3
- package/tailwind/components/Component.tsx.txt +21 -0
- package/tailwind/components/ComponentRegistry.ts.txt +66 -0
- package/tailwind/components/cart/CartItem.tsx.txt +211 -0
- package/tailwind/components/cart/CartSummary.tsx.txt +269 -0
- package/tailwind/components/cart/PreOrderNotification.tsx.txt +16 -0
- package/tailwind/components/cart/PriceQuoteButton.tsx.txt +21 -0
- package/tailwind/components/cart/SeoCartWidget.tsx.txt +99 -0
- package/tailwind/components/cart/index.ts.txt +11 -0
- package/tailwind/components/cart/lazy.ts.txt +15 -0
- package/tailwind/components/collapse/Collapse.tsx.txt +95 -0
- package/tailwind/components/collapse/index.ts.txt +41 -0
- package/tailwind/components/common/Breadcrumb.tsx.txt +27 -0
- package/tailwind/components/common/BreadcrumbJsonLd.tsx.txt +40 -0
- package/tailwind/components/common/BreadcrumbTrail.tsx.txt +97 -0
- package/tailwind/components/common/CurrencySymbol.tsx.txt +8 -0
- package/tailwind/components/common/DeferredData.tsx.txt +122 -0
- package/tailwind/components/common/ErrorPage.tsx.txt +69 -0
- package/tailwind/components/common/Image.tsx.txt +119 -0
- package/tailwind/components/common/Link.tsx.txt +36 -0
- package/tailwind/components/common/Link.types.ts.txt +85 -0
- package/tailwind/components/common/NoContent.tsx.txt +27 -0
- package/tailwind/components/common/RenderWhenVisible.tsx.txt +92 -0
- package/tailwind/components/common/index.ts.txt +42 -0
- package/tailwind/components/common/lazy.ts.txt +28 -0
- package/tailwind/components/defineComponent.ts.txt +32 -0
- package/tailwind/components/drawer/Drawer.tsx.txt +219 -0
- package/tailwind/components/drawer/index.ts.txt +38 -0
- package/tailwind/components/dropdown/Dropdown.tsx.txt +166 -0
- package/tailwind/components/dropdown/index.ts.txt +40 -0
- package/tailwind/components/home/BundleComponent.tsx.txt +35 -0
- package/tailwind/components/home/ComponentErrorBoundary.tsx.txt +98 -0
- package/tailwind/components/home/FeaturedProductsStyle1.tsx.txt +125 -0
- package/tailwind/components/home/FeaturedProductsStyle2.tsx.txt +127 -0
- package/tailwind/components/home/FeaturedProductsStyle3.tsx.txt +71 -0
- package/tailwind/components/home/FixedBanner.tsx.txt +68 -0
- package/tailwind/components/home/FixedProducts.tsx.txt +72 -0
- package/tailwind/components/home/HomePageRenderer.tsx.txt +284 -0
- package/tailwind/components/home/PageBlocks.tsx.txt +24 -0
- package/tailwind/components/home/ParallaxBackground.tsx.txt +50 -0
- package/tailwind/components/home/PhotosSlider.tsx.txt +61 -0
- package/tailwind/components/home/ProductsSlider.tsx.txt +87 -0
- package/tailwind/components/home/ReorderProducts.tsx.txt +38 -0
- package/tailwind/components/home/SquarePhotos.tsx.txt +68 -0
- package/tailwind/components/home/StoreFeatures.tsx.txt +34 -0
- package/tailwind/components/home/Testimonials.tsx.txt +36 -0
- package/tailwind/components/home/Youtube.tsx.txt +48 -0
- package/tailwind/components/home/index.ts.txt +50 -0
- package/tailwind/components/home/lazy.ts.txt +17 -0
- package/tailwind/components/home/register.ts.txt +44 -0
- package/tailwind/components/home/reorder-hooks.ts.txt +52 -0
- package/tailwind/components/home/types.ts.txt +4 -0
- package/tailwind/components/layout/Copyright.tsx.txt +23 -0
- package/tailwind/components/layout/CustomerLayout.tsx.txt +91 -0
- package/tailwind/components/layout/Footer.tsx.txt +343 -0
- package/tailwind/components/layout/Header.tsx.txt +154 -0
- package/tailwind/components/layout/MasterLayout.tsx.txt +63 -0
- package/tailwind/components/layout/PageAdvertisements.tsx.txt +131 -0
- package/tailwind/components/layout/WidgetHead.tsx.txt +53 -0
- package/tailwind/components/layout/index.ts.txt +27 -0
- package/tailwind/components/layout/lazy.ts.txt +25 -0
- package/tailwind/components/layout/types.ts.txt +11 -0
- package/tailwind/components/modal/ImageModal.tsx.txt +70 -0
- package/tailwind/components/modal/Modal.tsx.txt +245 -0
- package/tailwind/components/modal/index.ts.txt +39 -0
- package/tailwind/components/modal/lazy.ts.txt +10 -0
- package/tailwind/components/navigation/MainMenu.tsx.txt +94 -0
- package/tailwind/components/navigation/MobileMenu.tsx.txt +160 -0
- package/tailwind/components/navigation/index.ts.txt +4 -0
- package/tailwind/components/navigation/lazy.ts.txt +11 -0
- package/tailwind/components/product/AddToCartForm.tsx.txt +365 -0
- package/tailwind/components/product/ProductCard.tsx.txt +305 -0
- package/tailwind/components/product/ProductDetails.tsx.txt +267 -0
- package/tailwind/components/product/ProductGallery.tsx.txt +234 -0
- package/tailwind/components/product/index.ts.txt +15 -0
- package/tailwind/components/product/lazy.ts.txt +9 -0
- package/tailwind/components/snippets/AppsSnippets.tsx.txt +225 -0
- package/tailwind/components/snippets/SallaSdkScripts.tsx.txt +14 -0
- package/tailwind/components/snippets/index.ts.txt +4 -0
- package/tailwind/components/store/StoreClosedNotification.tsx.txt +73 -0
- package/tailwind/components/store/index.ts.txt +8 -0
- package/tailwind/components/store/lazy.ts.txt +8 -0
- package/tailwind/components/toast/Toaster.tsx.txt +177 -0
- package/tailwind/components/toast/index.ts.txt +10 -0
- package/tailwind/components/toast/types.ts.txt +38 -0
- package/tailwind/components/toast/useToast.ts.txt +61 -0
- package/tailwind/components/tracking/GoogleTag.tsx.txt +77 -0
- package/tailwind/components/tracking/SiftSnippet.tsx.txt +49 -0
- package/tailwind/components/tracking/TwilightBundles.tsx.txt +67 -0
- package/tailwind/components/tracking/index.ts.txt +11 -0
- package/tailwind/components/tracking/lazy.ts.txt +11 -0
- package/tailwind/components/useComponent.ts.txt +12 -0
- package/tailwind/routes/account/index.tsx.txt +16 -0
- package/tailwind/routes/account/notifications/NotificationsPage.tsx.txt +54 -0
- package/tailwind/routes/account/notifications/index.tsx.txt +39 -0
- package/tailwind/routes/account/notifications/loader.ts.txt +22 -0
- package/tailwind/routes/account/notifications/types.ts.txt +18 -0
- package/tailwind/routes/account/orders/OrderSinglePage.tsx.txt +181 -0
- package/tailwind/routes/account/orders/OrdersPage.tsx.txt +28 -0
- package/tailwind/routes/account/orders/index.tsx.txt +86 -0
- package/tailwind/routes/account/orders/loader.ts.txt +66 -0
- package/tailwind/routes/account/orders/single/OrderActions.tsx.txt +197 -0
- package/tailwind/routes/account/orders/single/OrderHeader.tsx.txt +143 -0
- package/tailwind/routes/account/orders/single/OrderItemRow.tsx.txt +209 -0
- package/tailwind/routes/account/orders/single/OrderSections.tsx.txt +215 -0
- package/tailwind/routes/account/orders/single/types.ts.txt +38 -0
- package/tailwind/routes/account/orders/types.ts.txt +29 -0
- package/tailwind/routes/account/profile/ProfilePage.tsx.txt +30 -0
- package/tailwind/routes/account/profile/index.tsx.txt +39 -0
- package/tailwind/routes/account/profile/loader.ts.txt +16 -0
- package/tailwind/routes/account/profile/types.ts.txt +5 -0
- package/tailwind/routes/account/settings/SettingsPage.tsx.txt +13 -0
- package/tailwind/routes/account/settings/index.tsx.txt +39 -0
- package/tailwind/routes/account/settings/loader.ts.txt +13 -0
- package/tailwind/routes/account/settings/types.ts.txt +5 -0
- package/tailwind/routes/account/types.ts.txt +320 -0
- package/tailwind/routes/account/wallet/WalletPage.tsx.txt +195 -0
- package/tailwind/routes/account/wallet/index.tsx.txt +38 -0
- package/tailwind/routes/account/wallet/loader.ts.txt +27 -0
- package/tailwind/routes/account/wallet/types.ts.txt +11 -0
- package/tailwind/routes/account/wishlist/WishlistPage.tsx.txt +314 -0
- package/tailwind/routes/account/wishlist/WishlistShare.tsx.txt +248 -0
- package/tailwind/routes/account/wishlist/index.tsx.txt +40 -0
- package/tailwind/routes/account/wishlist/loader.ts.txt +26 -0
- package/tailwind/routes/account/wishlist/types.ts.txt +9 -0
- package/tailwind/routes/blog/BlogAuthorPage.tsx.txt +82 -0
- package/tailwind/routes/blog/BlogCategoryPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogPage.tsx.txt +191 -0
- package/tailwind/routes/blog/BlogSinglePage.tsx.txt +168 -0
- package/tailwind/routes/blog/BlogTagPage.tsx.txt +84 -0
- package/tailwind/routes/blog/BlogTags.tsx.txt +54 -0
- package/tailwind/routes/blog/components.tsx.txt +87 -0
- package/tailwind/routes/blog/index.tsx.txt +238 -0
- package/tailwind/routes/blog/loader.ts.txt +173 -0
- package/tailwind/routes/blog/types.ts.txt +106 -0
- package/tailwind/routes/brands/BrandsPage.tsx.txt +179 -0
- package/tailwind/routes/brands/index.tsx.txt +47 -0
- package/tailwind/routes/brands/loader.ts.txt +14 -0
- package/tailwind/routes/brands/types.ts.txt +53 -0
- package/tailwind/routes/cart/CartPage.tsx.txt +112 -0
- package/tailwind/routes/cart/index.tsx.txt +39 -0
- package/tailwind/routes/cart/loader.ts.txt +15 -0
- package/tailwind/routes/cart/types.ts.txt +6 -0
- package/tailwind/routes/home/HomePage.tsx.txt +53 -0
- package/tailwind/routes/home/index.tsx.txt +56 -0
- package/tailwind/routes/home/loader.ts.txt +24 -0
- package/tailwind/routes/home/types.ts.txt +11 -0
- package/tailwind/routes/index.ts.txt +94 -0
- package/tailwind/routes/lazy.ts.txt +105 -0
- package/tailwind/routes/loyalty/LoyaltyPage.tsx.txt +17 -0
- package/tailwind/routes/loyalty/LoyaltyPointsPage.tsx.txt +11 -0
- package/tailwind/routes/loyalty/index.tsx.txt +81 -0
- package/tailwind/routes/loyalty/loader.ts.txt +53 -0
- package/tailwind/routes/loyalty/types.ts.txt +109 -0
- package/tailwind/routes/not-found.tsx.txt +50 -0
- package/tailwind/routes/page/PageSingle.tsx.txt +34 -0
- package/tailwind/routes/page/index.tsx.txt +60 -0
- package/tailwind/routes/page/loader.ts.txt +19 -0
- package/tailwind/routes/page/types.ts.txt +34 -0
- package/tailwind/routes/product/ProductPage.tsx.txt +77 -0
- package/tailwind/routes/product/index.tsx.txt +157 -0
- package/tailwind/routes/product/loader.ts.txt +35 -0
- package/tailwind/routes/product/types.ts.txt +6 -0
- package/tailwind/routes/product-listing/ProductListPage.tsx.txt +321 -0
- package/tailwind/routes/product-listing/index.tsx.txt +95 -0
- package/tailwind/routes/product-listing/loader.ts.txt +323 -0
- package/tailwind/routes/product-listing/types.ts.txt +96 -0
- package/tailwind/routes/product-listing/useAppliedFilters.ts.txt +130 -0
- package/tailwind/routes/product-short-link.ts.txt +104 -0
- package/tailwind/routes/root/beforeLoad.ts.txt +354 -0
- package/tailwind/routes/root/head.ts.txt +424 -0
- package/tailwind/routes/root/index.ts.txt +2 -0
- package/tailwind/routes/seo-redirects.ts.txt +82 -0
- package/tailwind/routes/testimonials/ReviewsPage.tsx.txt +12 -0
- package/tailwind/routes/testimonials/TestimonialsPage.tsx.txt +80 -0
- package/tailwind/routes/testimonials/index.tsx.txt +80 -0
- package/tailwind/routes/testimonials/loader.ts.txt +29 -0
- package/tailwind/routes/testimonials/types.ts.txt +9 -0
- package/tailwind/routes/thank-you/ThankYouPage.tsx.txt +241 -0
- package/tailwind/routes/thank-you/index.tsx.txt +49 -0
- package/tailwind/routes/thank-you/loader.ts.txt +40 -0
- package/tailwind/routes/thank-you/types.ts.txt +16 -0
- package/tailwind/routes/types.ts.txt +41 -0
- package/dist/BlogAuthorPage-LFAUMKC7.js.map +0 -1
- package/dist/BlogCategoryPage-NWYFFPCD.js.map +0 -1
- package/dist/BlogPage-BOHXFV7E.js.map +0 -1
- package/dist/BlogSinglePage-FYEXQPMB.js.map +0 -1
- package/dist/BlogTagPage-DAM3RNVA.js.map +0 -1
- package/dist/BrandsPage-GAKQCE6O.js.map +0 -1
- package/dist/Breadcrumb-NAYSZNRV.js.map +0 -1
- package/dist/CartItem-ZRVLIZT3.js.map +0 -1
- package/dist/CartSummary-U2TVLG35.js.map +0 -1
- package/dist/CustomerLayout-WSKXWI7D.js.map +0 -1
- package/dist/LoyaltyPage-IG5KSYNO.js.map +0 -1
- package/dist/LoyaltyPointsPage-RKO56ZER.js.map +0 -1
- package/dist/MobileMenu-E4X2GOZ3.js.map +0 -1
- package/dist/NotificationsPage-BJ5XVWEG.js.map +0 -1
- package/dist/OrderSinglePage-544E36FJ.js.map +0 -1
- package/dist/OrdersPage-AFBWVTZU.js.map +0 -1
- package/dist/ProductDetails-SDZHALU6.js.map +0 -1
- package/dist/ProfilePage-V5KV6GQK.js.map +0 -1
- package/dist/SeoCartWidget-JAV6M3X5.js.map +0 -1
- package/dist/SettingsPage-43SUCLQR.js.map +0 -1
- package/dist/ThankYouPage-52SSZ7FV.js.map +0 -1
- package/dist/WalletPage-4AN4UJ52.js.map +0 -1
- package/dist/WishlistPage-L6IYJUJZ.js.map +0 -1
- package/dist/chunk-3PWARKZX.js.map +0 -1
- package/dist/chunk-4EA56R6I.js +0 -14
- package/dist/chunk-R54GSKJS.js.map +0 -1
- package/dist/chunk-UNEZZMQA.js.map +0 -1
- package/dist/not-found-TUU7WQLL.js.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HeadDescriptor } from '../../../utils/head';
|
|
2
|
+
import { buildHreflangAlternates } from '../../../utils/baseHead';
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
import { profileLoader } from './loader';
|
|
5
|
+
import type { ProfilePageProps } from './types';
|
|
6
|
+
import type { TwilightContext } from '../../../twilight/context';
|
|
7
|
+
import { RouteId } from '../../../router/route-ids';
|
|
8
|
+
|
|
9
|
+
const LazyProfilePage = lazy(() =>
|
|
10
|
+
import('./ProfilePage').then((m) => ({ default: m.ProfilePage }))
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const ProfilePage = LazyProfilePage;
|
|
14
|
+
export { profileLoader } from './loader';
|
|
15
|
+
export type { ProfilePageProps } from './types';
|
|
16
|
+
|
|
17
|
+
export const Profile = {
|
|
18
|
+
id: RouteId.CUSTOMER_PROFILE,
|
|
19
|
+
loader: async (
|
|
20
|
+
_ctx: { locale?: string },
|
|
21
|
+
extend?: (
|
|
22
|
+
data: ProfilePageProps,
|
|
23
|
+
ctx: { params: Record<string, never> }
|
|
24
|
+
) => Promise<Record<string, unknown>> | Record<string, unknown>
|
|
25
|
+
): Promise<ProfilePageProps> => {
|
|
26
|
+
const data = await profileLoader({ locale: _ctx.locale ?? 'ar' });
|
|
27
|
+
if (extend) {
|
|
28
|
+
const extra = await extend(data, { params: {} });
|
|
29
|
+
return { ...data, ...extra } as ProfilePageProps;
|
|
30
|
+
}
|
|
31
|
+
return data;
|
|
32
|
+
},
|
|
33
|
+
head: (ctx: TwilightContext, data: ProfilePageProps): HeadDescriptor => ({
|
|
34
|
+
title: data.page.title,
|
|
35
|
+
description: data.page.description,
|
|
36
|
+
alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),
|
|
37
|
+
}),
|
|
38
|
+
Component: LazyProfilePage,
|
|
39
|
+
} as const;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ProfilePageProps } from './types';
|
|
2
|
+
import { getTwilightContext } from '../../../twilight/context';
|
|
3
|
+
import { unauthorized } from '../../../providers/NavigationProvider';
|
|
4
|
+
import { getAuthToken } from '../../../api/client';
|
|
5
|
+
import { RouteId } from '../../../router/route-ids';
|
|
6
|
+
|
|
7
|
+
export async function profileLoader(_ctx: { locale: string }): Promise<ProfilePageProps> {
|
|
8
|
+
if (!getAuthToken()) throw unauthorized();
|
|
9
|
+
const { i18n } = getTwilightContext();
|
|
10
|
+
return {
|
|
11
|
+
page: {
|
|
12
|
+
title: i18n.t('common.titles.profile') || 'Profile',
|
|
13
|
+
slug: RouteId.CUSTOMER_PROFILE,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SallaUserSettings } from '@salla.sa/twilight-components-react/user-settings';
|
|
2
|
+
import { HookSlot } from '../../../hooks';
|
|
3
|
+
import type { SettingsPageProps } from './types';
|
|
4
|
+
|
|
5
|
+
export function SettingsPage(_props: SettingsPageProps) {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<HookSlot name="customer:settings.start" />
|
|
9
|
+
<SallaUserSettings />
|
|
10
|
+
<HookSlot name="customer:settings.end" />
|
|
11
|
+
</>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HeadDescriptor } from '../../../utils/head';
|
|
2
|
+
import { buildHreflangAlternates } from '../../../utils/baseHead';
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
import { settingsLoader } from './loader';
|
|
5
|
+
import type { SettingsPageProps } from './types';
|
|
6
|
+
import type { TwilightContext } from '../../../twilight/context';
|
|
7
|
+
import { RouteId } from '../../../router/route-ids';
|
|
8
|
+
|
|
9
|
+
const LazySettingsPage = lazy(() =>
|
|
10
|
+
import('./SettingsPage').then((m) => ({ default: m.SettingsPage }))
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const SettingsPage = LazySettingsPage;
|
|
14
|
+
export { settingsLoader } from './loader';
|
|
15
|
+
export type { SettingsPageProps } from './types';
|
|
16
|
+
|
|
17
|
+
export const Settings = {
|
|
18
|
+
id: RouteId.CUSTOMER_SETTINGS,
|
|
19
|
+
loader: async (
|
|
20
|
+
_ctx: { locale?: string },
|
|
21
|
+
extend?: (
|
|
22
|
+
data: SettingsPageProps,
|
|
23
|
+
ctx: { params: Record<string, never> }
|
|
24
|
+
) => Promise<Record<string, unknown>> | Record<string, unknown>
|
|
25
|
+
): Promise<SettingsPageProps> => {
|
|
26
|
+
const data = await settingsLoader({ locale: _ctx.locale ?? 'ar' });
|
|
27
|
+
if (extend) {
|
|
28
|
+
const extra = await extend(data, { params: {} });
|
|
29
|
+
return { ...data, ...extra } as SettingsPageProps;
|
|
30
|
+
}
|
|
31
|
+
return data;
|
|
32
|
+
},
|
|
33
|
+
head: (ctx: TwilightContext, data: SettingsPageProps): HeadDescriptor => ({
|
|
34
|
+
title: data.page.title,
|
|
35
|
+
description: data.page.description,
|
|
36
|
+
alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),
|
|
37
|
+
}),
|
|
38
|
+
Component: LazySettingsPage,
|
|
39
|
+
} as const;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SettingsPageProps } from './types';
|
|
2
|
+
import { getTwilightContext } from '../../../twilight/context';
|
|
3
|
+
import { unauthorized } from '../../../providers/NavigationProvider';
|
|
4
|
+
import { getAuthToken } from '../../../api/client';
|
|
5
|
+
|
|
6
|
+
export async function settingsLoader(_ctx: { locale: string }): Promise<SettingsPageProps> {
|
|
7
|
+
if (!getAuthToken()) throw unauthorized();
|
|
8
|
+
const { i18n } = getTwilightContext();
|
|
9
|
+
return {
|
|
10
|
+
// Twig's slug for this page; the advertisements API does not filter it, as on Twig.
|
|
11
|
+
page: { title: i18n.t('common.titles.settings') || 'Settings', slug: 'customer-settings' },
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import type { Money } from '../../types';
|
|
2
|
+
|
|
3
|
+
export interface OrderStatus {
|
|
4
|
+
id?: number;
|
|
5
|
+
name: string;
|
|
6
|
+
slug?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
hex_icon?: number | null;
|
|
10
|
+
sort_order?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface OrderDate {
|
|
14
|
+
date: string;
|
|
15
|
+
timezone_type: number;
|
|
16
|
+
timezone: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface OrderUrls {
|
|
20
|
+
customer: string;
|
|
21
|
+
admin?: string;
|
|
22
|
+
rating?: string | null;
|
|
23
|
+
checkout?: string | null;
|
|
24
|
+
receipt?: string;
|
|
25
|
+
print?: string;
|
|
26
|
+
tracking?: string[];
|
|
27
|
+
digital_content?: string | null;
|
|
28
|
+
invoice?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface OrderRecipient {
|
|
32
|
+
name: string;
|
|
33
|
+
mobile: string;
|
|
34
|
+
address: string;
|
|
35
|
+
city?: string;
|
|
36
|
+
country?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface OrderShipping {
|
|
40
|
+
id: number;
|
|
41
|
+
name: string;
|
|
42
|
+
number?: string;
|
|
43
|
+
logo?: string;
|
|
44
|
+
cost?: Money;
|
|
45
|
+
tracing_link?: string;
|
|
46
|
+
recipient?: OrderRecipient;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface OrderCustomer {
|
|
50
|
+
id: number;
|
|
51
|
+
first_name?: string;
|
|
52
|
+
last_name?: string;
|
|
53
|
+
name?: string;
|
|
54
|
+
mobile?: string | number;
|
|
55
|
+
mobile_code?: string;
|
|
56
|
+
email?: string;
|
|
57
|
+
urls?: {
|
|
58
|
+
customer?: string;
|
|
59
|
+
admin?: string;
|
|
60
|
+
digital_content?: string | null;
|
|
61
|
+
};
|
|
62
|
+
avatar?: string;
|
|
63
|
+
gender?: string;
|
|
64
|
+
birthday?: string | null;
|
|
65
|
+
country?: string;
|
|
66
|
+
country_code?: string;
|
|
67
|
+
city?: string;
|
|
68
|
+
currency?: string;
|
|
69
|
+
location?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface OrderTax {
|
|
73
|
+
percent: string;
|
|
74
|
+
amount: Money;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface OrderDiscount {
|
|
78
|
+
title: string;
|
|
79
|
+
type?: string;
|
|
80
|
+
code?: string;
|
|
81
|
+
discount: string;
|
|
82
|
+
currency?: string;
|
|
83
|
+
discounted_shipping?: string;
|
|
84
|
+
hasMarketing?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface Moneys {
|
|
88
|
+
sub_total: Money;
|
|
89
|
+
shipping_cost?: Money;
|
|
90
|
+
cash_on_delivery?: Money;
|
|
91
|
+
tax?: OrderTax;
|
|
92
|
+
discounts?: OrderDiscount[];
|
|
93
|
+
total: Money;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface OrderItemOption {
|
|
97
|
+
name: string;
|
|
98
|
+
value: string;
|
|
99
|
+
is_image?: boolean;
|
|
100
|
+
color?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface OrderItemAttachment {
|
|
104
|
+
type: 'image' | 'file';
|
|
105
|
+
url: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface OrderItemRating {
|
|
109
|
+
id: number;
|
|
110
|
+
content: string;
|
|
111
|
+
is_pending: boolean;
|
|
112
|
+
stars: number;
|
|
113
|
+
images?: string[];
|
|
114
|
+
created_at?: string;
|
|
115
|
+
can_update?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface OrderItemAmounts {
|
|
119
|
+
cost?: Money;
|
|
120
|
+
amount?: Money;
|
|
121
|
+
discount?: Money;
|
|
122
|
+
original_price?: Money;
|
|
123
|
+
price_without_tax?: Money;
|
|
124
|
+
total_discount?: Money;
|
|
125
|
+
tax?: { percent: string; amount: Money };
|
|
126
|
+
total: Money;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface OrderItem {
|
|
130
|
+
id: number;
|
|
131
|
+
type?: string;
|
|
132
|
+
name: string;
|
|
133
|
+
sku?: string;
|
|
134
|
+
image?: string;
|
|
135
|
+
thumbnail?: string;
|
|
136
|
+
product_thumbnail?: string;
|
|
137
|
+
quantity: number;
|
|
138
|
+
amounts: OrderItemAmounts;
|
|
139
|
+
exchange_rate?: OrderExchangeRate;
|
|
140
|
+
references?: { mpn?: string | null; gtin?: string | null; hscode?: string | null };
|
|
141
|
+
product?: {
|
|
142
|
+
id: number;
|
|
143
|
+
url: string;
|
|
144
|
+
type?: string;
|
|
145
|
+
};
|
|
146
|
+
note?: string;
|
|
147
|
+
notes?: string;
|
|
148
|
+
options?: OrderItemOption[];
|
|
149
|
+
attachments?: OrderItemAttachment[];
|
|
150
|
+
rating?: OrderItemRating;
|
|
151
|
+
availability_date?: string;
|
|
152
|
+
booking_location?: string;
|
|
153
|
+
product_reservations?: Record<string, string | number | boolean>[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface OrderPackage {
|
|
157
|
+
shipping_company?: OrderShipping & { tracing_link?: string };
|
|
158
|
+
branch?: { name: string };
|
|
159
|
+
status?: OrderStatus;
|
|
160
|
+
is_delivered?: boolean;
|
|
161
|
+
items: OrderItem[];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface ShipmentPackage {
|
|
165
|
+
item_id: number;
|
|
166
|
+
name: string;
|
|
167
|
+
sku?: string;
|
|
168
|
+
price?: Money;
|
|
169
|
+
quantity: number;
|
|
170
|
+
weight?: { value: number; units: string };
|
|
171
|
+
options?: OrderItemOption[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface ShippingAddress {
|
|
175
|
+
name?: string;
|
|
176
|
+
mobile?: string;
|
|
177
|
+
address?: string;
|
|
178
|
+
city?: string;
|
|
179
|
+
country?: string;
|
|
180
|
+
branch_id?: number;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface OrderShipment {
|
|
184
|
+
id: number;
|
|
185
|
+
type: string;
|
|
186
|
+
courier_id?: number;
|
|
187
|
+
courier_name?: string;
|
|
188
|
+
courier_logo?: string;
|
|
189
|
+
shipping_number?: string;
|
|
190
|
+
tracking_number?: string;
|
|
191
|
+
tracking_link?: string;
|
|
192
|
+
status?: string;
|
|
193
|
+
packages?: ShipmentPackage[];
|
|
194
|
+
ship_from?: ShippingAddress;
|
|
195
|
+
ship_to?: ShippingAddress;
|
|
196
|
+
amounts?: Moneys;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface OrderShipmentItem {
|
|
200
|
+
id: number;
|
|
201
|
+
number: string;
|
|
202
|
+
name: string;
|
|
203
|
+
logo: string;
|
|
204
|
+
website: string;
|
|
205
|
+
tracking_url?: string;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface OrderRatingItem {
|
|
209
|
+
id: number;
|
|
210
|
+
rating: number;
|
|
211
|
+
content: string;
|
|
212
|
+
status: 'approved' | 'pending' | 'rejected';
|
|
213
|
+
type: 'rating' | 'shipping' | 'testimonial';
|
|
214
|
+
images: string[] | null;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface OrderRating {
|
|
218
|
+
store?: OrderItemRating;
|
|
219
|
+
shipping?: OrderItemRating;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface OrderWeight {
|
|
223
|
+
unit: string;
|
|
224
|
+
value: number;
|
|
225
|
+
label?: string;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface OrderExchangeRate {
|
|
229
|
+
base_currency: string;
|
|
230
|
+
exchange_currency: string;
|
|
231
|
+
rate: string;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface OrderFeatures {
|
|
235
|
+
shippable: boolean;
|
|
236
|
+
digitalable: boolean;
|
|
237
|
+
multiple_shipments_supported: boolean;
|
|
238
|
+
show_weight: boolean;
|
|
239
|
+
is_read: boolean;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface OrderActions {
|
|
243
|
+
cancellable: boolean;
|
|
244
|
+
reorderable: boolean;
|
|
245
|
+
payable: boolean;
|
|
246
|
+
rateable: boolean;
|
|
247
|
+
invoice_printable?: boolean;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface OrderReferences {
|
|
251
|
+
checkout: string | null;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface OrderListItem {
|
|
255
|
+
id: number;
|
|
256
|
+
reference_id: number;
|
|
257
|
+
references: OrderReferences;
|
|
258
|
+
type: string;
|
|
259
|
+
features: OrderFeatures;
|
|
260
|
+
actions: OrderActions;
|
|
261
|
+
amounts: Moneys;
|
|
262
|
+
exchange_rate: OrderExchangeRate;
|
|
263
|
+
currency: string;
|
|
264
|
+
status: OrderStatus;
|
|
265
|
+
weight: OrderWeight | null;
|
|
266
|
+
created_at: OrderDate;
|
|
267
|
+
/** Present when the list is fetched with `with_items`. */
|
|
268
|
+
items?: OrderItem[];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface OrderSource {
|
|
272
|
+
type: string;
|
|
273
|
+
value: string | null;
|
|
274
|
+
device: string;
|
|
275
|
+
'user-agent': string;
|
|
276
|
+
utm_source: string;
|
|
277
|
+
utm_campaign: string;
|
|
278
|
+
utm_medium: string;
|
|
279
|
+
utm_term: string;
|
|
280
|
+
utm_content: string;
|
|
281
|
+
ip: string | null;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export interface OrderPayment {
|
|
285
|
+
status?: string | null;
|
|
286
|
+
method?: string;
|
|
287
|
+
reference_id?: string | null;
|
|
288
|
+
accepted_methods?: string[];
|
|
289
|
+
pending_payment_ends_at?: number;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface Order {
|
|
293
|
+
id: number;
|
|
294
|
+
reference_id: number;
|
|
295
|
+
references: OrderReferences;
|
|
296
|
+
type: string;
|
|
297
|
+
features: OrderFeatures;
|
|
298
|
+
actions: OrderActions;
|
|
299
|
+
customer: OrderCustomer;
|
|
300
|
+
receiver?: OrderRecipient;
|
|
301
|
+
amounts: Moneys;
|
|
302
|
+
exchange_rate: OrderExchangeRate;
|
|
303
|
+
currency: string;
|
|
304
|
+
urls: OrderUrls;
|
|
305
|
+
status: OrderStatus;
|
|
306
|
+
weight: OrderWeight | null;
|
|
307
|
+
tags: string[];
|
|
308
|
+
payment: OrderPayment;
|
|
309
|
+
source: OrderSource;
|
|
310
|
+
created_at: OrderDate;
|
|
311
|
+
items: OrderItem[];
|
|
312
|
+
shipping?: OrderShipping;
|
|
313
|
+
shipments?: OrderShipmentItem[];
|
|
314
|
+
ratings?: OrderRatingItem[];
|
|
315
|
+
refund_message?: string;
|
|
316
|
+
email_sent?: boolean;
|
|
317
|
+
instructions?: string;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export type { OrderSinglePageProps, OrdersPageProps } from './orders/types';
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { memo, useCallback, useRef } from 'react';
|
|
2
|
+
import { ItemsList } from '@salla.sa/twilight-components-react';
|
|
3
|
+
import { wallet } from '../../../api/wallet';
|
|
4
|
+
import type { TransactionItem } from '../../../api/wallet';
|
|
5
|
+
import { HookSlot, useMoney } from '../../../hooks';
|
|
6
|
+
import { useTranslation } from '../../../providers/I18nProvider';
|
|
7
|
+
import type { WalletPageProps } from './types';
|
|
8
|
+
import { NoContent } from '../../../components/common';
|
|
9
|
+
|
|
10
|
+
const TransactionRow = memo(function TransactionRow({
|
|
11
|
+
transaction,
|
|
12
|
+
}: {
|
|
13
|
+
transaction: TransactionItem;
|
|
14
|
+
}) {
|
|
15
|
+
const { t, locale } = useTranslation();
|
|
16
|
+
const { format: formatMoney } = useMoney();
|
|
17
|
+
|
|
18
|
+
const formatTimestamp = (ts: number) => {
|
|
19
|
+
if (!ts) return '';
|
|
20
|
+
return new Date(ts * 1000).toLocaleDateString(locale, {
|
|
21
|
+
weekday: 'long',
|
|
22
|
+
year: 'numeric',
|
|
23
|
+
month: 'long',
|
|
24
|
+
day: 'numeric',
|
|
25
|
+
hour: 'numeric',
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const actionTypeClass =
|
|
30
|
+
transaction.action_type === 'cashback'
|
|
31
|
+
? 's-wallet-table-transaction-status-cashback'
|
|
32
|
+
: transaction.action_type === 'refund'
|
|
33
|
+
? 's-wallet-table-transaction-status-refund'
|
|
34
|
+
: transaction.action_type === 'purchase_by_wallet'
|
|
35
|
+
? 's-wallet-table-transaction-status-purchase'
|
|
36
|
+
: '';
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<tr className="s-wallet-table-tbody-tr s-wallet-table-tbody-tr-shadow animated">
|
|
40
|
+
<td className="s-wallet-table-tbody-tr-td">
|
|
41
|
+
<div className="s-wallet-table-tbody-tr-td-content">
|
|
42
|
+
<span className="s-wallet-mobile-title">{t('pages.wallet.transaction_number')}:</span>
|
|
43
|
+
{transaction.id && <span className="hidden md:inline-block">#{transaction.id}</span>}
|
|
44
|
+
<div className="flex items-center md:hidden">
|
|
45
|
+
{transaction.id && <span>#{transaction.id}</span>}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</td>
|
|
49
|
+
|
|
50
|
+
<td className="s-wallet-table-tbody-tr-td">
|
|
51
|
+
<div className="s-wallet-table-tbody-tr-td-content">
|
|
52
|
+
<span className="s-wallet-mobile-title">{t('pages.wallet.amount')}:</span>
|
|
53
|
+
<div>{formatMoney(transaction.amount, { type: 'general' })}</div>
|
|
54
|
+
</div>
|
|
55
|
+
</td>
|
|
56
|
+
|
|
57
|
+
<td className="s-wallet-table-tbody-tr-td">
|
|
58
|
+
<div className="s-wallet-table-tbody-tr-td-content">
|
|
59
|
+
<span className="s-wallet-mobile-title">{t('pages.wallet.date')}:</span>
|
|
60
|
+
{transaction.created_at ? formatTimestamp(transaction.created_at) : ''}
|
|
61
|
+
</div>
|
|
62
|
+
</td>
|
|
63
|
+
|
|
64
|
+
<td className="s-wallet-table-tbody-tr-td">
|
|
65
|
+
<div className="s-wallet-table-tbody-tr-td-content">
|
|
66
|
+
<span className="s-wallet-mobile-title">{t('pages.wallet.order_no')}:</span>
|
|
67
|
+
<span className="rtl:mr-auto ltr:ml-auto md:mx-0">
|
|
68
|
+
{transaction.order_id && <span>#{transaction.order_id}</span>}
|
|
69
|
+
</span>
|
|
70
|
+
</div>
|
|
71
|
+
</td>
|
|
72
|
+
|
|
73
|
+
<td className="s-wallet-table-tbody-tr-td">
|
|
74
|
+
<div className="s-wallet-table-tbody-tr-td-content">
|
|
75
|
+
<span className="s-wallet-mobile-title">{t('pages.wallet.expiry_date')}:</span>
|
|
76
|
+
<span>{transaction.expired_at ? formatTimestamp(transaction.expired_at) : ''}</span>
|
|
77
|
+
</div>
|
|
78
|
+
</td>
|
|
79
|
+
|
|
80
|
+
<td className="s-wallet-table-tbody-tr-td">
|
|
81
|
+
<div className="s-wallet-table-tbody-tr-td-content">
|
|
82
|
+
<div>
|
|
83
|
+
<span className="s-wallet-mobile-title">{t('pages.wallet.transaction_type')}:</span>
|
|
84
|
+
</div>
|
|
85
|
+
<div className={`s-wallet-table-transaction-status-default ${actionTypeClass}`}>
|
|
86
|
+
{!!transaction.description && (
|
|
87
|
+
<>
|
|
88
|
+
<i
|
|
89
|
+
id={transaction.id.toString()}
|
|
90
|
+
className="sicon-information text-lg rtl:ml-4 ltr:mr-4 s-wallet-table-transaction-status-icon-success"
|
|
91
|
+
/>
|
|
92
|
+
<salla-tooltip
|
|
93
|
+
text={transaction.description}
|
|
94
|
+
targetId={transaction.id.toString()}
|
|
95
|
+
/>
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
<span>{transaction.title}</span>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</td>
|
|
102
|
+
</tr>
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export function WalletPage({ query, transactions, balance, pagination }: WalletPageProps) {
|
|
107
|
+
const { t } = useTranslation();
|
|
108
|
+
|
|
109
|
+
const { format: formatMoney } = useMoney();
|
|
110
|
+
|
|
111
|
+
const nextPageRef = useRef(query.page + 1);
|
|
112
|
+
|
|
113
|
+
const loader = useCallback(async () => {
|
|
114
|
+
const pageToLoad = nextPageRef.current;
|
|
115
|
+
const result = await wallet.list({ page: pageToLoad });
|
|
116
|
+
|
|
117
|
+
nextPageRef.current = pageToLoad + 1;
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
items: result.items,
|
|
121
|
+
next: result.next,
|
|
122
|
+
};
|
|
123
|
+
}, []);
|
|
124
|
+
|
|
125
|
+
if (transactions.length === 0) {
|
|
126
|
+
return (
|
|
127
|
+
<>
|
|
128
|
+
<HookSlot name="customer:wallet.transactions.start" />
|
|
129
|
+
<NoContent icon="sicon-full-wallet" message={`${t('pages.wallet.no_transactions')}`} />
|
|
130
|
+
<HookSlot name="customer:wallet.transactions.end" />
|
|
131
|
+
</>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<>
|
|
137
|
+
<HookSlot name="customer:wallet.transactions.start" />
|
|
138
|
+
<table className="s-wallet-table">
|
|
139
|
+
<tbody className="s-wallet-table-tbody">
|
|
140
|
+
<tr className="s-table__tr">
|
|
141
|
+
<td>
|
|
142
|
+
<div className="s-wallet-table-balance-container">
|
|
143
|
+
<i className="s-wallet-table-balance-icon sicon-wallet" />
|
|
144
|
+
<div>
|
|
145
|
+
<div>{formatMoney(balance, { type: 'general' })}</div>
|
|
146
|
+
<div className="font-normal text-gray-400">{t('pages.wallet.balance')}</div>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</td>
|
|
150
|
+
</tr>
|
|
151
|
+
</tbody>
|
|
152
|
+
</table>
|
|
153
|
+
|
|
154
|
+
<h2 className="mt-8">{t('pages.wallet.title')}</h2>
|
|
155
|
+
<table className="s-wallet-table">
|
|
156
|
+
<thead className="s-wallet-table-head">
|
|
157
|
+
<tr className="s-wallet-table-head-tr">
|
|
158
|
+
<th scope="col">{t('pages.wallet.transaction_number')}</th>
|
|
159
|
+
<th scope="col" className="s-wallet-table-head-tr-th">
|
|
160
|
+
{t('pages.wallet.amount')}
|
|
161
|
+
</th>
|
|
162
|
+
<th scope="col" className="s-wallet-table-head-tr-th">
|
|
163
|
+
{t('pages.wallet.date')}
|
|
164
|
+
</th>
|
|
165
|
+
<th scope="col" className="s-wallet-table-head-tr-th">
|
|
166
|
+
{t('pages.wallet.order_no')}
|
|
167
|
+
</th>
|
|
168
|
+
<th scope="col" className="s-wallet-table-head-tr-th">
|
|
169
|
+
{t('pages.wallet.expiry_date')}
|
|
170
|
+
</th>
|
|
171
|
+
<th scope="col" className="s-wallet-table-head-tr-th">
|
|
172
|
+
{t('pages.wallet.transaction_type')}
|
|
173
|
+
</th>
|
|
174
|
+
</tr>
|
|
175
|
+
</thead>
|
|
176
|
+
<tbody className="s-wallet-table-tbody">
|
|
177
|
+
<ItemsList<TransactionItem>
|
|
178
|
+
items={transactions}
|
|
179
|
+
loader={loader}
|
|
180
|
+
mode={pagination.next ? 'infinite' : 'static'}
|
|
181
|
+
itemsAs="Fragment"
|
|
182
|
+
t={(key, fallback) => t(key, fallback || key)}
|
|
183
|
+
>
|
|
184
|
+
{(items) =>
|
|
185
|
+
items.map((transaction) => (
|
|
186
|
+
<TransactionRow key={transaction.id} transaction={transaction} />
|
|
187
|
+
))
|
|
188
|
+
}
|
|
189
|
+
</ItemsList>
|
|
190
|
+
</tbody>
|
|
191
|
+
</table>
|
|
192
|
+
<HookSlot name="customer:wallet.transactions.end" />
|
|
193
|
+
</>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HeadDescriptor } from '../../../utils/head';
|
|
2
|
+
import { buildHreflangAlternates } from '../../../utils/baseHead';
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
import { walletLoader } from './loader';
|
|
5
|
+
import type { WalletPageProps } from './types';
|
|
6
|
+
import type { LoaderContext } from '../../types';
|
|
7
|
+
import type { TwilightContext } from '../../../twilight/context';
|
|
8
|
+
import { RouteId } from '../../../router/route-ids';
|
|
9
|
+
|
|
10
|
+
const LazyWalletPage = lazy(() => import('./WalletPage').then((m) => ({ default: m.WalletPage })));
|
|
11
|
+
|
|
12
|
+
export const WalletPage = LazyWalletPage;
|
|
13
|
+
export { walletLoader } from './loader';
|
|
14
|
+
export type { WalletPageProps } from './types';
|
|
15
|
+
|
|
16
|
+
export const Wallet = {
|
|
17
|
+
id: RouteId.CUSTOMER_WALLET,
|
|
18
|
+
loader: async (
|
|
19
|
+
ctx: LoaderContext,
|
|
20
|
+
extend?: (
|
|
21
|
+
data: WalletPageProps,
|
|
22
|
+
ctx: { params: Record<string, never> }
|
|
23
|
+
) => Promise<Record<string, unknown>> | Record<string, unknown>
|
|
24
|
+
): Promise<WalletPageProps> => {
|
|
25
|
+
const data = await walletLoader(ctx);
|
|
26
|
+
if (extend) {
|
|
27
|
+
const extra = await extend(data, { params: {} });
|
|
28
|
+
return { ...data, ...extra } as WalletPageProps;
|
|
29
|
+
}
|
|
30
|
+
return data;
|
|
31
|
+
},
|
|
32
|
+
head: (ctx: TwilightContext, data: WalletPageProps): HeadDescriptor => ({
|
|
33
|
+
title: data.page.title,
|
|
34
|
+
description: data.page.description,
|
|
35
|
+
alternateLanguages: buildHreflangAlternates(ctx.settings, ctx.location.pathname),
|
|
36
|
+
}),
|
|
37
|
+
Component: LazyWalletPage,
|
|
38
|
+
} as const;
|