diy-template-components 2.0.92 → 2.0.94

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
@@ -241,7 +241,7 @@ const useSectionStyles$a = createUseStyles(theme => ({
241
241
  rightNav: {
242
242
  marginRight: '120px',
243
243
  display: 'flex',
244
- alignItems: "center"
244
+ alignItems: 'center'
245
245
  },
246
246
  priceBox: {
247
247
  marginRight: '16px'
@@ -283,7 +283,7 @@ const useSectionStyles$a = createUseStyles(theme => ({
283
283
  display: 'flex',
284
284
  justifyContent: 'space-between',
285
285
  padding: '16px 16px 24px',
286
- alignItems: "center"
286
+ alignItems: 'center'
287
287
  },
288
288
  BottomSheetOfferContainer: {
289
289
  padding: '12px 0 ',
@@ -1474,6 +1474,7 @@ function DesktopHeader({
1474
1474
  return (discount / price * 100).toFixed(2);
1475
1475
  };
1476
1476
  const OfferDetailsJSX = () => {
1477
+ console.log('header', header);
1477
1478
  if (!header?.effectivePrice) {
1478
1479
  return null;
1479
1480
  }
@@ -1497,13 +1498,13 @@ function DesktopHeader({
1497
1498
  className: classes.offerDiscount
1498
1499
  }, `${getDiscount(header?.price, header?.discount)}%`, "\xA0OFF"), "\xA0\xA0", /*#__PURE__*/React.createElement("span", {
1499
1500
  className: classes.originalPrice
1500
- }, header?.price), ' ') : null, /*#__PURE__*/React.createElement("div", {
1501
+ }, "\u20B9 ", header?.price), ' ') : null, header?.effectivePrice ? /*#__PURE__*/React.createElement("div", {
1501
1502
  style: {
1502
1503
  textAlign: 'end'
1503
1504
  }
1504
1505
  }, /*#__PURE__*/React.createElement("span", {
1505
1506
  className: classes.offerPrice
1506
- }, header?.effectivePrice), ' ')), /*#__PURE__*/React.createElement(Button, {
1507
+ }, "\u20B9 ", header?.effectivePrice)) : null), /*#__PURE__*/React.createElement(Button, {
1507
1508
  data: {
1508
1509
  // link: 'headerData?.loginCtaLink',
1509
1510
  // isLink: 1,
@@ -1615,7 +1616,7 @@ function MobileHeader({
1615
1616
  if (header?.effectivePrice) {
1616
1617
  const body = navEl?.current?.ownerDocument?.body;
1617
1618
  if (body) {
1618
- body.style.marginBottom = '130px';
1619
+ body?.setAttribute('style', 'margin-bottom: 130px');
1619
1620
  }
1620
1621
  }
1621
1622
  }, []);
@@ -1674,6 +1675,7 @@ function MobileHeader({
1674
1675
  }
1675
1676
  };
1676
1677
  const OfferDetailsJSX = () => {
1678
+ console.log('header', header);
1677
1679
  let conversions = extraProps?.conversions || 0;
1678
1680
  const currentTimestamp = new Date().getTime();
1679
1681
  if (header?.isOfferActive && header?.endDate && header?.endDate && header?.endDate > currentTimestamp && (header?.offerPriceValidFor ? header.offerPriceValidFor - conversions > 0 : true)) {
@@ -1696,15 +1698,15 @@ function MobileHeader({
1696
1698
  className: classes.BottomSheetPriceContainer
1697
1699
  }, /*#__PURE__*/React.createElement("div", {
1698
1700
  className: classes.BottomSheetPrice
1699
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
1701
+ }, /*#__PURE__*/React.createElement("div", null, header?.effectivePrice ? /*#__PURE__*/React.createElement("div", {
1700
1702
  style: {
1701
1703
  textAlign: 'start'
1702
1704
  }
1703
1705
  }, /*#__PURE__*/React.createElement("span", {
1704
1706
  className: classes.offerPrice
1705
- }, header?.effectivePrice), ' '), header?.price && header?.discount && header?.effectivePrice && header?.price !== header?.effectivePrice ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
1707
+ }, "\u20B9 ", header?.effectivePrice), ' ') : null, header?.price && header?.discount && header?.effectivePrice && header?.price !== header?.effectivePrice ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
1706
1708
  className: classes.originalPrice
1707
- }, header?.price), ' ', /*#__PURE__*/React.createElement("span", {
1709
+ }, "\u20B9 ", header?.price), ' ', /*#__PURE__*/React.createElement("span", {
1708
1710
  className: classes.offerDiscount
1709
1711
  }, `${getDiscount(header?.price, header?.discount)}%`, "\xA0OFF"), "\xA0\xA0") : null)), /*#__PURE__*/React.createElement(Button, {
1710
1712
  data: {
@@ -3164,7 +3166,8 @@ const wordBreakValue = countryCode => {
3164
3166
 
3165
3167
  function Section$4({
3166
3168
  nodeData,
3167
- sectionIndex
3169
+ sectionIndex,
3170
+ extraProps
3168
3171
  }) {
3169
3172
  const {
3170
3173
  layout: {
@@ -3179,6 +3182,9 @@ function Section$4({
3179
3182
  isMobile,
3180
3183
  wordBreakValue: wordBreakValue(countryCode)
3181
3184
  });
3185
+ const handleButton = () => {
3186
+ extraProps?.courseBuyNow();
3187
+ };
3182
3188
  return /*#__PURE__*/React.createElement("div", {
3183
3189
  className: classes.centerData
3184
3190
  }, /*#__PURE__*/React.createElement("div", {
@@ -3207,7 +3213,13 @@ function Section$4({
3207
3213
  dangerouslySetInnerHTML: {
3208
3214
  __html: nodeData.description.metadata.value
3209
3215
  }
3210
- }), nodeData?.cta?.validations?.isEmptyAllowed && nodeData?.cta?.metadata?.value === '' ? null : /*#__PURE__*/React.createElement(Button, {
3216
+ }), nodeData?.cta?.validations?.isEmptyAllowed && nodeData?.cta?.metadata?.value === '' ? null : nodeData?.cta?.metadata?.default === true ? /*#__PURE__*/React.createElement(Button, {
3217
+ data: nodeData.cta.metadata,
3218
+ ref: nodeData?.cta?.refSetter,
3219
+ type: nodeData?.cta?.metadata?.type,
3220
+ size: isMobile ? 'small' : 'medium',
3221
+ onClick: handleButton
3222
+ }) : /*#__PURE__*/React.createElement(Button, {
3211
3223
  ref: nodeData?.cta?.refSetter,
3212
3224
  data: nodeData.cta.metadata,
3213
3225
  type: nodeData?.cta?.metadata?.type,
@@ -3223,7 +3235,8 @@ function Section$4({
3223
3235
  }
3224
3236
  function BannerCarouselRight({
3225
3237
  sectionData,
3226
- sectionIndex
3238
+ sectionIndex,
3239
+ extraProps
3227
3240
  }) {
3228
3241
  const {
3229
3242
  isMobile,
@@ -3250,7 +3263,8 @@ function BannerCarouselRight({
3250
3263
  }, /*#__PURE__*/React.createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$4, {
3251
3264
  nodeData: node,
3252
3265
  key: idx /* or some other unique property */,
3253
- sectionIndex: sectionIndex
3266
+ sectionIndex: sectionIndex,
3267
+ extraProps: extraProps
3254
3268
  })))));
3255
3269
  }
3256
3270
 
@@ -3930,7 +3944,8 @@ const useSectionStyles$5 = createUseStyles(theme => {
3930
3944
 
3931
3945
  function Section$2({
3932
3946
  nodeData,
3933
- sectionIndex
3947
+ sectionIndex,
3948
+ extraProps
3934
3949
  }) {
3935
3950
  const {
3936
3951
  layout: {
@@ -3945,6 +3960,9 @@ function Section$2({
3945
3960
  isMobile,
3946
3961
  wordBreakValue: wordBreakValue(countryCode)
3947
3962
  });
3963
+ const handleButton = () => {
3964
+ extraProps?.courseBuyNow();
3965
+ };
3948
3966
  return /*#__PURE__*/React.createElement("div", {
3949
3967
  className: classes.centerData
3950
3968
  }, /*#__PURE__*/React.createElement("div", {
@@ -3978,7 +3996,13 @@ function Section$2({
3978
3996
  dangerouslySetInnerHTML: {
3979
3997
  __html: nodeData.description.metadata.value
3980
3998
  }
3981
- }), nodeData?.cta?.validations?.isEmptyAllowed && nodeData?.cta?.metadata?.value === '' ? null : /*#__PURE__*/React.createElement(Button, {
3999
+ }), nodeData?.cta?.validations?.isEmptyAllowed && nodeData?.cta?.metadata?.value === '' ? null : nodeData?.cta?.metadata?.default === true ? /*#__PURE__*/React.createElement(Button, {
4000
+ data: nodeData.cta.metadata,
4001
+ ref: nodeData?.cta?.refSetter,
4002
+ type: nodeData?.cta?.metadata?.type,
4003
+ size: isMobile ? 'small' : 'medium',
4004
+ onClick: handleButton
4005
+ }) : /*#__PURE__*/React.createElement(Button, {
3982
4006
  ref: nodeData?.cta?.refSetter,
3983
4007
  data: nodeData.cta.metadata,
3984
4008
  type: nodeData?.cta?.metadata?.type,
@@ -3990,7 +4014,8 @@ function BannerCarouselLeft({
3990
4014
  sectionData,
3991
4015
  isCustomWebsite,
3992
4016
  sectionIndex,
3993
- isMobile
4017
+ isMobile,
4018
+ extraProps
3994
4019
  }) {
3995
4020
  const {
3996
4021
  layout: {
@@ -4011,7 +4036,8 @@ function BannerCarouselLeft({
4011
4036
  }, /*#__PURE__*/React.createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React.createElement(Section$2, {
4012
4037
  nodeData: node,
4013
4038
  key: idx /* or some other unique property */,
4014
- sectionIndex: sectionIndex
4039
+ sectionIndex: sectionIndex,
4040
+ extraProps: extraProps
4015
4041
  })))));
4016
4042
  }
4017
4043