diy-template-components 0.1.3 → 0.1.4

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
@@ -449,6 +449,10 @@ function useLinkBuilder(data) {
449
449
  return data.link;
450
450
  }
451
451
 
452
+ if (data?.isExternal) {
453
+ return data.link;
454
+ }
455
+
452
456
  if (!isPreview) {
453
457
  const link = data.link === '/' ? '' : '/' + data.link;
454
458
  return basePath ? `//${basePath}${link}` : null;
@@ -487,8 +491,8 @@ const Button = /*#__PURE__*/forwardRef(function Button({
487
491
  return data?.isLink ? /*#__PURE__*/React.createElement("a", _extends({
488
492
  ref: ref,
489
493
  href: link,
490
- target: data?.isExistingLink === false ? '_blank' : null,
491
- rel: data?.isExistingLink === false ? 'nofollow noopener' : null,
494
+ target: data?.isExternal ? '_blank' : null,
495
+ rel: data?.isExternal ? 'nofollow noopener' : null,
492
496
  className: (active ? classes.active : '') + ' ' + classes[type] + ' ' + classes[size] + ' ' + classes.anchorClass,
493
497
  style: styling
494
498
  }, elementProps), data?.value) : /*#__PURE__*/React.createElement("button", _extends({
@@ -987,7 +991,7 @@ function Dropdown(props) {
987
991
  link: dt.slug,
988
992
  isLink: true,
989
993
  value: dt.title,
990
- isExternal: false
994
+ isExternal: 0
991
995
  },
992
996
  fluid: true,
993
997
  active: dt.active,
@@ -1019,7 +1023,7 @@ function OptionList({
1019
1023
  link: dt.slug,
1020
1024
  active: dt.active,
1021
1025
  isLink: true,
1022
- isExistingLink: false
1026
+ isExternal: 0
1023
1027
  };
1024
1028
  });
1025
1029
  };
@@ -1070,7 +1074,7 @@ function OptionList({
1070
1074
  link: headerData?.appLink,
1071
1075
  isLink: 1,
1072
1076
  value: 'Download App',
1073
- isExistingLink: false
1077
+ isExternal: 1
1074
1078
  },
1075
1079
  type: 'primary',
1076
1080
  size: 'small',
@@ -1084,7 +1088,7 @@ function OptionList({
1084
1088
  link: headerData?.loginCtaLink,
1085
1089
  isLink: 1,
1086
1090
  value: 'Login',
1087
- isExistingLink: false
1091
+ isExternal: 1
1088
1092
  },
1089
1093
  type: 'primary',
1090
1094
  size: isMobile ? 'small' : 'medium',
@@ -1211,7 +1215,7 @@ function MobileHeader({
1211
1215
  src: phoneIos,
1212
1216
  alt: "iosUrl"
1213
1217
  }),
1214
- isExistingLink: false
1218
+ isExternal: 1
1215
1219
  },
1216
1220
  type: '',
1217
1221
  size: 'small',
@@ -1233,7 +1237,7 @@ function MobileHeader({
1233
1237
  src: phoneAndroid,
1234
1238
  alt: "iosUrl"
1235
1239
  }),
1236
- isExistingLink: false
1240
+ isExternal: 1
1237
1241
  },
1238
1242
  type: '',
1239
1243
  size: 'small',
@@ -1253,7 +1257,7 @@ function MobileHeader({
1253
1257
  link: header?.iosUrl,
1254
1258
  isLink: 1,
1255
1259
  value: 'Download App',
1256
- isExistingLink: false
1260
+ isExternal: 1
1257
1261
  },
1258
1262
  type: 'primary',
1259
1263
  size: 'small',
@@ -1266,7 +1270,7 @@ function MobileHeader({
1266
1270
  link: header?.androidURL,
1267
1271
  isLink: 1,
1268
1272
  value: 'Download App',
1269
- isExistingLink: false
1273
+ isExternal: 1
1270
1274
  },
1271
1275
  type: 'primary',
1272
1276
  size: 'small',
@@ -1283,7 +1287,7 @@ function MobileHeader({
1283
1287
  link: header?.appLink,
1284
1288
  isLink: 1,
1285
1289
  value: 'Download App',
1286
- isExistingLink: false
1290
+ isExternal: 1
1287
1291
  },
1288
1292
  type: 'primary',
1289
1293
  size: 'small',
@@ -6617,7 +6621,9 @@ const useWebinarPromotionPage = createUseStyles(theme => {
6617
6621
  width: '645px',
6618
6622
  backgroundColor: '#f4f9ff',
6619
6623
  display: 'flex',
6620
- flexDirection: 'column'
6624
+ flexDirection: 'column',
6625
+ justifyContent: 'center',
6626
+ paddingTop: '20px'
6621
6627
  },
6622
6628
  bannerContainer: {
6623
6629
  background: '#EB5757',
@@ -6745,6 +6751,14 @@ const SingleVideoSlide$1 = props => {
6745
6751
  }
6746
6752
  };
6747
6753
 
6754
+ const discount = ({
6755
+ price,
6756
+ discount
6757
+ }) => {
6758
+ console.log('discountxx', props.data.price, props.data.discount);
6759
+ return (price - discount) / price * 100;
6760
+ };
6761
+
6748
6762
  const classes = useWebinarPromotionPage();
6749
6763
  return /*#__PURE__*/React.createElement("div", {
6750
6764
  className: classes.videoCarouselContainer
@@ -6786,14 +6800,14 @@ const SingleVideoSlide$1 = props => {
6786
6800
  }
6787
6801
  }))), /*#__PURE__*/React.createElement("div", {
6788
6802
  className: classes.courseViewContainer
6789
- }, /*#__PURE__*/React.createElement("p", {
6803
+ }, data.isPaid ? /*#__PURE__*/React.createElement("p", {
6790
6804
  className: classes.offerText
6791
6805
  }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
6792
6806
  className: classes.courseDetailTime
6793
6807
  }, /*#__PURE__*/React.createElement(Countdown, {
6794
6808
  renderer: renderer,
6795
- date: data.endDate
6796
- }))), /*#__PURE__*/React.createElement("div", {
6809
+ date: data.offerPriceEndDate
6810
+ }))) : null, /*#__PURE__*/React.createElement("div", {
6797
6811
  ref: data?.videoFrame?.refSetter,
6798
6812
  className: classes.iframeContainer
6799
6813
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
@@ -6806,15 +6820,15 @@ const SingleVideoSlide$1 = props => {
6806
6820
  className: classes.priceContainer
6807
6821
  }, /*#__PURE__*/React.createElement("div", {
6808
6822
  className: classes.offerPrice
6809
- }, data.offerPrice), /*#__PURE__*/React.createElement("p", {
6823
+ }, data?.discount), /*#__PURE__*/React.createElement("p", {
6810
6824
  style: {
6811
6825
  fontSize: '20px'
6812
6826
  }
6813
6827
  }, /*#__PURE__*/React.createElement("span", {
6814
6828
  className: classes.originalPrice
6815
- }, data.regularPrice), ' ', /*#__PURE__*/React.createElement("span", {
6829
+ }, data?.price), ' ', /*#__PURE__*/React.createElement("span", {
6816
6830
  className: classes.offerDiscount
6817
- }, "50% OFF"))), /*#__PURE__*/React.createElement("div", {
6831
+ }, `${data && discount(data)}%`))), /*#__PURE__*/React.createElement("div", {
6818
6832
  className: classes.webinarButtonContainer
6819
6833
  }, /*#__PURE__*/React.createElement(Button, {
6820
6834
  style: {
@@ -6847,7 +6861,6 @@ function CoursePromotionPage$1({
6847
6861
  const classes = useWebinarPromotionPage({
6848
6862
  containerWidth
6849
6863
  });
6850
- console.log(sectionData);
6851
6864
  return /*#__PURE__*/React.createElement("div", {
6852
6865
  className: classes.webinarSuperContainer
6853
6866
  }, /*#__PURE__*/React.createElement("div", {