@evenicanpm/storefront-core 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +37 -0
- package/.storybook/preview.ts +14 -0
- package/README.md +17 -2
- package/__mocks__/next-font.js +4 -0
- package/package.json +19 -13
- package/src/api-manager/datasources/e4/graphqlRequestSdk.ts +265 -5
- package/src/api-manager/schemas/product.schema.ts +2 -2
- package/src/api-manager/services/cart/mutations/add-discount-code.ts +11 -0
- package/src/api-manager/services/cart/mutations/checkout.ts +1 -1
- package/src/api-manager/services/create-query.ts +11 -4
- package/src/api-manager/services/product/queries/get-product-availability.ts +1 -2
- package/src/api-manager/services/user/mutations/add-to-wishlist.ts +2 -2
- package/src/api-manager/services/user/mutations/copy-cart-to-wishlist.ts +2 -1
- package/src/api-manager/services/user/mutations/remove-from-wishlist.ts +4 -4
- package/src/api-manager/services/user/mutations/update-wishlist.ts +2 -1
- package/src/api-manager/services/user/queries/get-wishlist-details.ts +2 -2
- package/src/cms/blocks/components/product-carousel/index.tsx +6 -3
- package/src/cms/blocks/components/product-section-fullwidth/index.tsx +2 -2
- package/src/cms/blocks/components/shared/product-grid.tsx +5 -2
- package/src/cms/interfaces/navigation.ts +9 -9
- package/src/components/Blocks/Components/CategoryCarousel/index.tsx +3 -3
- package/src/components/Blocks/Components/HeroCarousel/index.tsx +2 -2
- package/src/components/Blocks/Components/ProductCarousel/index.tsx +5 -5
- package/src/components/Blocks/Components/ProductSectionFullWidth/index.tsx +6 -6
- package/src/components/Blocks/Components/Services/service-card.tsx +4 -1
- package/src/components/Blocks/Components/shared/featured-product-card.tsx +2 -2
- package/src/components/Blocks/Components/shared/product-category-item.tsx +3 -3
- package/src/components/Blocks/Components/shared/product-grid.tsx +2 -2
- package/src/components/Blocks/Components/shared/top-categories-card.tsx +1 -1
- package/src/components/Blocks/Components/shared/top-rating-product-card.tsx +6 -3
- package/src/components/Footer/sections/FooterAppStore.tsx +1 -1
- package/src/components/Footer/sections/FooterContact.tsx +1 -1
- package/src/components/Footer/sections/FooterLogo.tsx +2 -2
- package/src/components/Footer/sections/FooterSocialLinks.tsx +1 -1
- package/src/components/_components/MiniCartClient.tsx +2 -2
- package/src/components/_components/accordion/accordion-header.tsx +1 -1
- package/src/components/_components/carousel-cards/carousel-card-1/carousel-card-1.tsx +2 -2
- package/src/components/_components/carousel-cards/carousel-card-2/carousel-card-2.tsx +9 -4
- package/src/components/_components/carousel-cards/carousel-card-3/carousel-card-3.tsx +6 -3
- package/src/components/_components/carousel-cards/carousel-card-4/carousel-card-4.tsx +6 -1
- package/src/components/_components/categories/category-list/category-list.tsx +3 -3
- package/src/components/_components/categories/mega-menu/banner.tsx +7 -3
- package/src/components/_components/categories/mega-menu/column-list.tsx +3 -3
- package/src/components/_components/categories/mega-menu/mega-menu-1.tsx +2 -2
- package/src/components/_components/category-cards/category-card-1/category-card-1.tsx +2 -2
- package/src/components/_components/countdown/count-box.tsx +4 -1
- package/src/components/_components/countdown/count-down.tsx +1 -1
- package/src/components/_components/data-table/table-header.tsx +1 -1
- package/src/components/_components/footer/components/app-store.tsx +1 -1
- package/src/components/_components/footer/components/logo.tsx +2 -2
- package/src/components/_components/footer/components/social-links.tsx +1 -1
- package/src/components/_components/footer/footer-1.tsx +1 -1
- package/src/components/_components/footer/footer-2.tsx +2 -2
- package/src/components/_components/footer/footer-3.tsx +2 -2
- package/src/components/_components/footer/footer-4.tsx +3 -3
- package/src/components/_components/header/components/categories-menu.tsx +3 -3
- package/src/components/_components/header/components/mobile-header.tsx +9 -6
- package/src/components/_components/header/components/user.tsx +5 -5
- package/src/components/_components/header/header.tsx +2 -2
- package/src/components/_components/header/sticky-header.tsx +3 -3
- package/src/components/_components/mini-cart/components/cart-item.tsx +5 -2
- package/src/components/_components/mini-cart/components/empty-view.tsx +2 -2
- package/src/components/_components/mini-cart/components/top-header.tsx +5 -2
- package/src/components/_components/mini-cart/mini-cart.tsx +3 -3
- package/src/components/_components/mobile-navigation/mobile-navigation-bar.tsx +5 -5
- package/src/components/_components/nav-link/nav-link-2.tsx +1 -1
- package/src/components/_components/nav-link/nav-link-3.tsx +1 -1
- package/src/components/_components/navbar/categories.tsx +3 -3
- package/src/components/_components/navbar/category-based-menu/category-based-menu.tsx +1 -1
- package/src/components/_components/navbar/category-based-menu/components/child-categories.tsx +2 -2
- package/src/components/_components/navbar/mega-menu/category-list.tsx +1 -1
- package/src/components/_components/navbar/mega-menu/mega-menu.tsx +1 -1
- package/src/components/_components/navbar/mobile-menu/mobile-menu.tsx +2 -2
- package/src/components/_components/navbar/mobile-menu/render-levels.tsx +3 -3
- package/src/components/_components/navbar/nav-list/nav-item-child.tsx +3 -3
- package/src/components/_components/navbar/nav-list/nav-list.tsx +4 -4
- package/src/components/_components/newsletter/newsletter.tsx +5 -1
- package/src/components/_components/newsletter/social-icons.tsx +1 -1
- package/src/components/_components/page-sidenav/grocery-side-nav/components/link-item.tsx +2 -2
- package/src/components/_components/page-sidenav/grocery-side-nav/components/list-item.tsx +2 -2
- package/src/components/_components/page-sidenav/grocery-side-nav/components/nav-accordion.tsx +2 -2
- package/src/components/_components/page-sidenav/grocery-side-nav/grocery-side-nav.tsx +3 -3
- package/src/components/_components/page-sidenav/health-beauty-side-nav/components/list-item.tsx +2 -2
- package/src/components/_components/page-sidenav/health-beauty-side-nav/components/nav-accordion.tsx +2 -2
- package/src/components/_components/page-sidenav/health-beauty-side-nav/components/render-child.tsx +2 -2
- package/src/components/_components/page-sidenav/health-beauty-side-nav/health-beauty-side-nav.tsx +5 -5
- package/src/components/_components/page-sidenav/side-navbar/components/list-item.tsx +1 -1
- package/src/components/_components/page-sidenav/side-navbar/components/nav-accordion.tsx +3 -3
- package/src/components/_components/page-sidenav/side-navbar/components/render-child.tsx +1 -1
- package/src/components/_components/page-sidenav/side-navbar/side-nav-bar.tsx +4 -4
- package/src/components/_components/page-sidenav/side-navbar-2/components/sidebar-accordion.tsx +1 -1
- package/src/components/_components/page-sidenav/side-navbar-2/side-navbar-2.tsx +2 -2
- package/src/components/_components/product-cards/product-card-1/components/quantity-buttons.tsx +2 -2
- package/src/components/_components/product-cards/product-card-1/product-card.tsx +2 -2
- package/src/components/_components/product-cards/product-card-10/product-card.tsx +9 -5
- package/src/components/_components/product-cards/product-card-11/product-card.tsx +6 -3
- package/src/components/_components/product-cards/product-card-12/product-card.tsx +4 -4
- package/src/components/_components/product-cards/product-card-13/product-card.tsx +6 -3
- package/src/components/_components/product-cards/product-card-14/product-card.tsx +7 -4
- package/src/components/_components/product-cards/product-card-15/product-card.tsx +6 -3
- package/src/components/_components/product-cards/product-card-16/components/quantity-buttons.tsx +2 -2
- package/src/components/_components/product-cards/product-card-16/product-card.tsx +5 -2
- package/src/components/_components/product-cards/product-card-2/components/product-price.tsx +2 -2
- package/src/components/_components/product-cards/product-card-2/product-card.tsx +4 -4
- package/src/components/_components/product-cards/product-card-3/components/hover-actions.tsx +1 -1
- package/src/components/_components/product-cards/product-card-3/product-card.tsx +2 -2
- package/src/components/_components/product-cards/product-card-4/components/hover-actions.tsx +1 -1
- package/src/components/_components/product-cards/product-card-4/product-card.tsx +2 -2
- package/src/components/_components/product-cards/product-card-5/components/hover-actions.tsx +1 -1
- package/src/components/_components/product-cards/product-card-5/product-card.tsx +2 -2
- package/src/components/_components/product-cards/product-card-6/components/hover-actions.tsx +1 -1
- package/src/components/_components/product-cards/product-card-6/product-card.tsx +3 -3
- package/src/components/_components/product-cards/product-card-7/components/quantity-buttons.tsx +2 -2
- package/src/components/_components/product-cards/product-card-7/product-card.tsx +5 -2
- package/src/components/_components/product-cards/product-card-8/product-card.tsx +9 -5
- package/src/components/_components/product-cards/product-card-9/components/add-to-cart.tsx +5 -2
- package/src/components/_components/product-cards/product-card-9/product-card.tsx +1 -1
- package/src/components/_components/product-cards/product-price.tsx +2 -2
- package/src/components/_components/product-cards/product-rating.tsx +2 -2
- package/src/components/_components/product-cards/product-title.tsx +1 -1
- package/src/components/_components/product-cards/use-product.ts +1 -1
- package/src/components/_components/product-dimensions/product-dimensions.tsx +1 -1
- package/src/components/_components/product-quantity-buttons/product-quantity-buttons.tsx +2 -2
- package/src/components/_components/products-view/products-grid-view.tsx +2 -2
- package/src/components/_components/products-view/products-list-view.tsx +2 -2
- package/src/components/_components/search-box/components/category-dropdown.tsx +1 -1
- package/src/components/_components/search-box/components/search-result.tsx +1 -1
- package/src/components/_components/search-box/hooks/use-search.ts +1 -1
- package/src/components/_components/search-box/search-input-category.tsx +3 -3
- package/src/components/_components/service-cards/service-card-1/service-card-1.tsx +5 -2
- package/src/components/_components/service-cards/service-card-2/service-card-2.tsx +5 -2
- package/src/components/_components/service-cards/service-card-3/service-card-3.tsx +4 -1
- package/src/components/_components/settings/setting.tsx +3 -3
- package/src/components/_components/side-nav/side-nav.tsx +1 -1
- package/src/components/_components/stories/story-content/story-content.tsx +1 -1
- package/src/components/_components/stories/story-item/story-item.tsx +1 -1
- package/src/components/_components/topbar/top-bar.tsx +6 -3
- package/src/components/_components/wishlist-modal/wishlist-modal-item.tsx +1 -1
- package/src/components-v2/accordion/accordion-header.stories.tsx +28 -0
- package/src/components-v2/categories/category-list/category-list.tsx +2 -2
- package/src/components-v2/categories/category-list/styles.ts +3 -2
- package/src/components-v2/categories/mega-menu/column-list.tsx +1 -1
- package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +6 -3
- package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +2 -2
- package/src/components-v2/header/__tests__/user.test.tsx +12 -12
- package/src/components-v2/header/components/user.tsx +12 -11
- package/src/components-v2/mini-cart/mini-cart.tsx +9 -14
- package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +1 -1
- package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +2 -2
- package/src/components-v2/product-cards/favorite-button.tsx +52 -0
- package/src/components-v2/product-cards/product-card/product-card.tsx +87 -47
- package/src/components-v2/product-cards/product-card-plp/product-card.tsx +140 -51
- package/src/components-v2/product-cards/product-card-plp/styles/index.ts +17 -0
- package/src/components-v2/product-cards/product-card-plp-list/product-card.tsx +76 -42
- package/src/components-v2/product-cards/product-card-search/product-card.tsx +50 -21
- package/src/components-v2/product-cards/product-card-search/styles/index.ts +0 -10
- package/src/components-v2/product-dialog/compound/product-dialog.tsx +39 -15
- package/src/components-v2/product-quantity-buttons/compound/quantity-buttons-root.tsx +22 -7
- package/src/components-v2/product-quantity-variants/index.tsx +1 -1
- package/src/components-v2/products-view/compound/context.ts +46 -1
- package/src/components-v2/products-view/compound/products-grid-view.tsx +23 -14
- package/src/components-v2/products-view/compound/products-list-view.tsx +12 -3
- package/src/components-v2/search-bar/compound/context.ts +24 -3
- package/src/components-v2/search-bar/compound/results-item-lg.tsx +14 -13
- package/src/components-v2/search-bar/compound/results-item-sm.tsx +5 -5
- package/src/components-v2/search-bar/compound/results-suspense.tsx +3 -3
- package/src/components-v2/search-bar/compound/results.tsx +4 -4
- package/src/components-v2/search-bar/compound/textfield-adornment-category.tsx +1 -1
- package/src/components-v2/search-bar/compound/textfield.tsx +3 -3
- package/src/components-v2/search-bar/hooks/use-click-outside.ts +1 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/add-to-wishlist-button.tsx +2 -6
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +6 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-dialog.tsx +22 -15
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-list.tsx +8 -7
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/context.ts +8 -8
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +29 -19
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/hooks/use-add-to-wishlist.ts +27 -77
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/index.tsx +1 -9
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-bottom-ui.tsx +7 -2
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-dialog.tsx +20 -12
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-form.tsx +25 -5
- package/src/hooks/use-cart.ts +11 -14
- package/src/hooks/use-favorite.ts +17 -0
- package/src/hooks/use-variants.ts +4 -3
- package/src/pages/account/addresses/address-item.tsx +1 -1
- package/src/pages/account/dashboard-header.tsx +3 -3
- package/src/pages/account/navigation.tsx +5 -2
- package/src/pages/account/no-records.tsx +1 -1
- package/src/pages/account/orders/order-progress.tsx +5 -2
- package/src/pages/account/orders/order-row.tsx +4 -1
- package/src/pages/account/orders/order-summary.tsx +6 -2
- package/src/pages/account/orders/ordered-products.tsx +9 -2
- package/src/pages/account/profile/user-info.tsx +5 -2
- package/src/pages/account/wishlist/create-new-list.tsx +1 -1
- package/src/pages/account/wishlist/wishlist-item.tsx +2 -2
- package/src/pages/checkout/checkout-alt-form/address-card.tsx +5 -2
- package/src/pages/checkout/checkout-alt-form/checkout-step.tsx +3 -3
- package/src/pages/checkout/checkout-alt-form/customer-information.tsx +1 -1
- package/src/pages/checkout/checkout-alt-form/delivery-address.tsx +5 -1
- package/src/pages/checkout/checkout-alt-form/delivery-options.tsx +6 -2
- package/src/pages/checkout/checkout-alt-form/edit-address-form.tsx +1 -1
- package/src/pages/checkout/checkout-alt-form/heading.tsx +2 -2
- package/src/pages/checkout/checkout-alt-form/new-address-form.tsx +9 -4
- package/src/pages/checkout/checkout-alt-form/payment-details.tsx +6 -3
- package/src/pages/checkout/checkout-alt-summary/cart-item.tsx +5 -2
- package/src/pages/checkout/checkout-alt-summary/checkout-alt-summary.tsx +4 -2
- package/src/pages/checkout/checkout-alt-summary/list-item.tsx +2 -2
- package/src/pages/confirmation/address.tsx +4 -1
- package/src/pages/confirmation/confirmation-summary.tsx +6 -3
- package/src/pages/confirmation/ordered-products.tsx +9 -2
- package/src/pages/product-details/available-shops.tsx +5 -2
- package/src/pages/product-details/bopis/find-in-store-modal.tsx +1 -1
- package/src/pages/product-details/bopis/pickup-option-select.tsx +1 -1
- package/src/pages/product-details/frequently-bought.tsx +9 -2
- package/src/pages/product-details/frequently-product-card.tsx +8 -5
- package/src/pages/product-details/product-comment.tsx +7 -2
- package/src/pages/product-details/product-description.tsx +1 -1
- package/src/pages/product-details/product-filter-card.tsx +11 -3
- package/src/pages/product-details/product-intro/product-intro-images.tsx +4 -1
- package/src/pages/product-details/product-intro/product-intro.tsx +8 -5
- package/src/pages/product-details/product-review.tsx +5 -2
- package/src/pages/product-details/related-products.tsx +2 -2
- package/src/pages/product-list/facet-group.tsx +1 -1
- package/src/pages/product-list/list-filter.tsx +5 -2
- package/src/pages/product-list/pagination.tsx +1 -1
- package/src/pages/product-list/quick-view-dialog-content.tsx +2 -2
- package/src/pages/product-list/selected-facets.tsx +1 -1
- package/src/pages/quickorder/order-upload.tsx +1 -1
- package/src/pages/quickorder/quick-order-form.tsx +6 -3
- package/src/pages/quickorder/quick-order-row.tsx +1 -1
- package/src/pages-v2/account/account-navigation.tsx +1 -1
- package/src/pages-v2/account/orders/order-summary.tsx +5 -2
- package/src/pages-v2/account/profile/user-info.tsx +6 -3
- package/src/pages-v2/account/wishlist/wishlist-item.tsx +1 -1
- package/src/pages-v2/cart/__tests__/checkout-form.test.tsx +1 -1
- package/src/pages-v2/cart/estimate-shipping.tsx +3 -0
- package/src/pages-v2/checkout/checkout-alt-form/checkout-step.tsx +4 -4
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/address-card.tsx +1 -1
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/delivery-address.tsx +12 -5
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/new-address-form.tsx +27 -5
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/styles.ts +2 -1
- package/src/pages-v2/checkout/checkout-alt-form/steps/customer-info/customer-information.tsx +27 -7
- package/src/pages-v2/checkout/checkout-alt-form/steps/shipping/delivery-options.tsx +8 -1
- package/src/pages-v2/confirmation/address.tsx +5 -1
- package/src/pages-v2/product-details/available-shops.tsx +4 -1
- package/src/pages-v2/product-details/bopis/find-in-store-button.tsx +1 -1
- package/src/pages-v2/product-details/bopis/find-in-store-modal.tsx +3 -5
- package/src/pages-v2/product-details/product-intro/compound/context.ts +69 -12
- package/src/pages-v2/product-details/product-intro/compound/product-info.tsx +73 -27
- package/src/pages-v2/product-details/product-intro/compound/product-intro-images.tsx +19 -6
- package/src/pages-v2/product-details/product-intro/utils.ts +2 -2
- package/src/pages-v2/product-details/product-tabs.tsx +19 -4
- package/src/pages-v2/product-details/related-products.tsx +3 -3
- package/src/pages-v2/quickorder/context.ts +2 -2
- package/src/pages-v2/quickorder/order-upload.tsx +6 -2
- package/src/pages-v2/quickorder/provider.tsx +24 -9
- package/src/pages-v2/quickorder/quick-order-actions.tsx +2 -2
- package/src/pages-v2/quickorder/quick-order-header.tsx +6 -3
- package/src/pages-v2/quickorder/quick-order-row.tsx +1 -1
- package/src/pages-v2/quickorder/quick-order-table.tsx +10 -4
- package/src/pages-v2/quickorder/quick-order-upload.tsx +2 -2
- package/src/stories/Button.stories.ts +54 -0
- package/src/stories/Button.tsx +35 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.stories.ts +34 -0
- package/src/stories/Header.tsx +54 -0
- package/src/stories/Page.stories.ts +33 -0
- package/src/stories/Page.tsx +73 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/button.css +30 -0
- package/src/stories/header.css +32 -0
- package/src/stories/page.css +68 -0
- package/src/theme/build-mui-theme.ts +104 -0
- package/src/theme/components.ts +163 -0
- package/src/theme/emotion-cache.tsx +101 -0
- package/src/theme/theme-colors.ts +205 -0
- package/src/theme/theme-options-sample.ts +69 -0
- package/src/theme/theme-options.ts +172 -0
- package/src/theme/theme-provider.tsx +44 -0
- package/src/theme/typography.ts +22 -0
- package/src/theme/utils.ts +17 -0
- package/tsconfig.json +3 -1
- package/src/api-manager/lib/cart-cookie-handler.ts +0 -14
- package/src/components-v2/product-cards/product-card/components/hover-actions.tsx +0 -37
- package/src/components-v2/product-cards/product-card-plp/components/quantity-buttons.tsx +0 -54
- package/src/components-v2/product-cards/product-card-plp-list/components/add-to-cart.tsx +0 -63
- package/src/components-v2/product-cards/product-card-plp-list/components/favorite-button.tsx +0 -27
- package/src/components-v2/product-cards/use-product.ts +0 -35
- package/src/components-v2/products-view/products-grid-view.tsx +0 -65
- package/src/components-v2/products-view/products-list-view.tsx +0 -66
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/context.ts +0 -2
- /package/src/components-v2/product-cards/{product-card/components/quantity-buttons.tsx → quantity-buttons.tsx} +0 -0
|
@@ -26,6 +26,7 @@ const mutex = new Mutex();
|
|
|
26
26
|
* @param route the route to the corresponding route handler
|
|
27
27
|
* @param apiManagerPath a tuple of two items, entity name and method
|
|
28
28
|
* @param options.disableProperty if these input properties are undefined then disable query
|
|
29
|
+
* @param options.enabled raw enabled for certain use cases
|
|
29
30
|
* @returns
|
|
30
31
|
*/
|
|
31
32
|
export const createQuery = <TInput, TOutput>(
|
|
@@ -117,8 +118,11 @@ export const createQuery = <TInput, TOutput>(
|
|
|
117
118
|
* Client-side hook to call data from react query cache
|
|
118
119
|
* @returns
|
|
119
120
|
*/
|
|
120
|
-
const useData = (
|
|
121
|
-
|
|
121
|
+
const useData = (
|
|
122
|
+
input?: TInput,
|
|
123
|
+
options?: { enabled: boolean },
|
|
124
|
+
): UseQueryResult<TOutput> => {
|
|
125
|
+
return useQuery({ ...getQueryData(input), enabled: options?.enabled });
|
|
122
126
|
};
|
|
123
127
|
|
|
124
128
|
/**
|
|
@@ -153,8 +157,11 @@ export const createQuery = <TInput, TOutput>(
|
|
|
153
157
|
* TODO: need to fix this naming so we're properly shadowing
|
|
154
158
|
* the names of tanstack-query
|
|
155
159
|
*/
|
|
156
|
-
const getData = async (
|
|
157
|
-
|
|
160
|
+
const getData = async (
|
|
161
|
+
queryClient: QueryClient,
|
|
162
|
+
): Promise<TOutput | undefined> => {
|
|
163
|
+
const cacheKey = buildCacheKey();
|
|
164
|
+
return await queryClient.getQueryData(cacheKey);
|
|
158
165
|
};
|
|
159
166
|
|
|
160
167
|
/**
|
|
@@ -8,11 +8,10 @@ import {
|
|
|
8
8
|
const apiPath = createApiPath("product", "getInventory");
|
|
9
9
|
|
|
10
10
|
const getProductAvailability = createQuery<
|
|
11
|
-
InventorySearchCriteriaInput,
|
|
11
|
+
InventorySearchCriteriaInput | undefined | null,
|
|
12
12
|
ProductWarehouseInventoryInformation
|
|
13
13
|
>(apiPath, {
|
|
14
14
|
queryKey: "product-inventory",
|
|
15
|
-
disableProperties: ["searchCriteria"],
|
|
16
15
|
});
|
|
17
16
|
|
|
18
17
|
export default getProductAvailability;
|
|
@@ -25,13 +25,13 @@ const useAddToWishlist = () => {
|
|
|
25
25
|
// https://tanstack.com/query/latest/docs/reference/QueryClient
|
|
26
26
|
await queryClient.cancelQueries({ queryKey: [getWishlistsQueryKey] });
|
|
27
27
|
const previousWishlists = await getWishlists.getData(queryClient);
|
|
28
|
-
const optimisticData = previousWishlists
|
|
28
|
+
const optimisticData = previousWishlists?.map((list) => {
|
|
29
29
|
if (list.Id === input.Id) {
|
|
30
30
|
// Add the input product line to list
|
|
31
31
|
return {
|
|
32
32
|
...list,
|
|
33
33
|
ProductListLines: [
|
|
34
|
-
...list
|
|
34
|
+
...(list?.ProductListLines ?? []),
|
|
35
35
|
{ ProductId: input.ProductListLines[0].ProductId },
|
|
36
36
|
],
|
|
37
37
|
};
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "@/api-manager/schemas/user.schema";
|
|
6
6
|
import { createApiPath } from "@/api-manager/services/create-query";
|
|
7
7
|
import { useCreateMutation } from "@/api-manager/services/create-mutation";
|
|
8
|
+
import { WISHLIST_DETAILS_QUERY_KEY } from "@/api-manager/services/user/queries/get-wishlist-details";
|
|
8
9
|
|
|
9
10
|
const apiPath = createApiPath("user", "copyCartToWishlist");
|
|
10
11
|
|
|
@@ -14,7 +15,7 @@ const useCopyCartToWishlist = () => {
|
|
|
14
15
|
return useCreateMutation<CopyCartToWishlistInput, Wishlist>(apiPath, {
|
|
15
16
|
onSuccess: (_data, _variables) => {
|
|
16
17
|
queryClient.invalidateQueries({
|
|
17
|
-
queryKey: [
|
|
18
|
+
queryKey: [WISHLIST_DETAILS_QUERY_KEY, { Id: _variables.Id }],
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
21
|
});
|
|
@@ -2,7 +2,7 @@ import { useQueryClient } from "@tanstack/react-query";
|
|
|
2
2
|
import { WishlistLinesInput } from "@/api-manager/schemas/user.schema";
|
|
3
3
|
import { createApiPath } from "@/api-manager/services/create-query";
|
|
4
4
|
import { useCreateMutation } from "@/api-manager/services/create-mutation";
|
|
5
|
-
import {
|
|
5
|
+
import { WISHLIST_DETAILS_QUERY_KEY } from "@/api-manager/services/user/queries/get-wishlist-details";
|
|
6
6
|
import getWishlists, {
|
|
7
7
|
getWishlistsQueryKey,
|
|
8
8
|
} from "@/api-manager/services/user/queries/get-wishlists";
|
|
@@ -15,7 +15,7 @@ const useRemoveFromWishlist = () => {
|
|
|
15
15
|
return useCreateMutation<WishlistLinesInput, void>(apiPath, {
|
|
16
16
|
onSuccess: (_data, _variables) => {
|
|
17
17
|
queryClient.invalidateQueries({
|
|
18
|
-
queryKey: [
|
|
18
|
+
queryKey: [WISHLIST_DETAILS_QUERY_KEY, { Id: _variables.Id }],
|
|
19
19
|
});
|
|
20
20
|
queryClient.invalidateQueries({
|
|
21
21
|
queryKey: [getWishlistsQueryKey],
|
|
@@ -26,12 +26,12 @@ const useRemoveFromWishlist = () => {
|
|
|
26
26
|
// https://tanstack.com/query/latest/docs/reference/QueryClient
|
|
27
27
|
await queryClient.cancelQueries({ queryKey: [getWishlistsQueryKey] });
|
|
28
28
|
const previousWishlists = await getWishlists.getData(queryClient);
|
|
29
|
-
const optimisticData = previousWishlists
|
|
29
|
+
const optimisticData = previousWishlists?.map((list) => {
|
|
30
30
|
if (list.Id === input.Id) {
|
|
31
31
|
// Remove the product line of our input id
|
|
32
32
|
return {
|
|
33
33
|
...list,
|
|
34
|
-
ProductListLines: list
|
|
34
|
+
ProductListLines: list?.ProductListLines?.filter(
|
|
35
35
|
(item) => item.ProductId !== input.ProductListLines[0].ProductId,
|
|
36
36
|
),
|
|
37
37
|
};
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from "@/api-manager/schemas/user.schema";
|
|
6
6
|
import { useCreateMutation } from "@/api-manager/services/create-mutation";
|
|
7
7
|
import { createApiPath } from "@/api-manager/services/create-query";
|
|
8
|
+
import { WISHLIST_DETAILS_QUERY_KEY } from "@/api-manager/services/user/queries/get-wishlist-details";
|
|
8
9
|
|
|
9
10
|
const apiPath = createApiPath("user", "updateWishlist");
|
|
10
11
|
|
|
@@ -14,7 +15,7 @@ const useUpdateWishlist = () => {
|
|
|
14
15
|
return useCreateMutation<WishlistLinesInput, Wishlist>(apiPath, {
|
|
15
16
|
onSuccess: (_data, _variables) => {
|
|
16
17
|
queryClient.invalidateQueries({
|
|
17
|
-
queryKey: [
|
|
18
|
+
queryKey: [WISHLIST_DETAILS_QUERY_KEY, { Id: _variables.Id }],
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
21
|
});
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
createQuery,
|
|
8
8
|
} from "@/api-manager/services/create-query";
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const WISHLIST_DETAILS_QUERY_KEY = "wishlist-details";
|
|
11
11
|
const apiPath = createApiPath("user", "getWishlistDetails");
|
|
12
12
|
|
|
13
13
|
const getWishListDetails = createQuery<WishlistDetailInput, ExtendedWishlist>(
|
|
14
14
|
apiPath,
|
|
15
15
|
{
|
|
16
|
-
queryKey:
|
|
16
|
+
queryKey: WISHLIST_DETAILS_QUERY_KEY,
|
|
17
17
|
},
|
|
18
18
|
);
|
|
19
19
|
|
|
@@ -8,7 +8,7 @@ import { Section } from "@evenicanpm/storefront-core/src/components-v2/section";
|
|
|
8
8
|
// CMS
|
|
9
9
|
import ProductCard from "@evenicanpm/storefront-core/src/components-v2/product-cards/product-card/product-card";
|
|
10
10
|
import { getImageUrl } from "@/cms/endpoints";
|
|
11
|
-
import getProductByIds from "
|
|
11
|
+
import getProductByIds from "@evenicanpm/storefront-core/src/api-manager/services/product/queries/get-product-by-ids";
|
|
12
12
|
import { SimpleProduct } from "@msdyn365-commerce/retail-proxy";
|
|
13
13
|
import { Product, ProductCarouselBlock } from "@/cms/blocks/interfaces";
|
|
14
14
|
|
|
@@ -75,8 +75,11 @@ export default function ProductCarousel(data: ProductCarouselBlock) {
|
|
|
75
75
|
<ProductCard.Price />
|
|
76
76
|
</ProductCard.Info>
|
|
77
77
|
<ProductCard.Actions>
|
|
78
|
-
<ProductCard.QuantityButtons />
|
|
79
|
-
<ProductCard.HoverActions
|
|
78
|
+
{/* <ProductCard.QuantityButtons /> */}
|
|
79
|
+
<ProductCard.HoverActions>
|
|
80
|
+
<ProductCard.QuickViewButton />
|
|
81
|
+
<ProductCard.FavoriteButton />
|
|
82
|
+
</ProductCard.HoverActions>
|
|
80
83
|
</ProductCard.Actions>
|
|
81
84
|
</ProductCard.Body>
|
|
82
85
|
</ProductCard>
|
|
@@ -17,8 +17,8 @@ import { currency } from "@/lib/lib";
|
|
|
17
17
|
import { getImageUrl } from "@/cms/endpoints";
|
|
18
18
|
|
|
19
19
|
// API
|
|
20
|
-
import getProductByIds from "
|
|
21
|
-
import { getQueryClient } from "
|
|
20
|
+
import getProductByIds from "@evenicanpm/storefront-core/src/api-manager/services/product/queries/get-product-by-ids";
|
|
21
|
+
import { getQueryClient } from "@evenicanpm/storefront-core/src/api-manager/services/get-query-client";
|
|
22
22
|
import buildDetailUrl from "@/lib/build-detail-url";
|
|
23
23
|
|
|
24
24
|
import {
|
|
@@ -49,8 +49,11 @@ export default function ProductGridList({ products, heading }: Props) {
|
|
|
49
49
|
<ProductCard.Price />
|
|
50
50
|
</ProductCard.Info>
|
|
51
51
|
<ProductCard.Actions>
|
|
52
|
-
<ProductCard.QuantityButtons />
|
|
53
|
-
<ProductCard.HoverActions
|
|
52
|
+
{/* <ProductCard.QuantityButtons /> */}
|
|
53
|
+
<ProductCard.HoverActions>
|
|
54
|
+
<ProductCard.QuickViewButton />
|
|
55
|
+
<ProductCard.FavoriteButton />
|
|
56
|
+
</ProductCard.HoverActions>
|
|
54
57
|
</ProductCard.Actions>
|
|
55
58
|
</ProductCard.Body>
|
|
56
59
|
</ProductCard>
|
|
@@ -40,13 +40,13 @@ export interface CmsNavRelated {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export interface CmsNavItem {
|
|
43
|
-
title
|
|
44
|
-
menuAttached
|
|
45
|
-
path
|
|
46
|
-
type
|
|
47
|
-
uiRouterKey
|
|
48
|
-
slug
|
|
49
|
-
related
|
|
50
|
-
external
|
|
51
|
-
items
|
|
43
|
+
title: string;
|
|
44
|
+
menuAttached: boolean;
|
|
45
|
+
path: string;
|
|
46
|
+
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
47
|
+
uiRouterKey: string;
|
|
48
|
+
slug: string;
|
|
49
|
+
related: CmsNavRelated | null;
|
|
50
|
+
external: boolean;
|
|
51
|
+
items: CmsNavItem[];
|
|
52
52
|
}
|
|
@@ -7,9 +7,9 @@ import NextLink from "next/link";
|
|
|
7
7
|
import CategoryIcon from "../../Icons/Components/Category";
|
|
8
8
|
|
|
9
9
|
// GLOBAL CUSTOM COMPONENT
|
|
10
|
-
import BazaarCard from "
|
|
11
|
-
import { Carousel } from "
|
|
12
|
-
import { SectionCreator } from "
|
|
10
|
+
import BazaarCard from "@evenicanpm/storefront-core/src/components/_components/BazaarCard";
|
|
11
|
+
import { Carousel } from "@evenicanpm/storefront-core/src/components/_components/carousel/index";
|
|
12
|
+
import { SectionCreator } from "@evenicanpm/storefront-core/src/components/_components/section-header/index";
|
|
13
13
|
|
|
14
14
|
// LOCAL CUSTOM COMPONENT
|
|
15
15
|
import TopCategoriesCard from "../shared/top-categories-card";
|
|
@@ -4,8 +4,8 @@ import React from "react";
|
|
|
4
4
|
import { Box, Container } from "@mui/material";
|
|
5
5
|
|
|
6
6
|
// GLOBAL CUSTOM COMPONENTS
|
|
7
|
-
import { Carousel } from "
|
|
8
|
-
import CarouselCard1 from "
|
|
7
|
+
import { Carousel } from "@evenicanpm/storefront-core/src/components/_components/carousel/index";
|
|
8
|
+
import CarouselCard1 from "@evenicanpm/storefront-core/src/components/_components/carousel-cards/carousel-card-1/index";
|
|
9
9
|
|
|
10
10
|
import { getImageUrl } from "@/cms/endpoints";
|
|
11
11
|
import { HeroCarouselBlock, Slide } from "../../interfaces";
|
|
@@ -6,16 +6,16 @@ import { Light } from "../../Icons/index";
|
|
|
6
6
|
import { Box } from "@mui/system";
|
|
7
7
|
|
|
8
8
|
// GLOBAL COMPONENTS
|
|
9
|
-
import { Carousel } from "
|
|
10
|
-
import { SectionCreator } from "
|
|
11
|
-
import ProductCard1Wrapper from "
|
|
9
|
+
import { Carousel } from "@evenicanpm/storefront-core/src/components/_components/carousel/index";
|
|
10
|
+
import { SectionCreator } from "@evenicanpm/storefront-core/src/components/_components/section-header/index";
|
|
11
|
+
import ProductCard1Wrapper from "@evenicanpm/storefront-core/src/components/_components/product-cards/product-card-1/product-card-1-wrapper";
|
|
12
12
|
|
|
13
13
|
// CMS
|
|
14
14
|
import { getImageUrl } from "@/cms/endpoints";
|
|
15
15
|
|
|
16
16
|
// API
|
|
17
|
-
import getProductByIds from "
|
|
18
|
-
import { getQueryClient } from "
|
|
17
|
+
import getProductByIds from "@evenicanpm/storefront-core/src/api-manager/services/product/queries/get-product-by-ids";
|
|
18
|
+
import { getQueryClient } from "@evenicanpm/storefront-core/src/api-manager/services/get-query-client";
|
|
19
19
|
import { SimpleProduct } from "@msdyn365-commerce/retail-proxy";
|
|
20
20
|
import { Product, ProductCarouselBlock } from "../../interfaces";
|
|
21
21
|
|
|
@@ -7,18 +7,18 @@ import { getIcon } from "../../Icons/index";
|
|
|
7
7
|
|
|
8
8
|
// Components
|
|
9
9
|
import Grid from "@mui/material/Grid2";
|
|
10
|
-
import HoverBox from "
|
|
11
|
-
import { H4 } from "
|
|
12
|
-
import BazaarCard from "
|
|
13
|
-
import { SectionCreator } from "
|
|
10
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/_components/HoverBox";
|
|
11
|
+
import { H4 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
12
|
+
import BazaarCard from "@evenicanpm/storefront-core/src/components/_components/BazaarCard";
|
|
13
|
+
import { SectionCreator } from "@evenicanpm/storefront-core/src/components/_components/section-header/index";
|
|
14
14
|
|
|
15
15
|
// Utils
|
|
16
16
|
import { currency } from "@/lib/lib";
|
|
17
17
|
import { getImageUrl } from "@/cms/endpoints";
|
|
18
18
|
|
|
19
19
|
// API
|
|
20
|
-
import getProductByIds from "
|
|
21
|
-
import { getQueryClient } from "
|
|
20
|
+
import getProductByIds from "@evenicanpm/storefront-core/src/api-manager/services/product/queries/get-product-by-ids";
|
|
21
|
+
import { getQueryClient } from "@evenicanpm/storefront-core/src/api-manager/services/get-query-client";
|
|
22
22
|
import buildDetailUrl from "@/lib/build-detail-url";
|
|
23
23
|
|
|
24
24
|
import {
|
|
@@ -10,7 +10,10 @@ import styled from "@mui/material/styles/styled";
|
|
|
10
10
|
import { getIcon } from "../../Icons/index";
|
|
11
11
|
|
|
12
12
|
// GLOBAL CUSTOM COMPONENTS
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
H4,
|
|
15
|
+
Span,
|
|
16
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
14
17
|
|
|
15
18
|
// CUSTOM DATA MODEL
|
|
16
19
|
interface Service {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
// GLOBAL CUSTOM COMPONENTS
|
|
3
|
-
import HoverBox from "
|
|
4
|
-
import { H4 } from "
|
|
3
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/_components/HoverBox";
|
|
4
|
+
import { H4 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
5
5
|
import Image from "@/components/Shared/Image";
|
|
6
6
|
|
|
7
7
|
// ==========================================================
|
|
@@ -2,9 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { HtmlHTMLAttributes } from "react";
|
|
3
3
|
import { styled, SxProps, Theme } from "@mui/material/styles";
|
|
4
4
|
// GLOBAL CUSTOM COMPONENTS
|
|
5
|
-
import { H4 } from "
|
|
6
|
-
import BazaarCard from "
|
|
7
|
-
import BazaarImage from "
|
|
5
|
+
import { H4 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
6
|
+
import BazaarCard from "@evenicanpm/storefront-core/src/components/_components/BazaarCard";
|
|
7
|
+
import BazaarImage from "@evenicanpm/storefront-core/src/components/_components/BazaarImage";
|
|
8
8
|
|
|
9
9
|
// STYLED COMPONENT
|
|
10
10
|
const StyledBazaarCard = styled(BazaarCard)(({ theme }) => ({
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import Box from "@mui/material/Box";
|
|
3
3
|
import Grid from "@mui/material/Grid2";
|
|
4
4
|
// GLOBAL CUSTOM COMPONENTS
|
|
5
|
-
import { SectionHeader } from "
|
|
6
|
-
import ProductCard1 from "
|
|
5
|
+
import { SectionHeader } from "@evenicanpm/storefront-core/src/components/_components/section-header/index";
|
|
6
|
+
import ProductCard1 from "@evenicanpm/storefront-core/src/components/_components/product-cards/product-card-1/index";
|
|
7
7
|
// CUSTOM DATA MODEL
|
|
8
8
|
|
|
9
9
|
interface Product {
|
|
@@ -5,7 +5,7 @@ import Chip from "@mui/material/Chip";
|
|
|
5
5
|
import styled from "@mui/material/styles/styled";
|
|
6
6
|
import Image from "@/components/Shared/Image";
|
|
7
7
|
// GLOBAL CUSTOM COMPONENTS
|
|
8
|
-
import HoverBox from "
|
|
8
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/_components/HoverBox";
|
|
9
9
|
import { lightOrDarkText } from "@/lib/hexToLuma";
|
|
10
10
|
import { useTheme } from "@mui/material/styles";
|
|
11
11
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Rating from "@mui/material/Rating";
|
|
3
3
|
// GLOBAL CUSTOM COMPONENTS
|
|
4
|
-
import HoverBox from "
|
|
4
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/_components/HoverBox";
|
|
5
5
|
import Image from "@/components/Shared/Image";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
H4,
|
|
8
|
+
Small,
|
|
9
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
10
|
+
import { FlexRowCenter } from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
8
11
|
// CUSTOM UTILS LIBRARY FUNCTION
|
|
9
12
|
import { currency } from "@/lib/lib";
|
|
10
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Fragment } from "react";
|
|
2
|
-
import FlexBox from "
|
|
2
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-box";
|
|
3
3
|
import { MdFacebook as Facebook } from "react-icons/md";
|
|
4
4
|
import { Link } from "react-router-dom";
|
|
5
5
|
import { Box } from "@mui/material";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Heading } from "../styles/index";
|
|
3
|
-
import { Paragraph } from "
|
|
3
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
4
4
|
import Grid from "@mui/material/Grid2";
|
|
5
5
|
import SocialLinks from "./FooterSocialLinks";
|
|
6
6
|
import { SocialLink } from "../interfaces";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import Grid from "@mui/material/Grid2";
|
|
5
|
-
import { Paragraph } from "
|
|
6
|
-
import SiteLogo from "
|
|
5
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
6
|
+
import SiteLogo from "@evenicanpm/storefront-core/src/components/_components/site-logo";
|
|
7
7
|
import useTheme from "@mui/material/styles/useTheme";
|
|
8
8
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ import { FaTwitter as Twitter } from "react-icons/fa";
|
|
|
11
11
|
import { FaInstagram as Instagram } from "react-icons/fa";
|
|
12
12
|
|
|
13
13
|
// Custom Components
|
|
14
|
-
import FlexBox from "
|
|
14
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-box";
|
|
15
15
|
import { SocialLink } from "../interfaces";
|
|
16
16
|
|
|
17
17
|
// Styled Components
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// DUPLICATE - Remove storefront/app version
|
|
3
3
|
import React, { useState } from "react";
|
|
4
4
|
import { MdOutlineShoppingBag as ShoppingBagOutlined } from "react-icons/md";
|
|
5
|
-
import MobileCartBag from "
|
|
5
|
+
import MobileCartBag from "@evenicanpm/storefront-core/src/components/_components/icons/cart-bag";
|
|
6
6
|
import { Badge, Drawer, IconButton } from "@mui/material";
|
|
7
7
|
import { Cart } from "@/schemas/cart.schema";
|
|
8
8
|
import { useNotification } from "@evenicanpm/storefront-core/src/providers/notifications/use-notification";
|
|
9
|
-
import { MiniCart } from "
|
|
9
|
+
import { MiniCart } from "@evenicanpm/storefront-core/src/components/_components/mini-cart/index";
|
|
10
10
|
|
|
11
11
|
const BADGE_STYLES = {
|
|
12
12
|
"& .MuiBadge-badge": {
|
|
@@ -4,7 +4,7 @@ import { styled, SxProps, Theme } from "@mui/material/styles";
|
|
|
4
4
|
// MUI ICON COMPONENTS
|
|
5
5
|
import ChevronRight from "@mui/icons-material/ChevronRight";
|
|
6
6
|
// GLOBAL CUSTOM COMPONENT
|
|
7
|
-
import FlexBox from "
|
|
7
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-box";
|
|
8
8
|
|
|
9
9
|
// STYLED COMPONENT
|
|
10
10
|
const RootContainer = styled(FlexBox, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Grid from "@mui/material/Grid2";
|
|
2
2
|
import Button from "@mui/material/Button";
|
|
3
3
|
// GLOBAL CUSTOM COMPONENTS
|
|
4
|
-
import BazaarImage from "
|
|
5
|
-
import { Paragraph } from "
|
|
4
|
+
import BazaarImage from "@evenicanpm/storefront-core/src/components/_components/BazaarImage";
|
|
5
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
6
6
|
// STYLED COMPONENT
|
|
7
7
|
import { StyledRoot } from "./styles";
|
|
8
8
|
|
|
@@ -3,10 +3,15 @@ import Button from "@mui/material/Button";
|
|
|
3
3
|
// MUI ICON COMPONENT
|
|
4
4
|
import Favorite from "@mui/icons-material/Favorite";
|
|
5
5
|
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
-
import BazaarImage from "
|
|
7
|
-
import { Countdown } from "
|
|
8
|
-
import FlexBox from "
|
|
9
|
-
import {
|
|
6
|
+
import BazaarImage from "@evenicanpm/storefront-core/src/components/_components/BazaarImage";
|
|
7
|
+
import { Countdown } from "@evenicanpm/storefront-core/src/components/_components/countdown/index";
|
|
8
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-box";
|
|
9
|
+
import {
|
|
10
|
+
H2,
|
|
11
|
+
H3,
|
|
12
|
+
H4,
|
|
13
|
+
Paragraph,
|
|
14
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
10
15
|
// STYLED COMPONENT
|
|
11
16
|
import { ContentWrapper, FavoriteButton } from "./styles";
|
|
12
17
|
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import Link from "next/link";
|
|
2
2
|
// GLOBAL CUSTOM COMPONENTS
|
|
3
|
-
import BazaarImage from "
|
|
4
|
-
import {
|
|
3
|
+
import BazaarImage from "@evenicanpm/storefront-core/src/components/_components/BazaarImage";
|
|
4
|
+
import {
|
|
5
|
+
H2,
|
|
6
|
+
Paragraph,
|
|
7
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
5
8
|
// STYLED COMPONENTS
|
|
6
9
|
import { ContentWrapper, LinkText, RootStyled } from "./styles";
|
|
7
10
|
// CUSTOM DATA MODEL
|
|
8
|
-
import { Product } from "
|
|
11
|
+
import { Product } from "@evenicanpm/storefront-core/src/components/_components/bazaar-types";
|
|
9
12
|
|
|
10
13
|
// ==========================================================
|
|
11
14
|
type Props = { product: Product };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import Link from "next/link";
|
|
2
2
|
import Button from "@mui/material/Button";
|
|
3
3
|
// GLOBAL CUSTOM COMPONENTS
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
H1,
|
|
6
|
+
H4,
|
|
7
|
+
Paragraph,
|
|
8
|
+
Span,
|
|
9
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
5
10
|
// STYLED COMPONENT
|
|
6
11
|
import { CardWrapper } from "./styles";
|
|
7
12
|
|
|
@@ -2,10 +2,10 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import CategoryListItem from "../category-list-item/index";
|
|
3
3
|
import { StyledRoot, SubMenuStyledRoot } from "./styles";
|
|
4
4
|
import { Props } from "./types";
|
|
5
|
-
import getCategories from "
|
|
5
|
+
import getCategories from "@evenicanpm/storefront-core/src/api-manager/services/categories/queries/get-categories";
|
|
6
6
|
import { CategoryHierarchy } from "@/lib/category-helpers";
|
|
7
|
-
import MegaMenu1 from "
|
|
8
|
-
import MegaMenu2 from "
|
|
7
|
+
import MegaMenu1 from "@evenicanpm/storefront-core/src/components/_components/categories/mega-menu/mega-menu-1";
|
|
8
|
+
import MegaMenu2 from "@evenicanpm/storefront-core/src/components/_components/categories/mega-menu/mega-menu-2";
|
|
9
9
|
|
|
10
10
|
type MegaMenuType = "default" | "mega-menu-1" | "mega-menu-2";
|
|
11
11
|
|
|
@@ -2,9 +2,13 @@ import Link from "next/link";
|
|
|
2
2
|
import Box from "@mui/material/Box";
|
|
3
3
|
import Grid from "@mui/material/Grid2";
|
|
4
4
|
// GLOBAL CUSTOM COMPONENTS
|
|
5
|
-
import LazyImage from "
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components/_components/LazyImage";
|
|
6
|
+
import {
|
|
7
|
+
H3,
|
|
8
|
+
Paragraph,
|
|
9
|
+
Small,
|
|
10
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
11
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-box";
|
|
8
12
|
|
|
9
13
|
export default function OfferBanner() {
|
|
10
14
|
return (
|
|
@@ -4,9 +4,9 @@ import Link from "next/link";
|
|
|
4
4
|
import Box from "@mui/material/Box";
|
|
5
5
|
import Grid from "@mui/material/Grid2";
|
|
6
6
|
// GLOBAL CUSTOM COMPONENTS
|
|
7
|
-
import LazyImage from "
|
|
8
|
-
import { FlexBox } from "
|
|
9
|
-
import { NavLink } from "
|
|
7
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components/_components/LazyImage";
|
|
8
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
9
|
+
import { NavLink } from "@evenicanpm/storefront-core/src/components/_components/nav-link/index";
|
|
10
10
|
// STYLED COMPONENTS
|
|
11
11
|
import { StyledRoot } from "./styles";
|
|
12
12
|
// DATA TYPES
|
|
@@ -2,7 +2,7 @@ import Link from "next/link";
|
|
|
2
2
|
// MUI
|
|
3
3
|
import Box from "@mui/material/Box";
|
|
4
4
|
// GLOBAL CUSTOM COMPONENTS
|
|
5
|
-
import LazyImage from "
|
|
5
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components/_components/LazyImage";
|
|
6
6
|
// LOCAL CUSTOM COMPONENTS
|
|
7
7
|
import ColumnList from "./column-list";
|
|
8
8
|
// DATA TYPE
|
|
@@ -27,7 +27,7 @@ export default function MegaMenu1({ banner, data }: Props) {
|
|
|
27
27
|
fill
|
|
28
28
|
alt="banner"
|
|
29
29
|
src={banner.url}
|
|
30
|
-
|
|
30
|
+
style={{ objectFit: "cover", objectPosition: "center center" }}
|
|
31
31
|
/>
|
|
32
32
|
</Box>
|
|
33
33
|
</Link>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// GLOBAL CUSTOM COMPONENTS
|
|
2
|
-
import { H4 } from "
|
|
3
|
-
import LazyImage from "
|
|
2
|
+
import { H4 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
3
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components/_components/LazyImage";
|
|
4
4
|
// STYLED COMPONENTS
|
|
5
5
|
import { CategoryTitle, Wrapper } from "./styles";
|
|
6
6
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
H3,
|
|
3
|
+
Span,
|
|
4
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
2
5
|
|
|
3
6
|
// ==============================================================
|
|
4
7
|
type Props = { digit: number; title: string };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
// GLOBAL CUSTOM COMPONENT
|
|
4
|
-
import FlexBetween from "
|
|
4
|
+
import FlexBetween from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-between";
|
|
5
5
|
// Local CUSTOM COMPONENT
|
|
6
6
|
import CountBox from "./count-box";
|
|
7
7
|
import useCountDown from "./useCountDown";
|