diy-template-components 0.3.6 → 0.3.7

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
@@ -2260,12 +2260,12 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2260
2260
  imageContainer: {
2261
2261
  width: '50%',
2262
2262
  position: 'relative',
2263
+ height: '90%',
2263
2264
  paddingBottom: ({
2264
2265
  isCustomWebsite
2265
2266
  }) => isCustomWebsite ? '35%' : '',
2266
2267
  '& img': {
2267
- height: '520px',
2268
- objectFit: 'cover'
2268
+ // objectFit: 'cover'
2269
2269
  }
2270
2270
  },
2271
2271
  subTitleHeading: {
@@ -2292,7 +2292,7 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2292
2292
  sideBannerImage: {
2293
2293
  width: '100%',
2294
2294
  height: 'calc(100% - 100px)',
2295
- objectFit: 'cover',
2295
+ // objectFit: 'cover',
2296
2296
  objectPosition: '50% 50%'
2297
2297
  },
2298
2298
  absoluteButtonsBannerRight: {
@@ -4385,6 +4385,8 @@ function VideoTestimonial({
4385
4385
  layout: {
4386
4386
  containerWidth
4387
4387
  },
4388
+ countryCode,
4389
+ currencySymbol,
4388
4390
  isMobile
4389
4391
  } = useContext(PageContext);
4390
4392
  const classes = useVideoTestimonialStyles({
@@ -4416,7 +4418,9 @@ function VideoTestimonial({
4416
4418
  })), /*#__PURE__*/React.createElement(Wrapper, null, videoData.videoCarousel.components.map((data, index) => /*#__PURE__*/React.createElement(SingleVideoSlide$2, {
4417
4419
  data: data,
4418
4420
  key: index,
4419
- sectionIndex: sectionIndex
4421
+ sectionIndex: sectionIndex,
4422
+ countryCode: countryCode,
4423
+ currencySymbol: currencySymbol
4420
4424
  }))))));
4421
4425
  }
4422
4426
 
@@ -7325,7 +7329,9 @@ const SingleVideoSlide$1 = props => {
7325
7329
  const {
7326
7330
  data,
7327
7331
  webinarCtaClick,
7328
- conversions = 0
7332
+ conversions = 0,
7333
+ countryCode,
7334
+ currencySymbol
7329
7335
  } = props;
7330
7336
  const renderer = ({
7331
7337
  days,
@@ -7335,11 +7341,14 @@ const SingleVideoSlide$1 = props => {
7335
7341
  completed
7336
7342
  }) => {
7337
7343
  if (days === 0 && hours < 24) {
7344
+ if (countryCode === 'KR') {
7345
+ return /*#__PURE__*/React.createElement("span", null, hours, " \uC2DC\uAC04 ", minutes, " \uBD84 ", seconds, "\uCD08");
7346
+ }
7338
7347
  return /*#__PURE__*/React.createElement("span", null, hours, "h ", minutes, "m ", seconds, "s");
7339
7348
  } else {
7340
7349
  let given = moment(props.data.offerPriceEndDate);
7341
7350
  let current = moment().startOf('day');
7342
- return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
7351
+ return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), ' ', countryCode === 'KR' ? '날' : 'day(s)');
7343
7352
  }
7344
7353
  };
7345
7354
  const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
@@ -7371,6 +7380,44 @@ const SingleVideoSlide$1 = props => {
7371
7380
  return (discount / price * 100).toFixed(2);
7372
7381
  };
7373
7382
  const classes = useWebinarPromotionPage();
7383
+ const effectivePrice = formatCurrency(countryCode, data?.effectivePrice, currencySymbol);
7384
+ const renderHurryUpBannerText = () => {
7385
+ let count = data.offerPriceValidFor - conversions;
7386
+ if (countryCode === 'KR') {
7387
+ if (count > 1) {
7388
+ return `서두르세요! 현재 신청 가능 인원은 ${count}명 입니다.`;
7389
+ } else {
7390
+ return `서두르세요! ${count}명까지만 신청 가능이 가능합니다.`;
7391
+ }
7392
+ } else {
7393
+ return `Hurry up! Offer left for ${count} ${count > 1 ? 'users now' : 'user only'}`;
7394
+ }
7395
+ };
7396
+ const limitedPeriodOfferText = countryCode === 'KR' ? '기간 한정 딜이므로 서두르세요!' : 'Hurry up! Offer for limited period only';
7397
+ const renderOfferEndsInText = () => {
7398
+ if (countryCode === 'KR') {
7399
+ return /*#__PURE__*/React.createElement("p", {
7400
+ className: classes.offerText
7401
+ }, /*#__PURE__*/React.createElement("span", {
7402
+ className: classes.courseDetailTime
7403
+ }, /*#__PURE__*/React.createElement(Countdown, {
7404
+ renderer: renderer,
7405
+ date: data.offerPriceEndDate
7406
+ })), ' ', "\uD6C4\xA0\uC2E0\uCCAD\xA0\uB9C8\uAC10\xA0\uC608\uC815");
7407
+ } else {
7408
+ return /*#__PURE__*/React.createElement("p", {
7409
+ className: classes.offerText
7410
+ }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7411
+ className: classes.courseDetailTime
7412
+ }, /*#__PURE__*/React.createElement(Countdown, {
7413
+ renderer: renderer,
7414
+ date: data.offerPriceEndDate
7415
+ })));
7416
+ }
7417
+ };
7418
+ const finalPrice = formatCurrency(countryCode, data?.price, currencySymbol);
7419
+ const buyNowText = countryCode === 'KR' ? '이 강좌를 수강하세요.' : 'BUY NOW';
7420
+ const registerNowText = countryCode === 'KR' ? '지금 신청하기' : 'REGISTER NOW';
7374
7421
  return /*#__PURE__*/React.createElement("div", {
7375
7422
  className: classes.videoCarouselContainer
7376
7423
  }, /*#__PURE__*/React.createElement("div", {
@@ -7383,11 +7430,11 @@ const SingleVideoSlide$1 = props => {
7383
7430
  className: classes.bannerContainer
7384
7431
  }, /*#__PURE__*/React.createElement("div", {
7385
7432
  className: classes.bannerContainerText
7386
- }, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, ' ', data.offerPriceValidFor - conversions > 1 ? 'users now' : 'user only')) : checkIfOfferIsValid() && data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : /*#__PURE__*/React.createElement("div", {
7433
+ }, renderHurryUpBannerText())) : checkIfOfferIsValid() && data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : /*#__PURE__*/React.createElement("div", {
7387
7434
  className: classes.bannerContainer
7388
7435
  }, /*#__PURE__*/React.createElement("div", {
7389
7436
  className: classes.bannerContainerText
7390
- }, "Hurry up! Offer for limited period only"))), /*#__PURE__*/React.createElement("h3", {
7437
+ }, limitedPeriodOfferText))), /*#__PURE__*/React.createElement("h3", {
7391
7438
  ref: data?.videoTextHeading?.refSetter,
7392
7439
  className: classes.videoDetailsHeading,
7393
7440
  dangerouslySetInnerHTML: {
@@ -7427,14 +7474,7 @@ const SingleVideoSlide$1 = props => {
7427
7474
  }
7428
7475
  }))), /*#__PURE__*/React.createElement("div", {
7429
7476
  className: classes.courseViewContainer
7430
- }, data.isPaid !== 0 && checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && /*#__PURE__*/React.createElement("p", {
7431
- className: classes.offerText
7432
- }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7433
- className: classes.courseDetailTime
7434
- }, /*#__PURE__*/React.createElement(Countdown, {
7435
- renderer: renderer,
7436
- date: data.offerPriceEndDate
7437
- }))), /*#__PURE__*/React.createElement("div", {
7477
+ }, data.isPaid !== 0 && checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && renderOfferEndsInText(), /*#__PURE__*/React.createElement("div", {
7438
7478
  ref: data?.videoFrame?.refSetter,
7439
7479
  className: classes.iframeContainer
7440
7480
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
@@ -7451,13 +7491,13 @@ const SingleVideoSlide$1 = props => {
7451
7491
  className: classes.priceContainer
7452
7492
  }, /*#__PURE__*/React.createElement("div", {
7453
7493
  className: classes.offerPrice
7454
- }, "\u20B9", data?.effectivePrice), checkForShowDiscount() && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7494
+ }, effectivePrice), checkForShowDiscount() && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7455
7495
  style: {
7456
7496
  fontSize: '20px'
7457
7497
  }
7458
7498
  }, /*#__PURE__*/React.createElement("span", {
7459
7499
  className: classes.originalPrice
7460
- }, "\u20B9", data?.price), ' ', /*#__PURE__*/React.createElement("span", {
7500
+ }, finalPrice), ' ', /*#__PURE__*/React.createElement("span", {
7461
7501
  className: classes.offerDiscount
7462
7502
  }, `${data && discount(data)}%`))) : null, /*#__PURE__*/React.createElement("div", {
7463
7503
  className: classes.webinarButtonContainer
@@ -7469,7 +7509,7 @@ const SingleVideoSlide$1 = props => {
7469
7509
  data: {
7470
7510
  // link: 'headerData?.loginCtaLink',
7471
7511
  // isLink: 1,
7472
- value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
7512
+ value: data.isPaid ? buyNowText : registerNowText
7473
7513
  // isExternal: 1
7474
7514
  },
7475
7515
 
@@ -7487,10 +7527,12 @@ function CoursePromotionPage$1({
7487
7527
  sectionIndex
7488
7528
  }) {
7489
7529
  const {
7490
- isMobile,
7491
7530
  layout: {
7492
7531
  containerWidth
7493
- }
7532
+ },
7533
+ countryCode,
7534
+ currencySymbol,
7535
+ isMobile
7494
7536
  } = useContext(PageContext);
7495
7537
  const classes = useWebinarPromotionPage({
7496
7538
  containerWidth,
@@ -7506,7 +7548,9 @@ function CoursePromotionPage$1({
7506
7548
  data: sectionData.components[0].metadata,
7507
7549
  webinarCtaClick: extraProps.webinarCtaClick,
7508
7550
  conversions: extraProps.conversions,
7509
- sectionIndex: sectionIndex
7551
+ sectionIndex: sectionIndex,
7552
+ countryCode: countryCode,
7553
+ currencySymbol: currencySymbol
7510
7554
  }))));
7511
7555
  }
7512
7556
 
@@ -7826,18 +7870,23 @@ const SingleVideoSlide = props => {
7826
7870
  completed
7827
7871
  }) => {
7828
7872
  if (days === 0 && hours < 24) {
7873
+ if (countryCode === 'KR') {
7874
+ return /*#__PURE__*/React.createElement("span", null, hours, " \uC2DC\uAC04 ", minutes, " \uBD84 ", seconds, "\uCD08");
7875
+ }
7829
7876
  return /*#__PURE__*/React.createElement("span", null, hours, "h ", minutes, "m ", seconds, "s");
7830
7877
  } else {
7831
7878
  let given = moment(props.data.endDate);
7832
7879
  let current = moment().startOf('day');
7833
- return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
7880
+ return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), ' ', countryCode === 'KR' ? '날' : 'day(s)');
7834
7881
  }
7835
7882
  };
7836
7883
  const {
7837
7884
  data,
7838
7885
  courseBuyNow,
7839
7886
  conversions = 20,
7840
- showCourseInstallment
7887
+ showCourseInstallment,
7888
+ countryCode,
7889
+ currencySymbol
7841
7890
  } = props;
7842
7891
  const showCourseInstallmentData = data?.courseOverviewData;
7843
7892
  const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
@@ -7870,6 +7919,34 @@ const SingleVideoSlide = props => {
7870
7919
  }) => {
7871
7920
  return (discount / price * 100).toFixed(2);
7872
7921
  };
7922
+ const renderHurryUpBannerText = () => {
7923
+ return countryCode === 'KR' ? `서두르세요! 현재 신청 가능 인원은 ${data.offerPriceValidFor - conversions}명 입니다.` : `Hurry up! Offer left for ${data.offerPriceValidFor - conversions} users now`;
7924
+ };
7925
+ const limitedPeriodOfferText = countryCode === 'KR' ? `기간 한정 딜이므로 서두르세요!` : 'Hurry up! Offer for limited period only';
7926
+ const renderOfferEndsInText = () => {
7927
+ if (countryCode === 'KR') {
7928
+ return /*#__PURE__*/React.createElement("p", {
7929
+ className: classes.offerText
7930
+ }, /*#__PURE__*/React.createElement("span", {
7931
+ className: classes.courseDetailTime
7932
+ }, /*#__PURE__*/React.createElement(Countdown, {
7933
+ renderer: renderer,
7934
+ date: data.endDate
7935
+ })), ' ', "\uD6C4\xA0\uC2E0\uCCAD\xA0\uB9C8\uAC10\xA0\uC608\uC815");
7936
+ } else {
7937
+ return /*#__PURE__*/React.createElement("p", {
7938
+ className: classes.offerText
7939
+ }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7940
+ className: classes.courseDetailTime
7941
+ }, /*#__PURE__*/React.createElement(Countdown, {
7942
+ renderer: renderer,
7943
+ date: data.endDate
7944
+ })));
7945
+ }
7946
+ };
7947
+ const effectivePrice = formatCurrency(countryCode, data?.effectivePrice, currencySymbol);
7948
+ const finalPrice = formatCurrency(countryCode, data?.price, currencySymbol);
7949
+ const buyNowText = countryCode === 'KR' ? '이 강좌를 수강하세요.' : 'BUY NOW';
7873
7950
  return /*#__PURE__*/React.createElement("div", {
7874
7951
  className: classes.videoCarouselContainer
7875
7952
  }, /*#__PURE__*/React.createElement("div", {
@@ -7882,11 +7959,11 @@ const SingleVideoSlide = props => {
7882
7959
  className: classes.bannerContainer
7883
7960
  }, /*#__PURE__*/React.createElement("div", {
7884
7961
  className: classes.bannerContainerText
7885
- }, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, " users now")) : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("div", {
7962
+ }, renderHurryUpBannerText())) : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("div", {
7886
7963
  className: classes.bannerContainer
7887
7964
  }, /*#__PURE__*/React.createElement("div", {
7888
7965
  className: classes.bannerContainerText
7889
- }, "Hurry up! Offer for limited period only"))), /*#__PURE__*/React.createElement("div", {
7966
+ }, limitedPeriodOfferText))), /*#__PURE__*/React.createElement("div", {
7890
7967
  className: classes.emblemContainer
7891
7968
  }, data?.courseOverviewData?.courseTagList.length && data?.courseOverviewData?.courseTagList?.map(data => {
7892
7969
  return /*#__PURE__*/React.createElement("div", {
@@ -7951,14 +8028,7 @@ const SingleVideoSlide = props => {
7951
8028
  }
7952
8029
  }, /*#__PURE__*/React.createElement("div", {
7953
8030
  className: classes.courseViewContainer
7954
- }, checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && /*#__PURE__*/React.createElement("p", {
7955
- className: classes.offerText
7956
- }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7957
- className: classes.courseDetailTime
7958
- }, /*#__PURE__*/React.createElement(Countdown, {
7959
- renderer: renderer,
7960
- date: data.endDate
7961
- }))), /*#__PURE__*/React.createElement("div", {
8031
+ }, checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && renderOfferEndsInText(), /*#__PURE__*/React.createElement("div", {
7962
8032
  ref: data?.videoFrame?.refSetter,
7963
8033
  className: classes.iframeContainer
7964
8034
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
@@ -7972,14 +8042,14 @@ const SingleVideoSlide = props => {
7972
8042
  className: classes.priceContainer
7973
8043
  }, /*#__PURE__*/React.createElement("div", {
7974
8044
  className: classes.offerPrice
7975
- }, "\u20B9 ", data.effectivePrice), checkForShowDiscount() && (data.endDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
8045
+ }, effectivePrice), checkForShowDiscount() && (data.endDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7976
8046
  style: {
7977
8047
  // fontSize: '20px',
7978
8048
  marginTop: '0px'
7979
8049
  }
7980
8050
  }, /*#__PURE__*/React.createElement("span", {
7981
8051
  className: classes.originalPrice
7982
- }, "\u20B9 ", data.price), ' ', /*#__PURE__*/React.createElement("span", {
8052
+ }, finalPrice), ' ', /*#__PURE__*/React.createElement("span", {
7983
8053
  className: classes.offerDiscount
7984
8054
  }, `${data && discount(data)}%`))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
7985
8055
  style: {
@@ -7988,7 +8058,7 @@ const SingleVideoSlide = props => {
7988
8058
  data: {
7989
8059
  // link: 'headerData?.loginCtaLink',
7990
8060
  // isLink: 1,
7991
- value: 'BUY NOW'
8061
+ value: buyNowText
7992
8062
  // isExternal: 1
7993
8063
  },
7994
8064
 
@@ -8024,10 +8094,12 @@ function CoursePromotionPage({
8024
8094
  sectionIndex
8025
8095
  }) {
8026
8096
  const {
8027
- isMobile,
8028
8097
  layout: {
8029
8098
  containerWidth
8030
- }
8099
+ },
8100
+ countryCode,
8101
+ currencySymbol,
8102
+ isMobile
8031
8103
  } = useContext(PageContext);
8032
8104
  const classes = useCoursePromotionPage({
8033
8105
  containerWidth,
@@ -8044,7 +8116,9 @@ function CoursePromotionPage({
8044
8116
  courseBuyNow: extraProps.courseBuyNow,
8045
8117
  showCourseInstallment: extraProps.showCourseInstallment,
8046
8118
  conversions: extraProps.conversions,
8047
- sectionIndex: sectionIndex
8119
+ sectionIndex: sectionIndex,
8120
+ countryCode: countryCode,
8121
+ currencySymbol: currencySymbol
8048
8122
  }))));
8049
8123
  }
8050
8124