@evenicanpm/storefront-core 1.0.1 → 1.0.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/package.json +1 -1
- package/src/api-manager/README.md +30 -22
- package/src/api-manager/datasources/e4/{e4-address.datasource.ts → address/e4-address.datasource.ts} +10 -10
- package/src/api-manager/datasources/e4/address/e4-address.remaps.ts +70 -0
- package/src/api-manager/datasources/e4/address/e4-address.translator.ts +98 -0
- package/src/api-manager/datasources/e4/{e4-cart.datasource.ts → cart/e4-cart.datasource.ts} +17 -16
- package/src/api-manager/datasources/e4/cart/e4-cart.remaps.ts +94 -0
- package/src/api-manager/datasources/e4/cart/e4-cart.translator.ts +23 -0
- package/src/api-manager/datasources/e4/categories/e4-categories.datasource.ts +38 -0
- package/src/api-manager/datasources/e4/categories/e4-categories.translator.ts +161 -0
- package/src/api-manager/datasources/e4/e4.datasource.ts +8 -39
- package/src/api-manager/datasources/e4/graphqlRequestSdk.ts +8427 -0
- package/src/api-manager/datasources/e4/{e4-order.datasource.ts → order/e4-order.datasource.ts} +3 -3
- package/src/api-manager/datasources/e4/order/e4-order.remaps.ts +101 -0
- package/src/api-manager/datasources/e4/{e4-organization.datasource.ts → organization/e4-organization.datasource.ts} +1 -1
- package/src/api-manager/datasources/e4/{e4-product.datasource.ts → product/e4-product.datasource.ts} +13 -11
- package/src/api-manager/datasources/e4/product/e4-product.remaps.ts +88 -0
- package/src/api-manager/datasources/e4/{e4.translator.ts → product/e4-product.translator.ts} +9 -329
- package/src/api-manager/datasources/e4/{e4-session.datasource.ts → session/e4-session.datasource.ts} +3 -3
- package/src/api-manager/datasources/e4/session/e4-session.translator.ts +18 -0
- package/src/api-manager/datasources/e4/user/e4-user.datasource.ts +13 -6
- package/src/api-manager/datasources/e4/user/e4-user.remaps.ts +49 -0
- package/src/api-manager/datasources/e4/user/e4-user.translator.ts +23 -2
- package/src/api-manager/datasources/e4/utils/unwrap-e4-variants.ts +1 -1
- package/src/api-manager/index.ts +11 -6
- package/src/api-manager/schemas/user.schema.ts +3 -1
- package/src/api-manager/services/cart/mutations/add-to-cart.ts +1 -1
- package/src/api-manager/services/cart/mutations/checkout.ts +1 -2
- package/src/api-manager/services/product/server/product.server.ts +4 -1
- package/src/api-manager/types/Datasource.ts +1 -5
- package/src/cms/blocks/BlockManager.tsx +67 -0
- package/src/cms/blocks/Components/BrandLogosScroller.tsx +72 -0
- package/src/cms/blocks/Components/CategoryCard.tsx +47 -0
- package/src/cms/blocks/Components/CategoryCarousel/index.tsx +60 -0
- package/src/cms/blocks/Components/FeaturePill.tsx +99 -0
- package/src/cms/blocks/Components/FeaturedCategories.tsx +41 -0
- package/src/cms/blocks/Components/FeaturedProducts.tsx +41 -0
- package/src/cms/blocks/Components/Footer/data/index.ts +32 -0
- package/src/cms/blocks/Components/Footer/index.tsx +88 -0
- package/src/cms/blocks/Components/Footer/interfaces.ts +37 -0
- package/src/cms/blocks/Components/Footer/sections/FooterAppStore.tsx +45 -0
- package/src/cms/blocks/Components/Footer/sections/FooterContact.tsx +36 -0
- package/src/cms/blocks/Components/Footer/sections/FooterLinks.tsx +30 -0
- package/src/cms/blocks/Components/Footer/sections/FooterLogo.tsx +26 -0
- package/src/cms/blocks/Components/Footer/sections/FooterSocialLinks.tsx +70 -0
- package/src/cms/blocks/Components/Footer/styles/index.ts +39 -0
- package/src/cms/blocks/Components/Footer.tsx +77 -0
- package/src/cms/blocks/Components/Hero.tsx +73 -0
- package/src/cms/blocks/Components/HeroCarousel/index.tsx +42 -0
- package/src/cms/blocks/Components/Image.tsx +39 -0
- package/src/cms/blocks/Components/MediaCard.tsx +41 -0
- package/src/cms/blocks/Components/ProductCarousel/index.tsx +82 -0
- package/src/cms/blocks/Components/ProductSectionFullWidth/index.tsx +103 -0
- package/src/cms/blocks/Components/RichText.tsx +19 -0
- package/src/cms/blocks/Components/Seo/index.tsx +48 -0
- package/src/cms/blocks/Components/Services/index.tsx +21 -0
- package/src/cms/blocks/Components/Services/service-card.tsx +73 -0
- package/src/cms/blocks/Components/shared/featured-product-card.tsx +29 -0
- package/src/cms/blocks/Components/shared/product-category-item.tsx +49 -0
- package/src/cms/blocks/Components/shared/product-grid.tsx +48 -0
- package/src/cms/blocks/Components/shared/top-categories-card.tsx +66 -0
- package/src/cms/blocks/Components/shared/top-rating-product-card.tsx +66 -0
- package/src/cms/blocks/Icons/Components/Category.tsx +14 -0
- package/src/cms/blocks/Icons/Components/DottedStar.tsx +40 -0
- package/src/cms/blocks/Icons/Components/FallbackIcon.tsx +33 -0
- package/src/cms/blocks/Icons/Components/GiftBox.tsx +18 -0
- package/src/cms/blocks/Icons/Components/Light.tsx +13 -0
- package/src/cms/blocks/Icons/Components/NewArrival.tsx +18 -0
- package/src/cms/blocks/Icons/Components/RankBadge.tsx +39 -0
- package/src/cms/blocks/Icons/index.ts +32 -0
- package/src/cms/blocks/index.tsx +16 -0
- package/src/cms/blocks/interfaces.ts +240 -0
- package/src/components/Notifications/README.md +1 -1
- package/src/components/Notifications/notification-context.tsx +1 -1
- package/src/components/README.md +3 -8
- package/src/components/_components/MiniCartClient.tsx +1 -1
- package/src/components/_components/navbar/category-based-menu/components/categories.tsx +1 -1
- package/src/components/_components/navbar/mega-menu/mega-menu.tsx +1 -1
- package/src/components/_components/navbar/nav-list/nav-item-child.tsx +2 -2
- package/src/components/_components/product-cards/product-card-1/product-card-1-wrapper.tsx +1 -1
- package/src/components/_components/products-view/product-view-dialog.tsx +1 -1
- package/src/components/_components/settings/setting.tsx +1 -1
- package/src/components/_components/wishlist/add-to-wishlist-dialog.tsx +1 -1
- package/src/components/_components/wishlist/components/create-new-list.tsx +1 -1
- package/src/components/_components/wishlist/remove-from-wishlist-dialog.tsx +1 -1
- package/src/components/_components/wishlist-modal/add-to-wishlist-dialog.tsx +1 -1
- package/src/components/_components/wishlist-modal/remove-from-wishlist-dialog.tsx +1 -1
- package/src/components/countries-input.tsx +0 -1
- package/src/components-v2/BazaarCard.tsx +21 -0
- package/src/components-v2/BazaarImage.tsx +12 -0
- package/src/components-v2/BazaarMenu.tsx +47 -0
- package/src/components-v2/BazaarSwitch.tsx +37 -0
- package/src/components-v2/BazaarTextField.tsx +73 -0
- package/src/components-v2/BoxShadowCard.tsx +16 -0
- package/src/components-v2/DropZone.tsx +86 -0
- package/src/components-v2/HoverBox.tsx +22 -0
- package/src/components-v2/Image.tsx +5 -0
- package/src/components-v2/ImageWithFallback.tsx +51 -0
- package/src/components-v2/LazyImage.tsx +12 -0
- package/src/components-v2/Loading.tsx +36 -0
- package/src/components-v2/MiniCartClient.tsx +65 -0
- package/src/components-v2/README.md +4 -0
- package/src/components-v2/SearchInput.tsx +28 -0
- package/src/components-v2/SnackbarProvider.tsx +32 -0
- package/src/components-v2/T/index.tsx +15 -0
- package/src/components-v2/Typography.tsx +227 -0
- package/src/components-v2/WhiteButton.tsx +20 -0
- package/src/components-v2/accordion/accordion-header.tsx +43 -0
- package/src/components-v2/accordion/index.ts +1 -0
- package/src/components-v2/bazaar-types.ts +84 -0
- package/src/components-v2/carousel/carousel.tsx +72 -0
- package/src/components-v2/carousel/components/carousel-arrows.tsx +60 -0
- package/src/components-v2/carousel/components/carousel-dots.tsx +21 -0
- package/src/components-v2/carousel/index.ts +3 -0
- package/src/components-v2/carousel/styles/index.ts +93 -0
- package/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1.tsx +64 -0
- package/src/components-v2/carousel-cards/carousel-card-1/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-1/styles.ts +34 -0
- package/src/components-v2/carousel-cards/carousel-card-2/carousel-card-2.tsx +78 -0
- package/src/components-v2/carousel-cards/carousel-card-2/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-2/styles.ts +26 -0
- package/src/components-v2/carousel-cards/carousel-card-3/carousel-card-3.tsx +37 -0
- package/src/components-v2/carousel-cards/carousel-card-3/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-3/styles.ts +28 -0
- package/src/components-v2/carousel-cards/carousel-card-4/carousel-card-4.tsx +81 -0
- package/src/components-v2/carousel-cards/carousel-card-4/index.ts +1 -0
- package/src/components-v2/carousel-cards/carousel-card-4/styles.ts +27 -0
- package/src/components-v2/categories/category-list/category-list.tsx +59 -0
- package/src/components-v2/categories/category-list/index.ts +1 -0
- package/src/components-v2/categories/category-list/styles.ts +29 -0
- package/src/components-v2/categories/category-list/types.ts +4 -0
- package/src/components-v2/categories/category-list-item/category-menu-item.tsx +37 -0
- package/src/components-v2/categories/category-list-item/index.ts +1 -0
- package/src/components-v2/categories/category-list-item/styles.ts +35 -0
- package/src/components-v2/categories/category-menu.tsx +51 -0
- package/src/components-v2/categories/mega-menu/banner.tsx +60 -0
- package/src/components-v2/categories/mega-menu/column-list.tsx +70 -0
- package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +37 -0
- package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +37 -0
- package/src/components-v2/categories/mega-menu/styles.ts +25 -0
- package/src/components-v2/categories/types.ts +16 -0
- package/src/components-v2/category-cards/category-card-1/category-card-1.tsx +21 -0
- package/src/components-v2/category-cards/category-card-1/index.ts +1 -0
- package/src/components-v2/category-cards/category-card-1/styles.ts +37 -0
- package/src/components-v2/countdown/count-box.tsx +19 -0
- package/src/components-v2/countdown/count-down.tsx +24 -0
- package/src/components-v2/countdown/index.tsx +2 -0
- package/src/components-v2/countdown/useCountDown.ts +41 -0
- package/src/components-v2/countries-input.tsx +73 -0
- package/src/components-v2/data-table/index.ts +2 -0
- package/src/components-v2/data-table/table-header.tsx +91 -0
- package/src/components-v2/data-table/table-pagination.tsx +36 -0
- package/src/components-v2/flex-box/flex-between.tsx +14 -0
- package/src/components-v2/flex-box/flex-box.tsx +9 -0
- package/src/components-v2/flex-box/flex-row-center.tsx +9 -0
- package/src/components-v2/flex-box/index.ts +5 -0
- package/src/components-v2/footer/components/about-links.tsx +23 -0
- package/src/components-v2/footer/components/app-store.tsx +38 -0
- package/src/components-v2/footer/components/customer-care-links.tsx +21 -0
- package/src/components-v2/footer/components/logo.tsx +23 -0
- package/src/components-v2/footer/components/social-links.tsx +43 -0
- package/src/components-v2/footer/data/index.ts +54 -0
- package/src/components-v2/footer/footer-1.tsx +62 -0
- package/src/components-v2/footer/footer-2.tsx +57 -0
- package/src/components-v2/footer/footer-3.tsx +53 -0
- package/src/components-v2/footer/footer-4.tsx +71 -0
- package/src/components-v2/footer/index.ts +4 -0
- package/src/components-v2/footer/styles/index.ts +42 -0
- package/src/components-v2/header/components/categories-menu.tsx +23 -0
- package/src/components-v2/header/components/mobile-header.tsx +75 -0
- package/src/components-v2/header/components/user.test.tsx +200 -0
- package/src/components-v2/header/components/user.tsx +204 -0
- package/src/components-v2/header/header.tsx +63 -0
- package/src/components-v2/header/hooks/use-header.ts +13 -0
- package/src/components-v2/header/index.ts +1 -0
- package/src/components-v2/header/sticky-header.tsx +17 -0
- package/src/components-v2/header/styles/index.ts +24 -0
- package/src/components-v2/icons/cart-bag.tsx +13 -0
- package/src/components-v2/icons/category-outline.tsx +29 -0
- package/src/components-v2/icons/category.tsx +12 -0
- package/src/components-v2/icons/home.tsx +19 -0
- package/src/components-v2/icons/search.tsx +13 -0
- package/src/components-v2/icons/shopping-bag-outlined.tsx +13 -0
- package/src/components-v2/icons/up-down.tsx +21 -0
- package/src/components-v2/icons/user.tsx +13 -0
- package/src/components-v2/icons/user2.tsx +14 -0
- package/src/components-v2/mini-cart/__tests__/cart-item.test.tsx +174 -0
- package/src/components-v2/mini-cart/__tests__/mini-cart.test.tsx +121 -0
- package/src/components-v2/mini-cart/__tests__/test-cart-empty.json +84 -0
- package/src/components-v2/mini-cart/__tests__/test-cart-with-item.json +244 -0
- package/src/components-v2/mini-cart/components/bottom-actions.tsx +27 -0
- package/src/components-v2/mini-cart/components/cart-item.tsx +147 -0
- package/src/components-v2/mini-cart/components/empty-view.tsx +29 -0
- package/src/components-v2/mini-cart/components/top-header.tsx +37 -0
- package/src/components-v2/mini-cart/index.ts +1 -0
- package/src/components-v2/mini-cart/mini-cart.tsx +107 -0
- package/src/components-v2/mobile-navigation/index.ts +3 -0
- package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +73 -0
- package/src/components-v2/mobile-navigation/styles/index.ts +63 -0
- package/src/components-v2/nav-link/index.ts +5 -0
- package/src/components-v2/nav-link/nav-link-2.tsx +32 -0
- package/src/components-v2/nav-link/nav-link-3.tsx +67 -0
- package/src/components-v2/nav-link/nav-link.tsx +53 -0
- package/src/components-v2/navbar/categories.tsx +27 -0
- package/src/components-v2/navbar/category-based-menu/category-based-menu.tsx +52 -0
- package/src/components-v2/navbar/category-based-menu/components/categories.tsx +44 -0
- package/src/components-v2/navbar/category-based-menu/components/category-item.tsx +31 -0
- package/src/components-v2/navbar/category-based-menu/components/child-categories.tsx +38 -0
- package/src/components-v2/navbar/category-based-menu/index.ts +1 -0
- package/src/components-v2/navbar/category-based-menu/styles.ts +81 -0
- package/src/components-v2/navbar/category-based-menu/types.ts +18 -0
- package/src/components-v2/navbar/index.ts +1 -0
- package/src/components-v2/navbar/mega-menu/category-list.tsx +29 -0
- package/src/components-v2/navbar/mega-menu/index.ts +1 -0
- package/src/components-v2/navbar/mega-menu/mega-menu.tsx +71 -0
- package/src/components-v2/navbar/mega-menu/styles.ts +43 -0
- package/src/components-v2/navbar/mobile-menu/index.ts +1 -0
- package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +70 -0
- package/src/components-v2/navbar/mobile-menu/render-levels.test.tsx +71 -0
- package/src/components-v2/navbar/mobile-menu/render-levels.tsx +62 -0
- package/src/components-v2/navbar/nav-list/cms-nav.test.tsx +84 -0
- package/src/components-v2/navbar/nav-list/index.ts +1 -0
- package/src/components-v2/navbar/nav-list/nav-item-child.tsx +66 -0
- package/src/components-v2/navbar/nav-list/nav-list.tsx +119 -0
- package/src/components-v2/navbar/navbar.tsx +43 -0
- package/src/components-v2/navbar/styles.ts +90 -0
- package/src/components-v2/navbar/utils/transform-nav.test.ts +209 -0
- package/src/components-v2/navbar/utils/transform-nav.ts +43 -0
- package/src/components-v2/newsletter/index.ts +1 -0
- package/src/components-v2/newsletter/newsletter.tsx +112 -0
- package/src/components-v2/newsletter/social-icons.tsx +35 -0
- package/src/components-v2/newsletter/styles.ts +65 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/link-item.tsx +21 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/list-item.tsx +27 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/nav-accordion.tsx +36 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/components/render-child.tsx +26 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/grocery-side-nav.tsx +32 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/index.ts +1 -0
- package/src/components-v2/page-sidenav/grocery-side-nav/styles/index.ts +11 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/components/list-item.tsx +27 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/components/nav-accordion.tsx +44 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/components/render-child.tsx +20 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/health-beauty-side-nav.tsx +43 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/index.ts +1 -0
- package/src/components-v2/page-sidenav/health-beauty-side-nav/styles/index.ts +27 -0
- package/src/components-v2/page-sidenav/side-navbar/components/list-item.tsx +25 -0
- package/src/components-v2/page-sidenav/side-navbar/components/nav-accordion.tsx +46 -0
- package/src/components-v2/page-sidenav/side-navbar/components/render-child.tsx +20 -0
- package/src/components-v2/page-sidenav/side-navbar/index.ts +1 -0
- package/src/components-v2/page-sidenav/side-navbar/side-nav-bar.tsx +77 -0
- package/src/components-v2/page-sidenav/side-navbar/styles/index.ts +73 -0
- package/src/components-v2/page-sidenav/side-navbar-2/components/button-content.tsx +32 -0
- package/src/components-v2/page-sidenav/side-navbar-2/components/sidebar-accordion.tsx +66 -0
- package/src/components-v2/page-sidenav/side-navbar-2/index.ts +1 -0
- package/src/components-v2/page-sidenav/side-navbar-2/side-navbar-2.tsx +63 -0
- package/src/components-v2/page-sidenav/side-navbar-2/styles/index.ts +68 -0
- package/src/components-v2/product-cards/discount-chip.tsx +43 -0
- package/src/components-v2/product-cards/product-card-1/components/hover-actions.tsx +37 -0
- package/src/components-v2/product-cards/product-card-1/components/quantity-buttons.tsx +65 -0
- package/src/components-v2/product-cards/product-card-1/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-1/product-card-1-wrapper.tsx +304 -0
- package/src/components-v2/product-cards/product-card-1/product-card.tsx +107 -0
- package/src/components-v2/product-cards/product-card-1/styles/index.ts +46 -0
- package/src/components-v2/product-cards/product-card-10/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-10/product-card.tsx +128 -0
- package/src/components-v2/product-cards/product-card-10/styles/index.ts +38 -0
- package/src/components-v2/product-cards/product-card-11/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-11/product-card.tsx +66 -0
- package/src/components-v2/product-cards/product-card-11/styles/index.ts +16 -0
- package/src/components-v2/product-cards/product-card-12/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-12/product-card.tsx +42 -0
- package/src/components-v2/product-cards/product-card-12/styles/index.ts +16 -0
- package/src/components-v2/product-cards/product-card-13/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-13/product-card.tsx +48 -0
- package/src/components-v2/product-cards/product-card-13/styles/index.ts +25 -0
- package/src/components-v2/product-cards/product-card-14/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-14/product-card.tsx +125 -0
- package/src/components-v2/product-cards/product-card-14/styles/index.ts +40 -0
- package/src/components-v2/product-cards/product-card-15/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-15/product-card.tsx +121 -0
- package/src/components-v2/product-cards/product-card-15/styles/index.ts +57 -0
- package/src/components-v2/product-cards/product-card-16/components/quantity-buttons.tsx +54 -0
- package/src/components-v2/product-cards/product-card-16/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-16/product-card.tsx +116 -0
- package/src/components-v2/product-cards/product-card-16/styles/index.ts +18 -0
- package/src/components-v2/product-cards/product-card-2/components/favorite-button.tsx +29 -0
- package/src/components-v2/product-cards/product-card-2/components/product-price.tsx +26 -0
- package/src/components-v2/product-cards/product-card-2/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-2/product-card.tsx +70 -0
- package/src/components-v2/product-cards/product-card-3/components/hover-actions.tsx +83 -0
- package/src/components-v2/product-cards/product-card-3/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-3/product-card.tsx +110 -0
- package/src/components-v2/product-cards/product-card-3/styles/index.ts +89 -0
- package/src/components-v2/product-cards/product-card-4/components/hover-actions.tsx +50 -0
- package/src/components-v2/product-cards/product-card-4/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-4/product-card.tsx +128 -0
- package/src/components-v2/product-cards/product-card-4/styles/index.ts +66 -0
- package/src/components-v2/product-cards/product-card-5/components/button-actions.tsx +49 -0
- package/src/components-v2/product-cards/product-card-5/components/hover-actions.tsx +50 -0
- package/src/components-v2/product-cards/product-card-5/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-5/product-card.tsx +137 -0
- package/src/components-v2/product-cards/product-card-5/styles/index.ts +94 -0
- package/src/components-v2/product-cards/product-card-6/components/hover-actions.tsx +50 -0
- package/src/components-v2/product-cards/product-card-6/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-6/product-card.tsx +121 -0
- package/src/components-v2/product-cards/product-card-6/styles/index.ts +63 -0
- package/src/components-v2/product-cards/product-card-7/components/product-status.tsx +18 -0
- package/src/components-v2/product-cards/product-card-7/components/quantity-buttons.tsx +47 -0
- package/src/components-v2/product-cards/product-card-7/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-7/product-card.tsx +139 -0
- package/src/components-v2/product-cards/product-card-7/styles/index.ts +98 -0
- package/src/components-v2/product-cards/product-card-8/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-8/product-card.tsx +151 -0
- package/src/components-v2/product-cards/product-card-8/styles/index.ts +61 -0
- package/src/components-v2/product-cards/product-card-9/components/add-to-cart.tsx +63 -0
- package/src/components-v2/product-cards/product-card-9/components/favorite-button.tsx +27 -0
- package/src/components-v2/product-cards/product-card-9/components/tags.tsx +33 -0
- package/src/components-v2/product-cards/product-card-9/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-9/product-card.tsx +169 -0
- package/src/components-v2/product-cards/product-card-wishlist/components/hover-actions.tsx +37 -0
- package/src/components-v2/product-cards/product-card-wishlist/index.ts +1 -0
- package/src/components-v2/product-cards/product-card-wishlist/product-card.tsx +118 -0
- package/src/components-v2/product-cards/product-card-wishlist/styles/index.ts +53 -0
- package/src/components-v2/product-cards/product-price.tsx +26 -0
- package/src/components-v2/product-cards/product-rating.tsx +28 -0
- package/src/components-v2/product-cards/product-title.tsx +24 -0
- package/src/components-v2/product-cards/use-product.ts +35 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-error.tsx +46 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-label.tsx +27 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-list-chip.tsx +78 -0
- package/src/components-v2/product-dimensions/components/dimensions-group-list.tsx +24 -0
- package/src/components-v2/product-dimensions/components/dimensions-group.tsx +55 -0
- package/src/components-v2/product-dimensions/components/dimensions.tsx +84 -0
- package/src/components-v2/product-dimensions/index.tsx +38 -0
- package/src/components-v2/product-dimensions/utils/has-selected-dimension.ts +20 -0
- package/src/components-v2/product-quantity-buttons/product-quantity-buttons.tsx +88 -0
- package/src/components-v2/products-view/product-view-dialog.tsx +218 -0
- package/src/components-v2/products-view/products-grid-view.tsx +52 -0
- package/src/components-v2/products-view/products-list-view.tsx +49 -0
- package/src/components-v2/progress/index.ts +1 -0
- package/src/components-v2/progress/progress.tsx +77 -0
- package/src/components-v2/scrollbar/index.ts +1 -0
- package/src/components-v2/scrollbar/scrollbar.tsx +27 -0
- package/src/components-v2/scrollbar/styles.ts +15 -0
- package/src/components-v2/search-box/__test__/search-input-category.test.tsx +110 -0
- package/src/components-v2/search-box/__test__/search-input.test.tsx +137 -0
- package/src/components-v2/search-box/__test__/search-results.json +165 -0
- package/src/components-v2/search-box/components/category-dropdown.tsx +61 -0
- package/src/components-v2/search-box/components/search-result.tsx +86 -0
- package/src/components-v2/search-box/hooks/use-search.ts +63 -0
- package/src/components-v2/search-box/index.ts +2 -0
- package/src/components-v2/search-box/search-input-category.test.tsx +110 -0
- package/src/components-v2/search-box/search-input-category.tsx +203 -0
- package/src/components-v2/search-box/search-input.test.tsx +41 -0
- package/src/components-v2/search-box/search-input.tsx +66 -0
- package/src/components-v2/search-box/styles/index.ts +47 -0
- package/src/components-v2/section-header/index.ts +2 -0
- package/src/components-v2/section-header/section-creator.tsx +29 -0
- package/src/components-v2/section-header/section-header.tsx +44 -0
- package/src/components-v2/service-cards/icon-component.tsx +18 -0
- package/src/components-v2/service-cards/service-card-1/index.ts +1 -0
- package/src/components-v2/service-cards/service-card-1/service-card-1.tsx +42 -0
- package/src/components-v2/service-cards/service-card-2/index.ts +1 -0
- package/src/components-v2/service-cards/service-card-2/service-card-2.tsx +37 -0
- package/src/components-v2/service-cards/service-card-3/index.ts +1 -0
- package/src/components-v2/service-cards/service-card-3/service-card-3.tsx +28 -0
- package/src/components-v2/service-cards/service-card-3/styles.ts +23 -0
- package/src/components-v2/settings/index.ts +1 -0
- package/src/components-v2/settings/setting.tsx +141 -0
- package/src/components-v2/settings/styles.ts +57 -0
- package/src/components-v2/shop-card/index.ts +1 -0
- package/src/components-v2/shop-card/shop-card.tsx +152 -0
- package/src/components-v2/shop-card/styles.ts +33 -0
- package/src/components-v2/side-nav/index.ts +1 -0
- package/src/components-v2/side-nav/side-nav.tsx +49 -0
- package/src/components-v2/site-logo.tsx +17 -0
- package/src/components-v2/sticky/Sticky.tsx +62 -0
- package/src/components-v2/sticky/index.ts +1 -0
- package/src/components-v2/sticky/styles.ts +38 -0
- package/src/components-v2/sticky-wrapper/index.ts +1 -0
- package/src/components-v2/sticky-wrapper/sticky-wrapper.tsx +21 -0
- package/src/components-v2/sticky-wrapper/styles.ts +25 -0
- package/src/components-v2/stories/story-content/index.ts +1 -0
- package/src/components-v2/stories/story-content/story-content.tsx +28 -0
- package/src/components-v2/stories/story-content/styles.ts +22 -0
- package/src/components-v2/stories/story-item/index.ts +1 -0
- package/src/components-v2/stories/story-item/story-item.tsx +24 -0
- package/src/components-v2/stories/story-item/styles.ts +11 -0
- package/src/components-v2/stories/story-viewer/index.ts +1 -0
- package/src/components-v2/stories/story-viewer/story-viewer.tsx +44 -0
- package/src/components-v2/stories/story-viewer/styles.ts +15 -0
- package/src/components-v2/subscribe-input/index.ts +1 -0
- package/src/components-v2/subscribe-input/styles.ts +14 -0
- package/src/components-v2/subscribe-input/subscribe-input.tsx +43 -0
- package/src/components-v2/topbar/index.ts +1 -0
- package/src/components-v2/topbar/styles.ts +55 -0
- package/src/components-v2/topbar/top-bar.tsx +115 -0
- package/src/components-v2/utils/constants.ts +8 -0
- package/src/components-v2/wishlist/add-to-wishlist-dialog.tsx +161 -0
- package/src/components-v2/wishlist/components/create-new-list.tsx +167 -0
- package/src/components-v2/wishlist/components/create-wishlist-button.tsx +40 -0
- package/src/components-v2/wishlist/components/dashboard-header.tsx +123 -0
- package/src/components-v2/wishlist/components/navigation.tsx +87 -0
- package/src/components-v2/wishlist/components/no-records.tsx +20 -0
- package/src/components-v2/wishlist/components/wishlist-modal-item.tsx +66 -0
- package/src/components-v2/wishlist/remove-from-wishlist-dialog.tsx +175 -0
- package/src/components-v2/wishlist/styles.ts +61 -0
- package/src/components-v2/wishlist-modal/TODO.md +10 -0
- package/src/components-v2/wishlist-modal/add-to-wishlist-button.tsx +69 -0
- package/src/components-v2/wishlist-modal/add-to-wishlist-dialog.tsx +161 -0
- package/src/components-v2/wishlist-modal/remove-from-wishlist-dialog.tsx +174 -0
- package/src/components-v2/wishlist-modal/wishlist-modal-item.tsx +65 -0
- package/src/pages/README.md +4 -0
- package/src/pages/product-details/product-intro/product-intro.tsx +3 -1
- package/src/pages/product-list/quick-view-dialog-content.tsx +4 -2
- package/src/pages-v2/README.md +4 -0
- package/src/pages-v2/account/addresses/address-form.tsx +289 -0
- package/src/pages-v2/account/addresses/address-item.tsx +104 -0
- package/src/pages-v2/account/dashboard-header.tsx +123 -0
- package/src/pages-v2/account/navigation.tsx +87 -0
- package/src/pages-v2/account/no-records.tsx +20 -0
- package/src/pages-v2/account/orders/icons/delivery.tsx +14 -0
- package/src/pages-v2/account/orders/icons/package-box.tsx +13 -0
- package/src/pages-v2/account/orders/icons/truck-filled.tsx +14 -0
- package/src/pages-v2/account/orders/order-progress.tsx +114 -0
- package/src/pages-v2/account/orders/order-row.tsx +64 -0
- package/src/pages-v2/account/orders/order-summary.tsx +87 -0
- package/src/pages-v2/account/orders/ordered-products.tsx +121 -0
- package/src/pages-v2/account/profile/profile-button.test.tsx +59 -0
- package/src/pages-v2/account/profile/profile-button.tsx +50 -0
- package/src/pages-v2/account/profile/user-info.tsx +62 -0
- package/src/pages-v2/account/styles.ts +32 -0
- package/src/pages-v2/account/table-row.tsx +19 -0
- package/src/pages-v2/account/wishlist/create-new-list.tsx +167 -0
- package/src/pages-v2/account/wishlist/create-wishlist-button.tsx +40 -0
- package/src/pages-v2/account/wishlist/wishlist-item.tsx +82 -0
- package/src/pages-v2/blog/pagination.tsx +38 -0
- package/src/pages-v2/cart/cart-item.tsx +312 -0
- package/src/pages-v2/cart/checkout-form.tsx +122 -0
- package/src/pages-v2/cart/coupon-entry.tsx +90 -0
- package/src/pages-v2/cart/estimate-shipping.tsx +183 -0
- package/src/pages-v2/cart/wrapper.tsx +30 -0
- package/src/pages-v2/checkout/checkout-alt-form/address-card.tsx +76 -0
- package/src/pages-v2/checkout/checkout-alt-form/checkout-form.tsx +131 -0
- package/src/pages-v2/checkout/checkout-alt-form/checkout-step.tsx +120 -0
- package/src/pages-v2/checkout/checkout-alt-form/customer-information.tsx +94 -0
- package/src/pages-v2/checkout/checkout-alt-form/delivery-address.tsx +174 -0
- package/src/pages-v2/checkout/checkout-alt-form/delivery-date.tsx +114 -0
- package/src/pages-v2/checkout/checkout-alt-form/delivery-options.tsx +190 -0
- package/src/pages-v2/checkout/checkout-alt-form/edit-address-form.tsx +130 -0
- package/src/pages-v2/checkout/checkout-alt-form/heading.tsx +50 -0
- package/src/pages-v2/checkout/checkout-alt-form/index.ts +1 -0
- package/src/pages-v2/checkout/checkout-alt-form/new-address-form.tsx +299 -0
- package/src/pages-v2/checkout/checkout-alt-form/node.tsx +9 -0
- package/src/pages-v2/checkout/checkout-alt-form/payment-details.tsx +347 -0
- package/src/pages-v2/checkout/checkout-alt-form/safe-card-preview-data.tsx +36 -0
- package/src/pages-v2/checkout/checkout-alt-form/types.ts +20 -0
- package/src/pages-v2/checkout/checkout-alt-summary/cart-item.tsx +42 -0
- package/src/pages-v2/checkout/checkout-alt-summary/checkout-alt-summary.tsx +42 -0
- package/src/pages-v2/checkout/checkout-alt-summary/index.ts +1 -0
- package/src/pages-v2/checkout/checkout-alt-summary/list-item.tsx +31 -0
- package/src/pages-v2/confirmation/address.tsx +25 -0
- package/src/pages-v2/confirmation/confirmation-summary.tsx +55 -0
- package/src/pages-v2/confirmation/ordered-products.tsx +115 -0
- package/src/pages-v2/product-details/available-shops.tsx +48 -0
- package/src/pages-v2/product-details/bopis/find-in-store-button.tsx +63 -0
- package/src/pages-v2/product-details/bopis/find-in-store-modal.tsx +257 -0
- package/src/pages-v2/product-details/bopis/pickup-option-select.tsx +127 -0
- package/src/pages-v2/product-details/bopis/search-header.tsx +69 -0
- package/src/pages-v2/product-details/checkbox-label.tsx +20 -0
- package/src/pages-v2/product-details/currency.ts +64 -0
- package/src/pages-v2/product-details/frequently-bought.tsx +97 -0
- package/src/pages-v2/product-details/frequently-product-card.tsx +63 -0
- package/src/pages-v2/product-details/product-comment.tsx +49 -0
- package/src/pages-v2/product-details/product-description.tsx +22 -0
- package/src/pages-v2/product-details/product-filter-card.tsx +265 -0
- package/src/pages-v2/product-details/product-intro/product-intro-images.tsx +90 -0
- package/src/pages-v2/product-details/product-intro/product-intro.tsx +256 -0
- package/src/pages-v2/product-details/product-review.tsx +131 -0
- package/src/pages-v2/product-details/product-tabs.tsx +51 -0
- package/src/pages-v2/product-details/related-products.tsx +42 -0
- package/src/pages-v2/product-details/types.ts +11 -0
- package/src/pages-v2/product-list/breadcrumbs.tsx +39 -0
- package/src/pages-v2/product-list/checkbox-label.tsx +20 -0
- package/src/pages-v2/product-list/facet-group.tsx +125 -0
- package/src/pages-v2/product-list/facet.tsx +36 -0
- package/src/pages-v2/product-list/list-filter.tsx +43 -0
- package/src/pages-v2/product-list/pagination.tsx +80 -0
- package/src/pages-v2/product-list/product-list-context.tsx +302 -0
- package/src/pages-v2/product-list/product-list-state.ts +187 -0
- package/src/pages-v2/product-list/product-rating.tsx +16 -0
- package/src/pages-v2/product-list/quick-view-dialog-content.tsx +207 -0
- package/src/pages-v2/product-list/quick-view-dialog.tsx +54 -0
- package/src/pages-v2/product-list/range-filter.tsx +125 -0
- package/src/pages-v2/product-list/scrollbar.tsx +38 -0
- package/src/pages-v2/product-list/search-bar.tsx +162 -0
- package/src/pages-v2/product-list/selected-facets.tsx +80 -0
- package/src/pages-v2/product-list/side-nav.tsx +49 -0
- package/src/pages-v2/product-list/swatch.tsx +80 -0
- package/src/pages-v2/product-list/types.ts +18 -0
- package/src/pages-v2/product-list/use-product-list.ts +12 -0
- package/src/pages-v2/product-list/useCategoryFilter.tsx +26 -0
- package/src/pages-v2/product-list/utils/facet-helpers.ts +5 -0
- package/src/pages-v2/product-list/utils/generate-breadcrumbs.ts +30 -0
- package/src/pages-v2/product-list/utils/getCategoryFilterFromSlug.ts +153 -0
- package/src/pages-v2/product-list/utils/product-list-helper.ts +111 -0
- package/src/pages-v2/product-list/utils/product-list-types.ts +41 -0
- package/src/pages-v2/product-list/utils/search-for-category.ts +76 -0
- package/src/pages-v2/product-list/utils/sort-options.ts +44 -0
- package/src/pages-v2/product-list/utils/use-previous-refiners.ts +14 -0
- package/src/pages-v2/quickorder/order-upload.tsx +150 -0
- package/src/pages-v2/quickorder/quick-order-form.tsx +346 -0
- package/src/pages-v2/quickorder/quick-order-row.tsx +144 -0
- package/src/providers/nav-provider/index.tsx +59 -0
- package/src/providers/nav-provider/utils/createLink.ts +15 -0
- package/src/providers/notifications/README.md +15 -0
- package/src/providers/notifications/notification-context.tsx +82 -0
- package/src/providers/notifications/use-notification.ts +12 -0
- package/tsconfig.json +3 -2
- package/typedoc.js +10 -0
- package/src/api-manager/api-manager.config.json +0 -12
- package/src/api-manager/datasources/e4/e4.remaps.ts +0 -355
- package/src/api-manager/datasources/e4/e4.translator.test.ts +0 -202
- /package/src/hooks/{use-cart.tsx → use-cart.ts} +0 -0
- /package/src/hooks/{use-variants.tsx → use-variants.ts} +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/*
|
|
2
|
+
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
|
|
3
|
+
import { useSession } from "next-auth/react";
|
|
4
|
+
import { NextIntlClientProvider } from "next-intl";
|
|
5
|
+
import { vi } from "vitest";
|
|
6
|
+
import User from "./user";
|
|
7
|
+
import { msalInstance } from "@/lib/auth/msal";
|
|
8
|
+
import signOut from "@/lib/auth/signout";
|
|
9
|
+
|
|
10
|
+
vi.mock("@/services | update | bd/session/mutations/session-init", () => ({
|
|
11
|
+
default: () => ({ mutateAsync: vi.fn() }),
|
|
12
|
+
}));
|
|
13
|
+
|
|
14
|
+
const mockMutate = vi.fn().mockResolvedValue({});
|
|
15
|
+
vi.mock("@/services | update | bd/user/mutations/update-user", () => ({
|
|
16
|
+
default: () => ({ mutateAsync: mockMutate }),
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
vi.mock("@/services | update | bd/session/mutations/session-logout", () => ({
|
|
20
|
+
default: () => ({ mutateAsync: vi.fn() }),
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
vi.mock("next/navigation", () => ({
|
|
24
|
+
useRouter: () => ({
|
|
25
|
+
push: vi.fn(),
|
|
26
|
+
}),
|
|
27
|
+
usePathname: () => "/mock-path",
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
vi.mock("next-auth/react", () => ({
|
|
31
|
+
useSession: vi.fn(),
|
|
32
|
+
signIn: vi.fn(),
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
vi.mock("@/lib/auth/msal", () => ({
|
|
36
|
+
msalInstance: {
|
|
37
|
+
handleRedirectPromise: vi.fn().mockResolvedValue(null),
|
|
38
|
+
},
|
|
39
|
+
initializeMsal: vi.fn().mockResolvedValue(undefined),
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
vi.mock("@/lib/auth/signout", () => ({
|
|
43
|
+
default: vi.fn(),
|
|
44
|
+
}));
|
|
45
|
+
|
|
46
|
+
describe("User Component", async () => {
|
|
47
|
+
const messages = (await import("@/../messages/en-USon")).default;
|
|
48
|
+
|
|
49
|
+
it("renders login button when user is not authenticated", () => {
|
|
50
|
+
(useSession as jest.Mock).mockReturnValue({
|
|
51
|
+
data: null,
|
|
52
|
+
status: "unauthenticated",
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
render(
|
|
56
|
+
<NextIntlClientProvider locale="en" messages={messages}>
|
|
57
|
+
<User />
|
|
58
|
+
</NextIntlClientProvider>,
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
expect(screen.getByText("Login")).toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("renders user menu button when authenticated", async () => {
|
|
65
|
+
(useSession as jest.Mock).mockReturnValue({
|
|
66
|
+
data: {
|
|
67
|
+
user: { email: "test@example.com" },
|
|
68
|
+
accessToken: "mockAccessToken",
|
|
69
|
+
},
|
|
70
|
+
status: "authenticated",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
render(
|
|
74
|
+
<NextIntlClientProvider locale="en" messages={messages}>
|
|
75
|
+
<User />
|
|
76
|
+
</NextIntlClientProvider>,
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const userMenuButton = await screen.findByRole("button", {
|
|
80
|
+
name: /user menu/i,
|
|
81
|
+
});
|
|
82
|
+
expect(userMenuButton).toBeInTheDocument();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it("calls signOut when session.error is present", () => {
|
|
86
|
+
(useSession as jest.Mock).mockReturnValue({
|
|
87
|
+
data: { error: "Some auth error" },
|
|
88
|
+
status: "authenticated",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
render(<User />);
|
|
92
|
+
|
|
93
|
+
expect(signOut).toHaveBeenCalled();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("calls signOut on logout button click", async () => {
|
|
97
|
+
const mockSignOut = vi.mocked(signOut);
|
|
98
|
+
|
|
99
|
+
(useSession as jest.Mock).mockReturnValue({
|
|
100
|
+
data: { user: { email: "test@example.com" }, accessToken: "token" },
|
|
101
|
+
status: "authenticated",
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
render(
|
|
105
|
+
<NextIntlClientProvider locale="en" messages={messages}>
|
|
106
|
+
<User />
|
|
107
|
+
</NextIntlClientProvider>,
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// Open the menu first
|
|
111
|
+
fireEvent.click(screen.getByRole("button", { name: /user menu/i }));
|
|
112
|
+
|
|
113
|
+
const logoutButton = screen.getByRole("button", { name: /logout/i });
|
|
114
|
+
expect(logoutButton).toBeInTheDocument();
|
|
115
|
+
|
|
116
|
+
fireEvent.click(logoutButton);
|
|
117
|
+
expect(mockSignOut).toHaveBeenCalled();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("handles MSAL redirect and updates user on success", async () => {
|
|
121
|
+
(useSession as jest.Mock).mockReturnValue({
|
|
122
|
+
data: {
|
|
123
|
+
user: { email: "test@example.com" },
|
|
124
|
+
accessToken: "mockAccessToken",
|
|
125
|
+
},
|
|
126
|
+
status: "authenticated",
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
vi.mocked(msalInstance.handleRedirectPromise).mockResolvedValue({
|
|
130
|
+
authority: "https://login.microsoftonline.com/some_authority",
|
|
131
|
+
uniqueId: "some_unique_id",
|
|
132
|
+
tenantId: "some_tenant_id",
|
|
133
|
+
tokenType: "id_token",
|
|
134
|
+
correlationId: "some_correlation_id",
|
|
135
|
+
idToken: "some_id_token",
|
|
136
|
+
accessToken: "some_access_token",
|
|
137
|
+
fromCache: false,
|
|
138
|
+
expiresOn: new Date(Date.now() + 3600000),
|
|
139
|
+
scopes: ["some_scope"],
|
|
140
|
+
account: {
|
|
141
|
+
homeAccountId: "some_home_account_id",
|
|
142
|
+
username: "some_username",
|
|
143
|
+
localAccountId: "some_local_account_id",
|
|
144
|
+
environment: "some_environment",
|
|
145
|
+
tenantId: "some_tenant_id",
|
|
146
|
+
},
|
|
147
|
+
idTokenClaims: {
|
|
148
|
+
given_name: "John",
|
|
149
|
+
family_name: "Doe",
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
render(
|
|
154
|
+
<NextIntlClientProvider locale="en" messages={messages}>
|
|
155
|
+
<User />
|
|
156
|
+
</NextIntlClientProvider>,
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
await waitFor(() =>
|
|
160
|
+
expect(mockMutate).toHaveBeenCalledWith({
|
|
161
|
+
AccountNumber: "",
|
|
162
|
+
FirstName: "John",
|
|
163
|
+
LastName: "Doe",
|
|
164
|
+
}),
|
|
165
|
+
);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("handles error in MSAL redirect", async () => {
|
|
169
|
+
const consoleErrorSpy = vi
|
|
170
|
+
.spyOn(console, "error")
|
|
171
|
+
.mockImplementation(vi.fn());
|
|
172
|
+
|
|
173
|
+
(useSession as jest.Mock).mockReturnValue({
|
|
174
|
+
data: {
|
|
175
|
+
user: { email: "test@example.com" },
|
|
176
|
+
accessToken: "mockAccessToken",
|
|
177
|
+
},
|
|
178
|
+
status: "authenticated",
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
vi.mocked(msalInstance.handleRedirectPromise).mockRejectedValue(
|
|
182
|
+
new Error("MSAL Error"),
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
render(
|
|
186
|
+
<NextIntlClientProvider locale="en" messages={messages}>
|
|
187
|
+
<User />
|
|
188
|
+
</NextIntlClientProvider>,
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
await waitFor(() =>
|
|
192
|
+
expect(consoleErrorSpy).toHaveBeenCalledWith(
|
|
193
|
+
"MSAL Redirect Handling Error:",
|
|
194
|
+
expect.any(Error),
|
|
195
|
+
),
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
consoleErrorSpy.mockRestore();
|
|
199
|
+
});
|
|
200
|
+
});*/
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useState, MouseEvent, useEffect } from "react";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
|
|
6
|
+
// API
|
|
7
|
+
import useUpdateUser from "@/services/user/mutations/update-user";
|
|
8
|
+
import useSessionInit from "@/services/session/mutations/session-init";
|
|
9
|
+
import useSessionLogout from "@/services/session/mutations/session-logout";
|
|
10
|
+
|
|
11
|
+
// UI
|
|
12
|
+
import {
|
|
13
|
+
Box,
|
|
14
|
+
Button,
|
|
15
|
+
Popover,
|
|
16
|
+
List,
|
|
17
|
+
ListItemButton,
|
|
18
|
+
IconButton,
|
|
19
|
+
} from "@mui/material";
|
|
20
|
+
import { MdPersonOutline as PersonOutline } from "react-icons/md";
|
|
21
|
+
import MobileUserIcon from "@evenicanpm/storefront-core/src/components-v2/icons/user";
|
|
22
|
+
import { NavLink } from "@evenicanpm/storefront-core/src/components-v2/nav-link/index";
|
|
23
|
+
import T from "@evenicanpm/storefront-core/src/components-v2/T";
|
|
24
|
+
|
|
25
|
+
// Auth
|
|
26
|
+
import { signIn, useSession } from "next-auth/react";
|
|
27
|
+
import { getMsalInstance, initializeMsal } from "@/auth/msal";
|
|
28
|
+
import signOut from "@/auth/signout"; // similar implementation like signOut from "next-auth/react"
|
|
29
|
+
|
|
30
|
+
interface IdTokenClaims {
|
|
31
|
+
given_name?: string;
|
|
32
|
+
family_name?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const MENU_ITEMS = [
|
|
36
|
+
{ href: "/account/profile", label: "Account.Menu.profile" },
|
|
37
|
+
{ href: "/account/addresses", label: "Account.Menu.addresses" },
|
|
38
|
+
{ href: "/account/orders", label: "Account.Menu.orders" },
|
|
39
|
+
{ href: "/account/wish-lists", label: "Account.Menu.wishlists" },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
interface Props {
|
|
43
|
+
mobile?: boolean;
|
|
44
|
+
}
|
|
45
|
+
const User = ({ mobile = false }: Props) => {
|
|
46
|
+
const { data: session, status } = useSession();
|
|
47
|
+
|
|
48
|
+
if (session?.error) {
|
|
49
|
+
// Custom error set in server - /api/auth/[...nextauth]
|
|
50
|
+
console.warn("Auth Error", session?.error);
|
|
51
|
+
signOut();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const isAuthenticated = !!session;
|
|
55
|
+
|
|
56
|
+
const router = useRouter();
|
|
57
|
+
|
|
58
|
+
const { mutateAsync: sessionInit } = useSessionInit();
|
|
59
|
+
const { mutateAsync: updateUser } = useUpdateUser();
|
|
60
|
+
const { mutateAsync: sessionLogout } = useSessionLogout();
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (isAuthenticated) {
|
|
64
|
+
const { accessToken, user } = session;
|
|
65
|
+
const email = user?.email;
|
|
66
|
+
if (accessToken && email) {
|
|
67
|
+
sessionInit({
|
|
68
|
+
accessToken,
|
|
69
|
+
email,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, [isAuthenticated, session, sessionInit]);
|
|
74
|
+
|
|
75
|
+
// Handles MSAL redirect - which happens for edit profile and reset password use cases in account/profile page.
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const handleRedirect = async () => {
|
|
78
|
+
try {
|
|
79
|
+
await initializeMsal();
|
|
80
|
+
const response = await getMsalInstance().handleRedirectPromise();
|
|
81
|
+
if (response) {
|
|
82
|
+
// Update the API when profile info is updated through MSAL
|
|
83
|
+
const { given_name, family_name } =
|
|
84
|
+
response.idTokenClaims as IdTokenClaims;
|
|
85
|
+
if (given_name && family_name) {
|
|
86
|
+
updateUser({
|
|
87
|
+
AccountNumber: "",
|
|
88
|
+
FirstName: given_name,
|
|
89
|
+
LastName: family_name,
|
|
90
|
+
}).catch((err) => console.error("Update user Error:", err));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error("MSAL Redirect Handling Error:", error);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
handleRedirect();
|
|
99
|
+
}, [updateUser]);
|
|
100
|
+
|
|
101
|
+
const handleLogout = async () => {
|
|
102
|
+
try {
|
|
103
|
+
await sessionLogout({});
|
|
104
|
+
signOut();
|
|
105
|
+
} catch (error) {
|
|
106
|
+
console.error("Logout Error:", error);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
|
111
|
+
|
|
112
|
+
const open = Boolean(anchorEl);
|
|
113
|
+
const id = open ? "account-popover" : undefined;
|
|
114
|
+
|
|
115
|
+
const setAnchorElNull = () => setAnchorEl(null);
|
|
116
|
+
|
|
117
|
+
if (status === "loading") return <></>;
|
|
118
|
+
|
|
119
|
+
if (mobile) {
|
|
120
|
+
return (
|
|
121
|
+
<IconButton
|
|
122
|
+
aria-label="User Menu"
|
|
123
|
+
onClick={() => {
|
|
124
|
+
if (!isAuthenticated) {
|
|
125
|
+
signIn();
|
|
126
|
+
} else {
|
|
127
|
+
router.push("/account/profile");
|
|
128
|
+
}
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
<MobileUserIcon style={{ fontSize: "1.25rem" }} />
|
|
132
|
+
</IconButton>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<>
|
|
138
|
+
{isAuthenticated ? (
|
|
139
|
+
<>
|
|
140
|
+
<Box display="flex" alignItems="center" justifyContent="center">
|
|
141
|
+
<IconButton
|
|
142
|
+
aria-label="User Menu"
|
|
143
|
+
onClick={(event: MouseEvent<HTMLButtonElement>) =>
|
|
144
|
+
setAnchorEl(event.currentTarget)
|
|
145
|
+
}
|
|
146
|
+
>
|
|
147
|
+
<PersonOutline />
|
|
148
|
+
</IconButton>
|
|
149
|
+
<Popover
|
|
150
|
+
id={id}
|
|
151
|
+
open={open}
|
|
152
|
+
anchorEl={anchorEl}
|
|
153
|
+
anchorOrigin={{ vertical: "bottom", horizontal: "right" }}
|
|
154
|
+
transformOrigin={{
|
|
155
|
+
vertical: "top",
|
|
156
|
+
horizontal: "right",
|
|
157
|
+
}}
|
|
158
|
+
onClose={() => setAnchorElNull()}
|
|
159
|
+
>
|
|
160
|
+
<List
|
|
161
|
+
component="nav"
|
|
162
|
+
aria-label="mailbox folders"
|
|
163
|
+
disablePadding
|
|
164
|
+
onClick={() => setAnchorElNull()}
|
|
165
|
+
sx={{ p: 1 }}
|
|
166
|
+
>
|
|
167
|
+
{MENU_ITEMS.map(({ href, label }) => (
|
|
168
|
+
<NavLink key={href} href={href} style={{ color: "inherit" }}>
|
|
169
|
+
<ListItemButton>
|
|
170
|
+
<T path={label} />
|
|
171
|
+
</ListItemButton>
|
|
172
|
+
</NavLink>
|
|
173
|
+
))}
|
|
174
|
+
<Box p={1}>
|
|
175
|
+
<Button
|
|
176
|
+
fullWidth
|
|
177
|
+
size="small"
|
|
178
|
+
color="primary"
|
|
179
|
+
variant="outlined"
|
|
180
|
+
onClick={() => handleLogout()}
|
|
181
|
+
>
|
|
182
|
+
<T path="Account.Menu.btnLogout" />
|
|
183
|
+
</Button>
|
|
184
|
+
</Box>
|
|
185
|
+
</List>
|
|
186
|
+
</Popover>
|
|
187
|
+
</Box>
|
|
188
|
+
</>
|
|
189
|
+
) : (
|
|
190
|
+
<Button
|
|
191
|
+
size="small"
|
|
192
|
+
variant="contained"
|
|
193
|
+
color="primary"
|
|
194
|
+
onClick={() => signIn()}
|
|
195
|
+
sx={{ mr: 2 }}
|
|
196
|
+
>
|
|
197
|
+
<T path="Account.Menu.btnLogin" />
|
|
198
|
+
</Button>
|
|
199
|
+
)}
|
|
200
|
+
</>
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export default User;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Fragment, ReactNode } from "react";
|
|
4
|
+
import useTheme from "@mui/material/styles/useTheme";
|
|
5
|
+
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
// GLOBAL CUSTOM COMPONENTS
|
|
8
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components-v2/flex-box/flex-box";
|
|
9
|
+
import SiteLogo from "@evenicanpm/storefront-core/src/components-v2/site-logo";
|
|
10
|
+
// LOCAL CUSTOM COMPONENTS
|
|
11
|
+
import MobileHeader from "./components/mobile-header";
|
|
12
|
+
import CategoriesMenu from "./components/categories-menu";
|
|
13
|
+
import User from "./components/user";
|
|
14
|
+
import MiniCartClient from "../MiniCartClient";
|
|
15
|
+
// STYLED COMPONENTS
|
|
16
|
+
import { HeaderWrapper, StyledContainer } from "./styles/index";
|
|
17
|
+
// API
|
|
18
|
+
import getCart from "@/api-manager/services/cart/queries/get-cart";
|
|
19
|
+
import { Cart } from "@/schemas/cart.schema";
|
|
20
|
+
|
|
21
|
+
// ==============================================================
|
|
22
|
+
interface Props {
|
|
23
|
+
isFixed?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
midSlot: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
// ==============================================================
|
|
28
|
+
|
|
29
|
+
export default function Header({ isFixed, className, midSlot }: Props) {
|
|
30
|
+
const theme = useTheme();
|
|
31
|
+
const downMd = useMediaQuery(theme.breakpoints.down(1150));
|
|
32
|
+
|
|
33
|
+
const { data: cart } = getCart.useData();
|
|
34
|
+
|
|
35
|
+
const CONTENT_FOR_LARGE_DEVICE = (
|
|
36
|
+
<Fragment>
|
|
37
|
+
{/* Left content - logo and category */}
|
|
38
|
+
<FlexBox minWidth={100} alignItems="center">
|
|
39
|
+
<SiteLogo />
|
|
40
|
+
{isFixed ? <CategoriesMenu /> : null}
|
|
41
|
+
</FlexBox>
|
|
42
|
+
|
|
43
|
+
{/* Center content - search form | navigation */}
|
|
44
|
+
{midSlot}
|
|
45
|
+
|
|
46
|
+
{/* login / account and cart buttons */}
|
|
47
|
+
<User />
|
|
48
|
+
{cart && <MiniCartClient cart={cart} />}
|
|
49
|
+
</Fragment>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<HeaderWrapper className={clsx(className)}>
|
|
54
|
+
<StyledContainer>
|
|
55
|
+
{downMd ? (
|
|
56
|
+
<MobileHeader cart={cart as Cart} />
|
|
57
|
+
) : (
|
|
58
|
+
CONTENT_FOR_LARGE_DEVICE
|
|
59
|
+
)}
|
|
60
|
+
</StyledContainer>
|
|
61
|
+
</HeaderWrapper>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
export default function useHeader() {
|
|
6
|
+
const [searchBarOpen, setSearchBarOpen] = useState(false);
|
|
7
|
+
const toggleSearchBar = () => setSearchBarOpen((state) => !state);
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
searchBarOpen,
|
|
11
|
+
toggleSearchBar,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./header";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import Header from "@evenicanpm/storefront-core/src/components-v2/header/index";
|
|
4
|
+
import SearchInputWithCategory from "@evenicanpm/storefront-core/src/components-v2/search-box/search-input-category";
|
|
5
|
+
import Sticky from "@evenicanpm/storefront-core/src/components-v2/sticky/index";
|
|
6
|
+
import { useCallback, useState } from "react";
|
|
7
|
+
|
|
8
|
+
export default function StickyHeader() {
|
|
9
|
+
const [isFixed, setIsFixed] = useState(false);
|
|
10
|
+
const toggleIsFixed = useCallback((fixed: boolean) => setIsFixed(fixed), []);
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Sticky fixedOn={0} onSticky={toggleIsFixed} scrollDistance={300}>
|
|
14
|
+
<Header isFixed={isFixed} midSlot={<SearchInputWithCategory />} />
|
|
15
|
+
</Sticky>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Container from "@mui/material/Container";
|
|
2
|
+
import styled from "@mui/material/styles/styled";
|
|
3
|
+
// CONSTANT VARIABLES
|
|
4
|
+
import { layoutConstant } from "@evenicanpm/storefront-core/src/components-v2/utils/constants";
|
|
5
|
+
|
|
6
|
+
export const HeaderWrapper = styled("div")(({ theme }) => ({
|
|
7
|
+
zIndex: 3,
|
|
8
|
+
position: "relative",
|
|
9
|
+
height: layoutConstant.headerHeight,
|
|
10
|
+
transition: "height 250ms ease-in-out",
|
|
11
|
+
background: theme.palette.background.paper,
|
|
12
|
+
// borderBottom: `1px solid ${theme.palette.grey[200]}`,
|
|
13
|
+
[theme.breakpoints.down("sm")]: {
|
|
14
|
+
height: layoutConstant.mobileHeaderHeight,
|
|
15
|
+
},
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
export const StyledContainer = styled(Container)({
|
|
19
|
+
gap: 2,
|
|
20
|
+
height: "100%",
|
|
21
|
+
display: "flex",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
justifyContent: "space-between",
|
|
24
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
2
|
+
|
|
3
|
+
const CartBag = createSvgIcon(
|
|
4
|
+
<svg viewBox="0 0 20 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path
|
|
6
|
+
d="M5.33329 7.37181V5.37181C5.33329 2.79431 7.42079 0.705139 9.99996 0.705139C12.5791 0.705139 14.6666 2.79431 14.6666 5.37181V7.37181H17.3333C18.4375 7.37181 19.3333 8.26764 19.3333 9.37181V18.0385C19.3333 20.2468 17.5416 22.0385 15.3333 22.0385H4.66663C2.45746 22.0385 0.666626 20.2468 0.666626 18.0385V9.37181C0.666626 8.26764 1.56204 7.37181 2.66663 7.37181H5.33329ZM7.33329 7.37181H12.6666V5.37181C12.6666 3.89889 11.4708 2.70514 9.99996 2.70514C8.52913 2.70514 7.33329 3.89889 7.33329 5.37181V7.37181ZM2.66663 9.37181V18.0385C2.66663 19.1426 3.56204 20.0385 4.66663 20.0385H15.3333C16.4375 20.0385 17.3333 19.1426 17.3333 18.0385V9.37181H14.6666V11.7051C14.6666 12.2593 14.2208 12.7051 13.6666 12.7051C13.1125 12.7051 12.6666 12.2593 12.6666 11.7051V9.37181H7.33329V11.7051C7.33329 12.2593 6.88746 12.7051 6.33329 12.7051C5.77913 12.7051 5.33329 12.2593 5.33329 11.7051V9.37181H2.66663Z"
|
|
7
|
+
fill="currentColor"
|
|
8
|
+
/>
|
|
9
|
+
</svg>,
|
|
10
|
+
"CartBag",
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default CartBag;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
2
|
+
|
|
3
|
+
const CategoryOutlined = createSvgIcon(
|
|
4
|
+
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<path
|
|
6
|
+
fillRule="evenodd"
|
|
7
|
+
clipRule="evenodd"
|
|
8
|
+
d="M2 3C2 2.44772 2.44772 2 3 2H10C10.5523 2 11 2.44772 11 3V10C11 10.5523 10.5523 11 10 11H3C2.44772 11 2 10.5523 2 10V3ZM4 4V9H9V4H4Z"
|
|
9
|
+
/>
|
|
10
|
+
<path
|
|
11
|
+
fillRule="evenodd"
|
|
12
|
+
clipRule="evenodd"
|
|
13
|
+
d="M13 3C13 2.44772 13.4477 2 14 2H21C21.5523 2 22 2.44772 22 3V10C22 10.5523 21.5523 11 21 11H14C13.4477 11 13 10.5523 13 10V3ZM15 4V9H20V4H15Z"
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
fillRule="evenodd"
|
|
17
|
+
clipRule="evenodd"
|
|
18
|
+
d="M13 14C13 13.4477 13.4477 13 14 13H21C21.5523 13 22 13.4477 22 14V21C22 21.5523 21.5523 22 21 22H14C13.4477 22 13 21.5523 13 21V14ZM15 15V20H20V15H15Z"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
fillRule="evenodd"
|
|
22
|
+
clipRule="evenodd"
|
|
23
|
+
d="M2 14C2 13.4477 2.44772 13 3 13H10C10.5523 13 11 13.4477 11 14V21C11 21.5523 10.5523 22 10 22H3C2.44772 22 2 21.5523 2 21V14ZM4 15V20H9V15H4Z"
|
|
24
|
+
/>
|
|
25
|
+
</svg>,
|
|
26
|
+
"CategoryOutlined",
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default CategoryOutlined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
4
|
+
|
|
5
|
+
const Category = createSvgIcon(
|
|
6
|
+
<svg fill="currentColor" viewBox="0 0 64 64">
|
|
7
|
+
<path d="m29 11v14a4 4 0 0 1 -4 4h-14a4 4 0 0 1 -4-4v-14a4 4 0 0 1 4-4h14a4 4 0 0 1 4 4zm24-4h-14a4 4 0 0 0 -4 4v14a4 4 0 0 0 4 4h14a4 4 0 0 0 4-4v-14a4 4 0 0 0 -4-4zm-28 28h-14a4 4 0 0 0 -4 4v14a4 4 0 0 0 4 4h14a4 4 0 0 0 4-4v-14a4 4 0 0 0 -4-4zm21 0a11 11 0 1 0 11 11 11 11 0 0 0 -11-11z" />
|
|
8
|
+
</svg>,
|
|
9
|
+
"Category",
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
export default Category;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
2
|
+
|
|
3
|
+
const Home = createSvgIcon(
|
|
4
|
+
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<path
|
|
6
|
+
fillRule="evenodd"
|
|
7
|
+
clipRule="evenodd"
|
|
8
|
+
d="M11.3861 1.21065C11.7472 0.929784 12.2528 0.929784 12.6139 1.21065L21.6139 8.21065C21.8575 8.4001 22 8.69141 22 9V20C22 20.7957 21.6839 21.5587 21.1213 22.1213C20.5587 22.6839 19.7957 23 19 23H5C4.20435 23 3.44129 22.6839 2.87868 22.1213C2.31607 21.5587 2 20.7957 2 20V9C2 8.69141 2.14247 8.4001 2.38606 8.21065L11.3861 1.21065ZM4 9.48908V20C4 20.2652 4.10536 20.5196 4.29289 20.7071C4.48043 20.8946 4.73478 21 5 21H19C19.2652 21 19.5196 20.8946 19.7071 20.7071C19.8946 20.5196 20 20.2652 20 20V9.48908L12 3.26686L4 9.48908Z"
|
|
9
|
+
/>
|
|
10
|
+
<path
|
|
11
|
+
fillRule="evenodd"
|
|
12
|
+
clipRule="evenodd"
|
|
13
|
+
d="M8 12C8 11.4477 8.44772 11 9 11H15C15.5523 11 16 11.4477 16 12V22C16 22.5523 15.5523 23 15 23C14.4477 23 14 22.5523 14 22V13H10V22C10 22.5523 9.55228 23 9 23C8.44772 23 8 22.5523 8 22V12Z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>,
|
|
16
|
+
"Home",
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default Home;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
2
|
+
|
|
3
|
+
const Search = createSvgIcon(
|
|
4
|
+
<svg viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path
|
|
6
|
+
d="M21.3162 20.0056L17.2879 15.9891C18.5876 14.3333 19.2928 12.2886 19.2902 10.1836C19.2902 8.30891 18.7343 6.47636 17.6928 4.91764C16.6513 3.35892 15.1709 2.14405 13.439 1.42665C11.707 0.709246 9.80123 0.521542 7.96259 0.887269C6.12396 1.253 4.43507 2.15573 3.10948 3.48131C1.7839 4.80689 0.88117 6.49579 0.515443 8.33442C0.149715 10.1731 0.33742 12.0788 1.05482 13.8108C1.77222 15.5428 2.98709 17.0231 4.54581 18.0646C6.10453 19.1061 7.93709 19.662 9.81174 19.662C11.9167 19.6646 13.9615 18.9594 15.6173 17.6597L19.6338 21.688C19.7439 21.7991 19.8749 21.8872 20.0193 21.9474C20.1637 22.0075 20.3186 22.0385 20.475 22.0385C20.6314 22.0385 20.7862 22.0075 20.9306 21.9474C21.075 21.8872 21.206 21.7991 21.3162 21.688C21.4272 21.5779 21.5154 21.4468 21.5755 21.3024C21.6357 21.1581 21.6666 21.0032 21.6666 20.8468C21.6666 20.6904 21.6357 20.5355 21.5755 20.3912C21.5154 20.2468 21.4272 20.1157 21.3162 20.0056ZM2.70292 10.1836C2.70292 8.77758 3.11985 7.40316 3.90098 6.23412C4.6821 5.06508 5.79235 4.15393 7.09132 3.61588C8.39028 3.07783 9.81963 2.93705 11.1986 3.21134C12.5776 3.48564 13.8443 4.16269 14.8384 5.15688C15.8326 6.15106 16.5097 7.41773 16.784 8.79671C17.0583 10.1757 16.9175 11.605 16.3794 12.904C15.8414 14.203 14.9302 15.3132 13.7612 16.0943C12.5922 16.8755 11.2177 17.2924 9.81174 17.2924C7.92637 17.2924 6.11821 16.5434 4.78505 15.2103C3.45189 13.8771 2.70292 12.0689 2.70292 10.1836Z"
|
|
7
|
+
fill="currentColor"
|
|
8
|
+
/>
|
|
9
|
+
</svg>,
|
|
10
|
+
"Search",
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default Search;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
2
|
+
|
|
3
|
+
const ShoppingBagOutlined = createSvgIcon(
|
|
4
|
+
<svg fill="currentColor" viewBox="0 0 24 24">
|
|
5
|
+
<g>
|
|
6
|
+
<rect fill="none" height="24" width="24" />
|
|
7
|
+
<path d="M18,6h-2c0-2.21-1.79-4-4-4S8,3.79,8,6H6C4.9,6,4,6.9,4,8v12c0,1.1,0.9,2,2,2h12c1.1,0,2-0.9,2-2V8C20,6.9,19.1,6,18,6z M12,4c1.1,0,2,0.9,2,2h-4C10,4.9,10.9,4,12,4z M18,20H6V8h2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V8h4v2c0,0.55,0.45,1,1,1s1-0.45,1-1V8 h2V20z" />
|
|
8
|
+
</g>
|
|
9
|
+
</svg>,
|
|
10
|
+
"ShoppingBagOutlined",
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default ShoppingBagOutlined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
2
|
+
|
|
3
|
+
const UpDown = createSvgIcon(
|
|
4
|
+
<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path
|
|
6
|
+
d="M8.64847 6.88354H3.35158C3.04454 6.88354 2.86173 7.2269 3.03517 7.4812L5.68362 11.3824C5.83596 11.6062 6.16526 11.6062 6.3176 11.3824L8.96605 7.4812C9.13714 7.2269 8.9555 6.88354 8.64847 6.88354Z"
|
|
7
|
+
fill="currentColor"
|
|
8
|
+
/>
|
|
9
|
+
<path
|
|
10
|
+
d="M8.64852 6.76641C8.54188 6.76641 8.43524 6.76641 8.32743 6.76641C8.05204 6.76641 7.77782 6.76641 7.50243 6.76641C7.13329 6.76641 6.76532 6.76641 6.39618 6.76641C6.0036 6.76641 5.61102 6.76641 5.21845 6.76641C4.87274 6.76641 4.52821 6.76641 4.18251 6.76641C3.95517 6.76641 3.72783 6.76641 3.49931 6.76641C3.45361 6.76641 3.40673 6.76641 3.36103 6.76641C3.17705 6.76758 3.00478 6.85898 2.91455 7.02187C2.82197 7.18828 2.83251 7.39102 2.93916 7.54922C2.96728 7.59141 2.9954 7.63242 3.02353 7.67344C3.16064 7.87617 3.29892 8.07891 3.43603 8.28164C3.64111 8.58281 3.84618 8.88516 4.05009 9.18633C4.26923 9.50977 4.48954 9.8332 4.70868 10.1566C4.89384 10.4285 5.07782 10.7016 5.26298 10.9734C5.36259 11.1211 5.46337 11.2687 5.56298 11.4164C5.63798 11.5277 5.73642 11.6168 5.87001 11.6508C6.08446 11.7059 6.2954 11.6145 6.41962 11.4363C6.50282 11.3168 6.58368 11.1949 6.66571 11.0742C6.84032 10.8164 7.01493 10.5598 7.18954 10.302C7.40751 9.97969 7.62665 9.65859 7.84461 9.33633C8.05438 9.02812 8.26415 8.71875 8.47274 8.41055C8.62391 8.18789 8.77508 7.96406 8.92625 7.74141C9.02703 7.59375 9.14891 7.44961 9.14539 7.26094C9.14422 6.98672 8.91922 6.77109 8.64852 6.76641C8.49735 6.76406 8.49735 6.99844 8.64852 7.00078C8.85125 7.0043 8.98133 7.22109 8.88055 7.39687C8.8618 7.42969 8.83836 7.46133 8.81727 7.49297C8.70125 7.66289 8.58641 7.83398 8.47039 8.00391C8.06493 8.60156 7.65946 9.19922 7.25282 9.79687C6.93173 10.2703 6.61063 10.7437 6.28954 11.216C6.2661 11.2512 6.24266 11.2863 6.21805 11.3203C6.12313 11.4504 5.94149 11.4715 5.82548 11.3684C5.79149 11.3379 5.76806 11.2992 5.74227 11.2617C5.69774 11.1961 5.65321 11.1305 5.60868 11.0648C5.2454 10.5305 4.88212 9.99492 4.52001 9.46055C4.13915 8.89922 3.75712 8.33672 3.37626 7.77539C3.29775 7.65937 3.21806 7.54453 3.14072 7.42852C3.05634 7.30195 3.07392 7.14726 3.18642 7.0582C3.2497 7.00898 3.31298 7.00078 3.3915 7.00078C3.86025 7.00078 4.33017 7.00078 4.79892 7.00078C5.55009 7.00078 6.30126 7.00078 7.05243 7.00078C7.55985 7.00078 8.0661 7.00078 8.57352 7.00078C8.5993 7.00078 8.62391 7.00078 8.64969 7.00078C8.79852 7.00078 8.79969 6.76641 8.64852 6.76641ZM8.64852 5.11641H3.35165C3.04462 5.11641 2.86181 4.77305 3.03525 4.51875L5.68368 0.617578C5.83602 0.39375 6.16532 0.39375 6.31766 0.617578L8.9661 4.51875C9.13719 4.77305 8.95555 5.11641 8.64852 5.11641Z"
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
/>
|
|
13
|
+
<path
|
|
14
|
+
d="M8.64832 4.99922C8.28153 4.99922 7.91473 4.99922 7.54676 4.99922C6.80262 4.99922 6.05849 4.99922 5.31552 4.99922C4.73193 4.99922 4.14834 4.99922 3.56592 4.99922C3.50615 4.99922 3.44639 4.99922 3.38662 4.99922C3.30459 4.99922 3.23428 4.98515 3.17803 4.93476C3.07022 4.83633 3.05733 4.6957 3.1417 4.57031C3.16865 4.53047 3.19561 4.49062 3.22256 4.45195C3.55068 3.96914 3.87881 3.48633 4.20576 3.00234C4.60888 2.4082 5.01201 1.81524 5.41513 1.2211C5.52529 1.05821 5.63661 0.895317 5.74677 0.732426C5.77372 0.692583 5.7995 0.650395 5.83583 0.62227C5.95536 0.52852 6.12763 0.55313 6.21903 0.680864C6.30106 0.794536 6.37724 0.912895 6.45575 1.02891C6.62333 1.27618 6.79208 1.52461 6.95966 1.77188C7.37801 2.38828 7.79637 3.00469 8.21473 3.61992C8.37293 3.85312 8.53113 4.08515 8.68816 4.31836C8.7327 4.38281 8.77605 4.44844 8.82059 4.51289C8.8452 4.55039 8.87566 4.58789 8.89441 4.6289C8.96824 4.8 8.84051 4.9957 8.64832 4.99922C8.49715 5.00156 8.49715 5.23593 8.64832 5.23359C8.92371 5.2289 9.15926 5.00039 9.14871 4.71914C9.14519 4.60898 9.10301 4.51289 9.04324 4.425C8.93777 4.26914 8.8323 4.11445 8.72684 3.95859C8.53934 3.68203 8.35184 3.40547 8.16317 3.12891C7.94285 2.80547 7.72371 2.48086 7.5034 2.15742C7.30184 1.85977 7.10028 1.56211 6.89755 1.26563C6.76395 1.06875 6.62919 0.870707 6.49559 0.673833C6.47098 0.637505 6.44638 0.600005 6.42059 0.563677C6.29403 0.382036 6.06903 0.287115 5.85224 0.356255C5.65419 0.418364 5.56044 0.591802 5.45146 0.751176C5.30146 0.971488 5.15263 1.1918 5.00263 1.41328C4.79287 1.72266 4.5831 2.03203 4.37216 2.34141C4.1542 2.6625 3.93623 2.98242 3.71943 3.30352C3.54365 3.5625 3.3667 3.82266 3.19092 4.08164C3.10654 4.20586 3.021 4.3289 2.93779 4.45429C2.82998 4.61601 2.82178 4.82929 2.9249 4.99687C3.01983 5.15039 3.18389 5.23476 3.36318 5.23593C3.50615 5.23711 3.65029 5.23593 3.79326 5.23593C4.08974 5.23593 4.38623 5.23593 4.68271 5.23593C5.06357 5.23593 5.44325 5.23593 5.82411 5.23593C6.21317 5.23593 6.60223 5.23593 6.9913 5.23593C7.31942 5.23593 7.64872 5.23593 7.97684 5.23593C8.17371 5.23593 8.37059 5.23593 8.56746 5.23593C8.59441 5.23593 8.62137 5.23593 8.64832 5.23593C8.79832 5.23359 8.79949 4.99922 8.64832 4.99922Z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>,
|
|
18
|
+
"UpDown",
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export default UpDown;
|