diy-template-components 2.0.100 → 2.0.101

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/build/index.es.js CHANGED
@@ -1403,7 +1403,8 @@ function DesktopHeader({
1403
1403
  isFixed = true
1404
1404
  } = header;
1405
1405
  const {
1406
- isCustomWebsite
1406
+ isCustomWebsite,
1407
+ isEdit
1407
1408
  } = useContext(PageContext);
1408
1409
  const logoUrl = useLinkBuilder({
1409
1410
  isLink: true,
@@ -1424,9 +1425,6 @@ function DesktopHeader({
1424
1425
  return optionsData;
1425
1426
  };
1426
1427
  useEffect(() => {
1427
- if (!header?.effectivePrice) {
1428
- return;
1429
- }
1430
1428
  const handleScroll = () => {
1431
1429
  if (window.scrollY > 220) {
1432
1430
  setIsVisible(true);
@@ -1434,7 +1432,9 @@ function DesktopHeader({
1434
1432
  setIsVisible(false);
1435
1433
  }
1436
1434
  };
1437
- window.addEventListener('scroll', handleScroll);
1435
+ if (header?.effectivePrice) {
1436
+ window.addEventListener('scroll', handleScroll);
1437
+ }
1438
1438
  return () => {
1439
1439
  if (header?.effectivePrice) {
1440
1440
  window.removeEventListener('scroll', handleScroll);
@@ -1494,7 +1494,7 @@ function DesktopHeader({
1494
1494
  };
1495
1495
  const OfferDetailsJSX = () => {
1496
1496
  console.log('header', header);
1497
- if (!header?.effectivePrice || !isVisible) {
1497
+ if (!header?.effectivePrice || !isVisible && !isEdit) {
1498
1498
  return null;
1499
1499
  }
1500
1500
  let conversions = extraProps?.conversions || 0;
@@ -1607,7 +1607,8 @@ function MobileHeader({
1607
1607
  }) {
1608
1608
  const {
1609
1609
  isCustomWebsite,
1610
- countryCode
1610
+ countryCode,
1611
+ isEdit
1611
1612
  } = useContext(PageContext);
1612
1613
  const {
1613
1614
  isFixed = true
@@ -1642,18 +1643,18 @@ function MobileHeader({
1642
1643
  }
1643
1644
  }, [sideMenu, header?.effectivePrice]);
1644
1645
  useEffect(() => {
1646
+ const handleScroll = () => {
1647
+ if (window.scrollY > 220) {
1648
+ setIsVisible(true);
1649
+ } else {
1650
+ setIsVisible(false);
1651
+ }
1652
+ };
1645
1653
  if (header?.effectivePrice) {
1646
1654
  const body = navEl?.current?.ownerDocument?.body;
1647
1655
  if (body) {
1648
1656
  body.style.marginBottom = '130px';
1649
1657
  }
1650
- const handleScroll = () => {
1651
- if (window.scrollY > 220) {
1652
- setIsVisible(true);
1653
- } else {
1654
- setIsVisible(false);
1655
- }
1656
- };
1657
1658
  window.addEventListener('scroll', handleScroll);
1658
1659
  }
1659
1660
  return () => {
@@ -1735,7 +1736,7 @@ function MobileHeader({
1735
1736
  return null;
1736
1737
  };
1737
1738
  const BottomSheetJSX = () => {
1738
- if (!header?.effectivePrice || !isVisible) {
1739
+ if (!header?.effectivePrice || !isVisible && !isEdit) {
1739
1740
  return null;
1740
1741
  }
1741
1742
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {