@evenicanpm/storefront-core 1.0.6 → 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-header.tsx +4 -1
- package/src/pages-v2/quickorder/quick-order-row.tsx +1 -1
- package/src/pages-v2/quickorder/quick-order-table.tsx +9 -3
- 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
|
@@ -7,7 +7,7 @@ import DialogContent from "@mui/material/DialogContent";
|
|
|
7
7
|
import { useFormik } from "formik";
|
|
8
8
|
import * as yup from "yup";
|
|
9
9
|
// GLOBAL CUSTOM COMPONENT
|
|
10
|
-
import { H5 } from "
|
|
10
|
+
import { H5 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
11
11
|
|
|
12
12
|
import { Address } from "./types";
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoxProps } from "@mui/material/Box";
|
|
2
2
|
import Avatar from "@mui/material/Avatar";
|
|
3
|
-
import { FlexBox } from "
|
|
4
|
-
import { Paragraph } from "
|
|
3
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
4
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
5
5
|
import { StepViewState } from "./checkout-step";
|
|
6
6
|
|
|
7
7
|
// ==============================================================
|
|
@@ -9,14 +9,14 @@ import { Controller, useForm } from "react-hook-form";
|
|
|
9
9
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
10
10
|
import z from "zod";
|
|
11
11
|
// LOCAL CUSTOM COMPONENT
|
|
12
|
-
import { H5 } from "
|
|
12
|
+
import { H5 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
13
13
|
import { Address } from "@/api-manager/schemas/address.schema";
|
|
14
14
|
import { useTranslations } from "use-intl";
|
|
15
15
|
import { Box, FormControl, InputLabel, MenuItem, Select } from "@mui/material";
|
|
16
16
|
import { CountryRegionInfo } from "@msdyn365-commerce/retail-proxy";
|
|
17
17
|
import getStates from "@/api-manager/services/address/queries/get-states";
|
|
18
|
-
import { Paragraph } from "
|
|
19
|
-
import { FlexBox } from "
|
|
18
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
19
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
20
20
|
import { merge } from "lodash";
|
|
21
21
|
|
|
22
22
|
interface Props {
|
|
@@ -279,7 +279,12 @@ export default function NewAddressForm({
|
|
|
279
279
|
display="flex"
|
|
280
280
|
justifyContent="space-around"
|
|
281
281
|
>
|
|
282
|
-
<Button
|
|
282
|
+
<Button
|
|
283
|
+
type="submit"
|
|
284
|
+
color="primary"
|
|
285
|
+
variant="contained"
|
|
286
|
+
data-testid="new-address-btn"
|
|
287
|
+
>
|
|
283
288
|
{t("save")}
|
|
284
289
|
</Button>
|
|
285
290
|
<Button onClick={handleClose} color="primary" variant="outlined">
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { useTranslations } from "next-intl";
|
|
2
2
|
import { CheckoutStepComponentProps } from "./checkout-step";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { H6 } from "
|
|
4
|
+
import { H6 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
5
5
|
import { Alert, Box, Card } from "@mui/material";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
Paragraph,
|
|
8
|
+
Small,
|
|
9
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
7
10
|
import { RetrieveCardPaymentAcceptResultInput } from "@/api-manager/schemas/cart.schema";
|
|
8
11
|
import { CardPaymentAcceptResult } from "@msdyn365-commerce/retail-proxy";
|
|
9
12
|
import usePaymentAcceptResult from "@/api-manager/services/cart/mutations/get-payment-accept-result";
|
|
10
|
-
import { FlexBox } from "
|
|
13
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
11
14
|
import getPaymentAcceptPoint from "@/api-manager/services/cart/queries/get-payment-accept-point";
|
|
12
15
|
|
|
13
16
|
enum PaymentConnectorPostMessageType {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// GLOBAL CUSTOM COMPONENTS
|
|
2
|
-
import { FlexBetween } from "
|
|
3
|
-
import {
|
|
2
|
+
import { FlexBetween } from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
3
|
+
import {
|
|
4
|
+
Paragraph,
|
|
5
|
+
Span,
|
|
6
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
4
7
|
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
5
8
|
import { CartLine } from "@/api-manager/schemas/cart.schema";
|
|
6
9
|
// CUSTOM UTILS LIBRARY FUNCTION
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import Box from "@mui/material/Box";
|
|
4
4
|
import Divider from "@mui/material/Divider";
|
|
5
5
|
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
-
import { Paragraph } from "
|
|
6
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
7
7
|
// GLOBAL CUSTOM HOOK
|
|
8
8
|
// LOCAL CUSTOM COMPONENTS
|
|
9
9
|
import CartItem from "./cart-item";
|
|
@@ -23,7 +23,9 @@ export default function CheckoutAltSummary({ cart }: Props) {
|
|
|
23
23
|
{t("summaryTitle")}
|
|
24
24
|
</Paragraph>
|
|
25
25
|
|
|
26
|
-
{cart.CartLines?.map((cl) =>
|
|
26
|
+
{cart.CartLines?.map((cl) => (
|
|
27
|
+
<CartItem cartLine={cl} key={cl.LineId} />
|
|
28
|
+
))}
|
|
27
29
|
|
|
28
30
|
<Box component={Divider} borderColor="grey.300" my={3} />
|
|
29
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// GLOBAL CUSTOM COMPONENTS
|
|
2
|
-
import { Paragraph } from "
|
|
3
|
-
import { FlexBetween } from "
|
|
2
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
3
|
+
import { FlexBetween } from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
4
4
|
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
5
5
|
// CUSTOM UTILS LIBRARY FUNCTION
|
|
6
6
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Card } from "@mui/material";
|
|
2
2
|
import { Address } from "@/api-manager/schemas/address.schema";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
H5,
|
|
5
|
+
Paragraph,
|
|
6
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
4
7
|
import { useTranslations } from "next-intl";
|
|
5
8
|
|
|
6
9
|
type Props = { address: Address };
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
FlexBetween,
|
|
3
|
+
FlexBox,
|
|
4
|
+
} from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
5
|
+
import { H6 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
3
6
|
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
4
7
|
import { Card, Divider } from "@mui/material";
|
|
5
|
-
import { Paragraph } from "
|
|
8
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
6
9
|
import { useTranslations } from "next-intl";
|
|
7
10
|
|
|
8
11
|
type Props = {
|
|
@@ -3,8 +3,15 @@ import { ProductDimensionType } from "@msdyn365-commerce/retail-proxy";
|
|
|
3
3
|
import { Card, Avatar, Box } from "@mui/material";
|
|
4
4
|
import Grid from "@mui/material/Grid2";
|
|
5
5
|
import { SalesLine } from "@/api-manager/schemas/order.schema";
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
FlexBetween,
|
|
8
|
+
FlexBox,
|
|
9
|
+
} from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
10
|
+
import {
|
|
11
|
+
H6,
|
|
12
|
+
Paragraph,
|
|
13
|
+
Span,
|
|
14
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
8
15
|
import { useFormatter, useTranslations } from "next-intl";
|
|
9
16
|
import React from "react";
|
|
10
17
|
import { Fragment } from "react";
|
|
@@ -6,8 +6,11 @@ import Card from "@mui/material/Card";
|
|
|
6
6
|
import Grid from "@mui/material/Grid2";
|
|
7
7
|
import Avatar from "@mui/material/Avatar";
|
|
8
8
|
// GLOBAL CUSTOM COMPONENTS
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
H3,
|
|
11
|
+
H4,
|
|
12
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
13
|
+
import FlexRowCenter from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-row-center";
|
|
11
14
|
|
|
12
15
|
export default function AvailableShops() {
|
|
13
16
|
return (
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { Box } from "@mui/system";
|
|
11
11
|
import React from "react";
|
|
12
12
|
import SearchHeader from "./search-header";
|
|
13
|
-
import ShopCard from "
|
|
13
|
+
import ShopCard from "@evenicanpm/storefront-core/src/components/_components/shop-card";
|
|
14
14
|
import {
|
|
15
15
|
DeliveryOption,
|
|
16
16
|
ProductWarehouseInventoryAvailability,
|
|
@@ -5,8 +5,15 @@ import Box from "@mui/material/Box";
|
|
|
5
5
|
import Button from "@mui/material/Button";
|
|
6
6
|
import styled from "@mui/material/styles/styled";
|
|
7
7
|
// GLOBAL CUSTOM COMPONENTS
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
H2,
|
|
10
|
+
H3,
|
|
11
|
+
Span,
|
|
12
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
13
|
+
import {
|
|
14
|
+
FlexBox,
|
|
15
|
+
FlexRowCenter,
|
|
16
|
+
} from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
10
17
|
// LOCAL CUSTOM COMPONENT
|
|
11
18
|
import FrequentlyProductCard from "./frequently-product-card";
|
|
12
19
|
// CUSTOM UTILS LIBRARY FUNCTION
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import Link from "next/link";
|
|
2
2
|
import Box from "@mui/material/Box";
|
|
3
3
|
// GLOBAL CUSTOM COMPONENTS
|
|
4
|
-
import HoverBox from "
|
|
5
|
-
import LazyImage from "
|
|
6
|
-
import BazaarCard from "
|
|
7
|
-
import {
|
|
8
|
-
|
|
4
|
+
import HoverBox from "@evenicanpm/storefront-core/src/components/_components/HoverBox";
|
|
5
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components/_components/LazyImage";
|
|
6
|
+
import BazaarCard from "@evenicanpm/storefront-core/src/components/_components/BazaarCard";
|
|
7
|
+
import {
|
|
8
|
+
H6,
|
|
9
|
+
Span,
|
|
10
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
11
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components/_components/flex-box/flex-box";
|
|
9
12
|
// CUSTOM UTILS LIBRARY FUNCTIONS
|
|
10
13
|
import { calculateDiscount, currency } from "@/lib/lib";
|
|
11
14
|
|
|
@@ -4,8 +4,13 @@ import Box from "@mui/material/Box";
|
|
|
4
4
|
import Avatar from "@mui/material/Avatar";
|
|
5
5
|
import Rating from "@mui/material/Rating";
|
|
6
6
|
// GLOBAL CUSTOM COMPONENTS
|
|
7
|
-
import { FlexBox } from "
|
|
8
|
-
import {
|
|
7
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
8
|
+
import {
|
|
9
|
+
H5,
|
|
10
|
+
H6,
|
|
11
|
+
Paragraph,
|
|
12
|
+
Span,
|
|
13
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
9
14
|
// CUSTOM UTILS LIBRARY FUNCTION
|
|
10
15
|
import { getDateDifference } from "@/lib/lib";
|
|
11
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { H3 } from "
|
|
3
|
+
import { H3 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
4
4
|
import { AttributeValue } from "@msdyn365-commerce/retail-proxy";
|
|
5
5
|
|
|
6
6
|
type Props = { attributes: AttributeValue[] };
|
|
@@ -11,9 +11,17 @@ import FormGroup from "@mui/material/FormGroup";
|
|
|
11
11
|
// LOCAL CUSTOM COMPONENTS
|
|
12
12
|
import CheckboxLabel from "./checkbox-label";
|
|
13
13
|
// GLOBAL CUSTOM COMPONENTS
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import {
|
|
15
|
+
FlexBetween,
|
|
16
|
+
FlexBox,
|
|
17
|
+
} from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
18
|
+
import {
|
|
19
|
+
H5,
|
|
20
|
+
H6,
|
|
21
|
+
Paragraph,
|
|
22
|
+
Span,
|
|
23
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
24
|
+
import AccordionHeader from "@evenicanpm/storefront-core/src/components/_components/accordion/accordion-header";
|
|
17
25
|
// TYPE
|
|
18
26
|
import {
|
|
19
27
|
ProductFilterKeys,
|
|
@@ -3,7 +3,10 @@ import Grid from "@mui/material/Grid2";
|
|
|
3
3
|
import Avatar from "@mui/material/Avatar";
|
|
4
4
|
|
|
5
5
|
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
FlexBox,
|
|
8
|
+
FlexRowCenter,
|
|
9
|
+
} from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
7
10
|
import ImageWithFallback from "@/components/ImageWithFallback";
|
|
8
11
|
|
|
9
12
|
/**
|
|
@@ -7,10 +7,14 @@ import { CircularProgress, Typography } from "@mui/material";
|
|
|
7
7
|
|
|
8
8
|
// GLOBAL CUSTOM COMPONENTS
|
|
9
9
|
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import {
|
|
11
|
+
H1,
|
|
12
|
+
H2,
|
|
13
|
+
H6,
|
|
14
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
15
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
16
|
+
import QuantityButtons from "@evenicanpm/storefront-core/src/components/_components/product-quantity-buttons/product-quantity-buttons";
|
|
17
|
+
import AddToWishlistButton from "@evenicanpm/storefront-core/src/components/_components/wishlist-modal/add-to-wishlist-button";
|
|
14
18
|
// D365
|
|
15
19
|
import { ProductDimensionValueInventoryAvailability } from "@msdyn365-commerce/retail-proxy";
|
|
16
20
|
|
|
@@ -64,7 +68,6 @@ export default function ProductIntro({ product, cart }: Props) {
|
|
|
64
68
|
|
|
65
69
|
const { handleCartAmountChange, handleAddToCart, loading } = useCart(
|
|
66
70
|
selectedVariant.RecordId,
|
|
67
|
-
RecordId,
|
|
68
71
|
);
|
|
69
72
|
|
|
70
73
|
const { formatCurrency } = useCurrencyFormatter();
|
|
@@ -9,8 +9,11 @@ import { useFormik } from "formik";
|
|
|
9
9
|
// Local CUSTOM COMPONENT
|
|
10
10
|
import ProductComment from "./product-comment";
|
|
11
11
|
// GLOBAL CUSTOM COMPONENTS
|
|
12
|
-
import { FlexBox } from "
|
|
13
|
-
import {
|
|
12
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
13
|
+
import {
|
|
14
|
+
H2,
|
|
15
|
+
H5,
|
|
16
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
14
17
|
|
|
15
18
|
export default function ProductReview() {
|
|
16
19
|
const initialValues = {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import Box from "@mui/material/Box";
|
|
4
4
|
import Grid from "@mui/material/Grid2";
|
|
5
5
|
// GLOBAL CUSTOM COMPONENTS
|
|
6
|
-
import { H3 } from "
|
|
7
|
-
import ProductCard1Wrapper from "
|
|
6
|
+
import { H3 } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
7
|
+
import ProductCard1Wrapper from "@evenicanpm/storefront-core/src/components/_components/product-cards/product-card-1/product-card-1-wrapper";
|
|
8
8
|
// CUSTOM DATA MODEL
|
|
9
9
|
import GetRelatedProductsDataFetcher from "@/api-manager/services/product/queries/get-related-products";
|
|
10
10
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ProductRefinerValue } from "@msdyn365-commerce/retail-proxy";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import CheckboxLabel from "./checkbox-label";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
FlexBetween,
|
|
6
|
+
FlexBox,
|
|
7
|
+
} from "@evenicanpm/storefront-core/src/components/_components/flex-box";
|
|
8
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
6
9
|
import { RenderedFacetProps } from "./facet-group";
|
|
7
10
|
|
|
8
11
|
type Props = RenderedFacetProps & NonNullable<unknown>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ChangeEvent } from "react";
|
|
3
3
|
import MuiPagination, { PaginationProps } from "@mui/material/Pagination";
|
|
4
|
-
import { Span } from "
|
|
4
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
5
5
|
import { useTranslations } from "next-intl";
|
|
6
6
|
|
|
7
7
|
export interface PageInfo {
|
|
@@ -20,8 +20,8 @@ import useCart, {
|
|
|
20
20
|
AddToCartBopisInput,
|
|
21
21
|
} from "@evenicanpm/storefront-core/src/hooks/use-cart";
|
|
22
22
|
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
23
|
-
import ProductDimensions from "
|
|
24
|
-
import QuantityButtons from "
|
|
23
|
+
import ProductDimensions from "@evenicanpm/storefront-core/src/components/_components/product-dimensions/product-dimensions";
|
|
24
|
+
import QuantityButtons from "@evenicanpm/storefront-core/src/components/_components/product-quantity-buttons/product-quantity-buttons";
|
|
25
25
|
import useVariants from "@evenicanpm/storefront-core/src/hooks/use-variants";
|
|
26
26
|
import {
|
|
27
27
|
InventorySearchCriteriaInput,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ProductRefinerValue,
|
|
4
4
|
} from "@msdyn365-commerce/retail-proxy";
|
|
5
5
|
import { Button, Chip, Stack } from "@mui/material";
|
|
6
|
-
import { Paragraph } from "
|
|
6
|
+
import { Paragraph } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
7
7
|
import React, { useState, useEffect } from "react";
|
|
8
8
|
import useProductList from "./use-product-list";
|
|
9
9
|
import { useTranslations } from "next-intl";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import DropZone from "
|
|
1
|
+
import DropZone from "@evenicanpm/storefront-core/src/components/_components/DropZone";
|
|
2
2
|
import { Alert } from "@mui/material";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { Accept, FileRejection } from "react-dropzone/.";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { FlexBox } from "
|
|
3
|
+
import { FlexBox } from "@evenicanpm/storefront-core/src/components/_components/flex-box/index";
|
|
4
4
|
import {
|
|
5
5
|
Button,
|
|
6
6
|
Container,
|
|
@@ -15,8 +15,11 @@ import QuickOrderRow, { QuickOrderRowData } from "./quick-order-row";
|
|
|
15
15
|
import { useCallback, useEffect, useState } from "react";
|
|
16
16
|
import { ProductSearchResult } from "@msdyn365-commerce/retail-proxy";
|
|
17
17
|
import useSearchProducts from "@/api-manager/services/product/mutations/search-products";
|
|
18
|
-
import { BorderShadowCard } from "
|
|
19
|
-
import {
|
|
18
|
+
import { BorderShadowCard } from "@evenicanpm/storefront-core/src/components/BoxShadowCard";
|
|
19
|
+
import {
|
|
20
|
+
H2,
|
|
21
|
+
Span,
|
|
22
|
+
} from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
20
23
|
import useAddToCart from "@/api-manager/services/cart/mutations/add-to-cart";
|
|
21
24
|
import OrderUpload, { OrderUploadItem } from "./order-upload";
|
|
22
25
|
import { useTranslations } from "next-intl";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import React, { useEffect, useMemo, useState } from "react";
|
|
12
12
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
13
13
|
import { RowError } from "./quick-order-form";
|
|
14
|
-
import { Span } from "
|
|
14
|
+
import { Span } from "@evenicanpm/storefront-core/src/components/_components/Typography";
|
|
15
15
|
import { useTranslations } from "next-intl";
|
|
16
16
|
import useCurrencyFormatter from "@/lib/currency-formatter";
|
|
17
17
|
import _ from "lodash";
|
|
@@ -170,7 +170,7 @@ AccountNavigation.Item = ({
|
|
|
170
170
|
isActive,
|
|
171
171
|
}: ItemProps) => {
|
|
172
172
|
return (
|
|
173
|
-
<StyledNavLink href={href} isCurrentPath={isActive}>
|
|
173
|
+
<StyledNavLink href={href} isCurrentPath={isActive ?? false}>
|
|
174
174
|
<FlexBox alignItems="center" gap={1}>
|
|
175
175
|
<Icon color="inherit" fontSize="large" className="nav-icon" />
|
|
176
176
|
<Span>{label}</Span>
|
|
@@ -83,16 +83,19 @@ OrderSummary.ListItem = ({
|
|
|
83
83
|
property,
|
|
84
84
|
}: {
|
|
85
85
|
title: string;
|
|
86
|
-
property:
|
|
86
|
+
property: keyof SalesOrder;
|
|
87
87
|
}) => {
|
|
88
88
|
const context = useContext(OrderSummaryContext);
|
|
89
89
|
if (!context) return null;
|
|
90
90
|
const t = useTranslations("Account.OrderDetails");
|
|
91
91
|
const { order, formatCurrency } = context;
|
|
92
|
+
|
|
93
|
+
const value = order[property];
|
|
94
|
+
const numValue = typeof value === "number" ? value : 0;
|
|
92
95
|
return (
|
|
93
96
|
<FlexBetween mb={1}>
|
|
94
97
|
<Paragraph color="grey.600">{t(title)}</Paragraph>
|
|
95
|
-
<H6>{formatCurrency(
|
|
98
|
+
<H6>{formatCurrency(numValue)}</H6>
|
|
96
99
|
</FlexBetween>
|
|
97
100
|
);
|
|
98
101
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { createContext, useContext
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
4
|
import _ from "lodash";
|
|
5
5
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
6
6
|
import { Theme } from "@mui/material/styles";
|
|
@@ -14,15 +14,16 @@ import {
|
|
|
14
14
|
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
15
15
|
// API
|
|
16
16
|
import { User } from "@/api-manager/schemas/user.schema";
|
|
17
|
+
import { PropsWithChildren } from "react";
|
|
17
18
|
|
|
18
19
|
interface UserInfoContextValue {
|
|
19
20
|
user: User;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const UserInfoContext = createContext<UserInfoContextValue | null>(null);
|
|
23
|
-
|
|
24
|
+
|
|
25
|
+
interface UserInfoProps extends PropsWithChildren {
|
|
24
26
|
user: User;
|
|
25
|
-
children: ReactNode;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
const UserInfo = ({ user, children }: UserInfoProps) => {
|
|
@@ -52,12 +53,14 @@ const UserInfo = ({ user, children }: UserInfoProps) => {
|
|
|
52
53
|
</UserInfoContext.Provider>
|
|
53
54
|
);
|
|
54
55
|
};
|
|
56
|
+
|
|
55
57
|
interface ItemProps {
|
|
56
58
|
title: string;
|
|
57
59
|
field?: keyof User;
|
|
58
60
|
value?: string;
|
|
59
61
|
transform?: (val: string) => string;
|
|
60
62
|
}
|
|
63
|
+
|
|
61
64
|
UserInfo.Item = ({ title, field, value, transform }: ItemProps) => {
|
|
62
65
|
const ctx = useContext(UserInfoContext);
|
|
63
66
|
if (!ctx) return null;
|
|
@@ -106,7 +106,7 @@ WishlistItem.ProductCount = () => {
|
|
|
106
106
|
const t = useTranslations("Account.Wishlists");
|
|
107
107
|
return (
|
|
108
108
|
<Paragraph ellipsis>
|
|
109
|
-
{`${wishlist?.ProductListLines?.length} ${t("products")}`}
|
|
109
|
+
{`${wishlist?.ProductListLines?.length ?? 0} ${t("products")}`}
|
|
110
110
|
</Paragraph>
|
|
111
111
|
);
|
|
112
112
|
};
|
|
@@ -86,6 +86,9 @@ const EstimateShipping = ({
|
|
|
86
86
|
const doDeliveryMethodLookup = async () => {
|
|
87
87
|
if (!zipCode || !selectedState || !selectedCountry) return;
|
|
88
88
|
setNoOptionsFound(false);
|
|
89
|
+
if (!cartId || !cartLineIds?.length) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
89
92
|
const data = await getDeliveryOptions({
|
|
90
93
|
cartId,
|
|
91
94
|
cartLineIds,
|
|
@@ -117,12 +117,12 @@ CheckoutStep.Header = () => {
|
|
|
117
117
|
);
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
CheckoutStep.Body = ({
|
|
120
|
+
CheckoutStep.Body = <P extends object = {}>({
|
|
121
121
|
component: Component,
|
|
122
122
|
componentProps,
|
|
123
123
|
}: {
|
|
124
|
-
component: React.FC<CheckoutStepComponentProps>;
|
|
125
|
-
componentProps?: Partial<CheckoutStepComponentProps>;
|
|
124
|
+
component: React.FC<CheckoutStepComponentProps & P>;
|
|
125
|
+
componentProps?: Partial<CheckoutStepComponentProps & P>;
|
|
126
126
|
}) => {
|
|
127
127
|
const ctx = useContext(StepContext);
|
|
128
128
|
if (!ctx) return null;
|
|
@@ -141,7 +141,7 @@ CheckoutStep.Body = ({
|
|
|
141
141
|
stepViewState={stepViewState}
|
|
142
142
|
handleStepCompletion={handleStepCompletion}
|
|
143
143
|
cart={cart}
|
|
144
|
-
{...(componentProps
|
|
144
|
+
{...(componentProps as P)}
|
|
145
145
|
/>
|
|
146
146
|
</Grid>
|
|
147
147
|
);
|
|
@@ -27,7 +27,7 @@ const AddressCard = ({
|
|
|
27
27
|
onSelect,
|
|
28
28
|
onDelete,
|
|
29
29
|
children,
|
|
30
|
-
}) => {
|
|
30
|
+
}: AddressCardProps) => {
|
|
31
31
|
const contextValue = React.useMemo(
|
|
32
32
|
() => ({ address, isCartAddress, onEdit, onSelect, onDelete }),
|
|
33
33
|
[address, isCartAddress, onEdit, onSelect, onDelete],
|