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 +16 -15
- package/build/index.es.js.map +1 -1
- package/build/index.js +16 -15
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -1419,7 +1419,8 @@ function DesktopHeader({
|
|
|
1419
1419
|
isFixed = true
|
|
1420
1420
|
} = header;
|
|
1421
1421
|
const {
|
|
1422
|
-
isCustomWebsite
|
|
1422
|
+
isCustomWebsite,
|
|
1423
|
+
isEdit
|
|
1423
1424
|
} = React.useContext(PageContext);
|
|
1424
1425
|
const logoUrl = useLinkBuilder({
|
|
1425
1426
|
isLink: true,
|
|
@@ -1440,9 +1441,6 @@ function DesktopHeader({
|
|
|
1440
1441
|
return optionsData;
|
|
1441
1442
|
};
|
|
1442
1443
|
React.useEffect(() => {
|
|
1443
|
-
if (!header?.effectivePrice) {
|
|
1444
|
-
return;
|
|
1445
|
-
}
|
|
1446
1444
|
const handleScroll = () => {
|
|
1447
1445
|
if (window.scrollY > 220) {
|
|
1448
1446
|
setIsVisible(true);
|
|
@@ -1450,7 +1448,9 @@ function DesktopHeader({
|
|
|
1450
1448
|
setIsVisible(false);
|
|
1451
1449
|
}
|
|
1452
1450
|
};
|
|
1453
|
-
|
|
1451
|
+
if (header?.effectivePrice) {
|
|
1452
|
+
window.addEventListener('scroll', handleScroll);
|
|
1453
|
+
}
|
|
1454
1454
|
return () => {
|
|
1455
1455
|
if (header?.effectivePrice) {
|
|
1456
1456
|
window.removeEventListener('scroll', handleScroll);
|
|
@@ -1510,7 +1510,7 @@ function DesktopHeader({
|
|
|
1510
1510
|
};
|
|
1511
1511
|
const OfferDetailsJSX = () => {
|
|
1512
1512
|
console.log('header', header);
|
|
1513
|
-
if (!header?.effectivePrice || !isVisible) {
|
|
1513
|
+
if (!header?.effectivePrice || !isVisible && !isEdit) {
|
|
1514
1514
|
return null;
|
|
1515
1515
|
}
|
|
1516
1516
|
let conversions = extraProps?.conversions || 0;
|
|
@@ -1623,7 +1623,8 @@ function MobileHeader({
|
|
|
1623
1623
|
}) {
|
|
1624
1624
|
const {
|
|
1625
1625
|
isCustomWebsite,
|
|
1626
|
-
countryCode
|
|
1626
|
+
countryCode,
|
|
1627
|
+
isEdit
|
|
1627
1628
|
} = React.useContext(PageContext);
|
|
1628
1629
|
const {
|
|
1629
1630
|
isFixed = true
|
|
@@ -1658,18 +1659,18 @@ function MobileHeader({
|
|
|
1658
1659
|
}
|
|
1659
1660
|
}, [sideMenu, header?.effectivePrice]);
|
|
1660
1661
|
React.useEffect(() => {
|
|
1662
|
+
const handleScroll = () => {
|
|
1663
|
+
if (window.scrollY > 220) {
|
|
1664
|
+
setIsVisible(true);
|
|
1665
|
+
} else {
|
|
1666
|
+
setIsVisible(false);
|
|
1667
|
+
}
|
|
1668
|
+
};
|
|
1661
1669
|
if (header?.effectivePrice) {
|
|
1662
1670
|
const body = navEl?.current?.ownerDocument?.body;
|
|
1663
1671
|
if (body) {
|
|
1664
1672
|
body.style.marginBottom = '130px';
|
|
1665
1673
|
}
|
|
1666
|
-
const handleScroll = () => {
|
|
1667
|
-
if (window.scrollY > 220) {
|
|
1668
|
-
setIsVisible(true);
|
|
1669
|
-
} else {
|
|
1670
|
-
setIsVisible(false);
|
|
1671
|
-
}
|
|
1672
|
-
};
|
|
1673
1674
|
window.addEventListener('scroll', handleScroll);
|
|
1674
1675
|
}
|
|
1675
1676
|
return () => {
|
|
@@ -1751,7 +1752,7 @@ function MobileHeader({
|
|
|
1751
1752
|
return null;
|
|
1752
1753
|
};
|
|
1753
1754
|
const BottomSheetJSX = () => {
|
|
1754
|
-
if (!header?.effectivePrice || !isVisible) {
|
|
1755
|
+
if (!header?.effectivePrice || !isVisible && !isEdit) {
|
|
1755
1756
|
return null;
|
|
1756
1757
|
}
|
|
1757
1758
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|