diff --git a/packages/scandipwa/package.json b/packages/scandipwa/package.json index ce139ee900..aaeca03c85 100644 --- a/packages/scandipwa/package.json +++ b/packages/scandipwa/package.json @@ -1,7 +1,7 @@ { "name": "@scandipwa/scandipwa", "description": "ScandiPWA source code used by CSA.", - "version": "5.3.4", + "version": "5.3.6", "scripts": { "start": "scandipwa-scripts start", "start:magento": "BUILD_MODE=magento scandipwa-scripts start", diff --git a/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.tsx b/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.tsx index 822c5848ab..83ef3cd1f0 100644 --- a/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.tsx +++ b/packages/scandipwa/src/component/CheckoutTermsAndConditionsPopup/CheckoutTermsAndConditionsPopup.component.tsx @@ -34,7 +34,7 @@ export class CheckoutTermsAndConditionsPopupComponent extends PureComponent { this.renderContent() } diff --git a/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.tsx b/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.tsx index 8ababc5fb7..35273aeb3e 100644 --- a/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.tsx +++ b/packages/scandipwa/src/component/ImageZoomPopup/ImageZoomPopup.container.tsx @@ -84,7 +84,7 @@ export class ImageZoomPopupContainer extends PureComponent
diff --git a/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.tsx b/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.tsx index 530461d7a9..4c30345e72 100644 --- a/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.tsx +++ b/packages/scandipwa/src/component/NewVersionPopup/NewVersionPopup.component.tsx @@ -93,7 +93,7 @@ export class NewVersionPopupComponent extends PureComponent { this.renderContent() } diff --git a/packages/scandipwa/src/component/Popup/Popup.component.tsx b/packages/scandipwa/src/component/Popup/Popup.component.tsx index 2e494f8bba..a861cb9cd6 100644 --- a/packages/scandipwa/src/component/Popup/Popup.component.tsx +++ b/packages/scandipwa/src/component/Popup/Popup.component.tsx @@ -27,7 +27,7 @@ import './Popup.style'; export class PopupComponent extends Overlay { static defaultProps: Partial = { ...Overlay.defaultProps, - clickOutside: true, + isCloseOnOutsideClick: true, title: '', }; @@ -104,9 +104,9 @@ export class PopupComponent extends Overlay { // Same with click outside handleClickOutside(): void { - const { clickOutside, isMobile } = this.props; + const { isCloseOnOutsideClick, isMobile } = this.props; - if (!clickOutside) { + if (!isCloseOnOutsideClick) { return; } diff --git a/packages/scandipwa/src/component/Popup/Popup.container.tsx b/packages/scandipwa/src/component/Popup/Popup.container.tsx index b920c309c5..978f820a26 100644 --- a/packages/scandipwa/src/component/Popup/Popup.container.tsx +++ b/packages/scandipwa/src/component/Popup/Popup.container.tsx @@ -61,7 +61,7 @@ export class PopupContainer extends PureComponent { contentMix: {}, children: [], isStatic: false, - clickOutside: false, + isCloseOnOutsideClick: true, }; containerFunctions: PopupContainerFunctions = { @@ -87,6 +87,7 @@ export class PopupContainer extends PureComponent { PopupContainerPropsKeys > { const { + isCloseOnOutsideClick, activeOverlay, areOtherOverlaysOpen, changeHeaderState, @@ -106,6 +107,7 @@ export class PopupContainer extends PureComponent { } = this.props; return { + isCloseOnOutsideClick, activeOverlay, areOtherOverlaysOpen, changeHeaderState, diff --git a/packages/scandipwa/src/component/Popup/Popup.type.ts b/packages/scandipwa/src/component/Popup/Popup.type.ts index fa9d838dd0..1659a005fa 100644 --- a/packages/scandipwa/src/component/Popup/Popup.type.ts +++ b/packages/scandipwa/src/component/Popup/Popup.type.ts @@ -45,11 +45,10 @@ export type PopupContainerProps = PopupContainerMapStateProps isStatic: boolean; children: Children; id: string; - clickOutside: boolean; + isCloseOnOutsideClick: boolean; }; export type PopupComponentProps = OverlayComponentProps & { - clickOutside: boolean; title?: string; isMobile: boolean; changeHeaderState: (state: NavigationState) => void; @@ -57,6 +56,7 @@ export type PopupComponentProps = OverlayComponentProps & { resetHideActivePopup: () => void; hideActiveOverlay: () => void; shouldPopupClose: boolean; + isCloseOnOutsideClick: boolean; }; export type PopupContainerPropsKeys = 'activeOverlay' @@ -75,4 +75,5 @@ export type PopupContainerPropsKeys = 'activeOverlay' | 'hideActiveOverlay' | 'resetHideActivePopup' | 'goToPreviousNavigationState' -| 'title'; +| 'title' +| 'isCloseOnOutsideClick'; diff --git a/packages/scandipwa/src/component/ProductList/ProductList.container.tsx b/packages/scandipwa/src/component/ProductList/ProductList.container.tsx index eb50c56174..3ef5096058 100644 --- a/packages/scandipwa/src/component/ProductList/ProductList.container.tsx +++ b/packages/scandipwa/src/component/ProductList/ProductList.container.tsx @@ -327,6 +327,8 @@ export class ProductListContainer extends PureComponent { this.renderContent() } diff --git a/packages/scandipwa/src/component/StoreInPickUpPopup/StoreInPickUpPopup.component.tsx b/packages/scandipwa/src/component/StoreInPickUpPopup/StoreInPickUpPopup.component.tsx index 68b0f66634..18218ce9cc 100644 --- a/packages/scandipwa/src/component/StoreInPickUpPopup/StoreInPickUpPopup.component.tsx +++ b/packages/scandipwa/src/component/StoreInPickUpPopup/StoreInPickUpPopup.component.tsx @@ -140,7 +140,7 @@ export class StoreInPickUpPopupComponent extends PureComponent { this.renderContent() } diff --git a/packages/scandipwa/src/route/CategoryPage/CategoryPage.component.tsx b/packages/scandipwa/src/route/CategoryPage/CategoryPage.component.tsx index eb0f97d087..5be506f26a 100644 --- a/packages/scandipwa/src/route/CategoryPage/CategoryPage.component.tsx +++ b/packages/scandipwa/src/route/CategoryPage/CategoryPage.component.tsx @@ -13,7 +13,6 @@ import { lazy, PureComponent, Suspense } from 'react'; import CategoryDetails from 'Component/CategoryDetails'; -import { CATEGORY_FILTER_OVERLAY_ID } from 'Component/CategoryFilterOverlay/CategoryFilterOverlay.config'; import CategoryItemsCount from 'Component/CategoryItemsCount'; import CategoryProductList from 'Component/CategoryProductList'; import CategorySort from 'Component/CategorySort'; @@ -61,14 +60,9 @@ S extends CategoryPageComponentState = CategoryPageComponentState, selectedLayoutType: undefined, }; - __construct(props: CategoryPageComponentProps): void { - super.__construct?.(props); - this.onFilterButtonClick = this.onFilterButtonClick.bind(this); - - this.state = { - activeLayoutType: undefined, - } as S; - } + state = { + activeLayoutType: undefined, + } as S; static getDerivedStateFromProps(props: CategoryPageComponentProps): Partial { const { @@ -98,13 +92,7 @@ S extends CategoryPageComponentState = CategoryPageComponentState, return { activeLayoutType }; } - onFilterButtonClick(): void { - const { toggleOverlayByKey } = this.props; - - toggleOverlayByKey(CATEGORY_FILTER_OVERLAY_ID); - } - - displayProducts(): boolean { + displayProducts() { const { category: { display_mode = CategoryDisplayMode.PRODUCTS, @@ -159,7 +147,7 @@ S extends CategoryPageComponentState = CategoryPageComponentState, isSearchPage, isCurrentCategoryLoaded, isMatchingInfoFilter, - + onFilterButtonClick, } = this.props; if (!isMatchingInfoFilter) { @@ -174,7 +162,7 @@ S extends CategoryPageComponentState = CategoryPageComponentState,