diy-template-components 0.3.6 → 0.3.8

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
 
@@ -5844,7 +5848,7 @@ function CourseCard({
5844
5848
  const defaultCardImg = 'https://cp-assets-public.s3.ap-south-1.amazonaws.com/cams/cards-icon/default_course.png';
5845
5849
  const price = formatCurrency(countryCode, card?.price, currencySymbol);
5846
5850
  const finalPrice = formatCurrency(countryCode, card?.finalPrice, currencySymbol);
5847
- const buyNowText = countryCode === 'KR' ? '이 강좌를 수강하세요.' : 'Buy Now';
5851
+ const buyNowText = countryCode === 'KR' ? '이 웨비나 신청하기' : 'Buy Now';
5848
5852
  const offText = countryCode === 'KR' ? '할인' : 'OFF';
5849
5853
  return /*#__PURE__*/React.createElement("div", {
5850
5854
  className: classes.singleCard
@@ -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,52 @@ 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 handleReadMoreText = () => {
7419
+ if (countryCode === 'KR') {
7420
+ return '더 보기';
7421
+ } else {
7422
+ return 'Read More';
7423
+ }
7424
+ };
7425
+ const finalPrice = formatCurrency(countryCode, data?.price, currencySymbol);
7426
+ const buyNowText = countryCode === 'KR' ? '이 웨비나 신청하기' : 'BUY NOW';
7427
+ const registerNowText = countryCode === 'KR' ? '웨비나 신청하기' : 'REGISTER NOW';
7428
+ const momentLocale = countryCode === 'KR' ? 'KO' : 'IN';
7374
7429
  return /*#__PURE__*/React.createElement("div", {
7375
7430
  className: classes.videoCarouselContainer
7376
7431
  }, /*#__PURE__*/React.createElement("div", {
@@ -7383,11 +7438,11 @@ const SingleVideoSlide$1 = props => {
7383
7438
  className: classes.bannerContainer
7384
7439
  }, /*#__PURE__*/React.createElement("div", {
7385
7440
  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", {
7441
+ }, renderHurryUpBannerText())) : checkIfOfferIsValid() && data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : /*#__PURE__*/React.createElement("div", {
7387
7442
  className: classes.bannerContainer
7388
7443
  }, /*#__PURE__*/React.createElement("div", {
7389
7444
  className: classes.bannerContainerText
7390
- }, "Hurry up! Offer for limited period only"))), /*#__PURE__*/React.createElement("h3", {
7445
+ }, limitedPeriodOfferText))), /*#__PURE__*/React.createElement("h3", {
7391
7446
  ref: data?.videoTextHeading?.refSetter,
7392
7447
  className: classes.videoDetailsHeading,
7393
7448
  dangerouslySetInnerHTML: {
@@ -7402,7 +7457,7 @@ const SingleVideoSlide$1 = props => {
7402
7457
  }, /*#__PURE__*/React.createElement(Icon, {
7403
7458
  name: 'Calendar',
7404
7459
  color: theme.palette.primary.main
7405
- })), /*#__PURE__*/React.createElement("div", null, moment(data.startDate).format('Do MMM YY') + ' ', moment(data.startTime).format('h:mm A'), /*#__PURE__*/React.createElement("span", null, " - "), moment(data.endTime).format('h:mm A'))), /*#__PURE__*/React.createElement("div", {
7460
+ })), /*#__PURE__*/React.createElement("div", null, moment(data.startDate).locale(momentLocale).format('Do MMM YY') + ' ', moment(data.startTime).locale(momentLocale).format('h:mm A'), /*#__PURE__*/React.createElement("span", null, " - "), moment(data.endTime).locale(momentLocale).format('h:mm A'))), /*#__PURE__*/React.createElement("div", {
7406
7461
  className: classes.courseDetailTag
7407
7462
  }, /*#__PURE__*/React.createElement("span", {
7408
7463
  className: classes.iconBackground
@@ -7423,18 +7478,11 @@ const SingleVideoSlide$1 = props => {
7423
7478
  ref: data?.videoTextSubContent?.refSetter,
7424
7479
  className: classes.courseDetailViewFullDetails,
7425
7480
  dangerouslySetInnerHTML: {
7426
- __html: data.description.length > 250 && !isReadMore ? 'Read More' : null
7481
+ __html: data.description.length > 250 && !isReadMore ? handleReadMoreText() : null
7427
7482
  }
7428
7483
  }))), /*#__PURE__*/React.createElement("div", {
7429
7484
  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", {
7485
+ }, data.isPaid !== 0 && checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && renderOfferEndsInText(), /*#__PURE__*/React.createElement("div", {
7438
7486
  ref: data?.videoFrame?.refSetter,
7439
7487
  className: classes.iframeContainer
7440
7488
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
@@ -7451,13 +7499,13 @@ const SingleVideoSlide$1 = props => {
7451
7499
  className: classes.priceContainer
7452
7500
  }, /*#__PURE__*/React.createElement("div", {
7453
7501
  className: classes.offerPrice
7454
- }, "\u20B9", data?.effectivePrice), checkForShowDiscount() && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7502
+ }, effectivePrice), checkForShowDiscount() && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7455
7503
  style: {
7456
7504
  fontSize: '20px'
7457
7505
  }
7458
7506
  }, /*#__PURE__*/React.createElement("span", {
7459
7507
  className: classes.originalPrice
7460
- }, "\u20B9", data?.price), ' ', /*#__PURE__*/React.createElement("span", {
7508
+ }, finalPrice), ' ', /*#__PURE__*/React.createElement("span", {
7461
7509
  className: classes.offerDiscount
7462
7510
  }, `${data && discount(data)}%`))) : null, /*#__PURE__*/React.createElement("div", {
7463
7511
  className: classes.webinarButtonContainer
@@ -7469,7 +7517,7 @@ const SingleVideoSlide$1 = props => {
7469
7517
  data: {
7470
7518
  // link: 'headerData?.loginCtaLink',
7471
7519
  // isLink: 1,
7472
- value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
7520
+ value: data.isPaid ? buyNowText : registerNowText
7473
7521
  // isExternal: 1
7474
7522
  },
7475
7523
 
@@ -7487,10 +7535,12 @@ function CoursePromotionPage$1({
7487
7535
  sectionIndex
7488
7536
  }) {
7489
7537
  const {
7490
- isMobile,
7491
7538
  layout: {
7492
7539
  containerWidth
7493
- }
7540
+ },
7541
+ countryCode,
7542
+ currencySymbol,
7543
+ isMobile
7494
7544
  } = useContext(PageContext);
7495
7545
  const classes = useWebinarPromotionPage({
7496
7546
  containerWidth,
@@ -7506,7 +7556,9 @@ function CoursePromotionPage$1({
7506
7556
  data: sectionData.components[0].metadata,
7507
7557
  webinarCtaClick: extraProps.webinarCtaClick,
7508
7558
  conversions: extraProps.conversions,
7509
- sectionIndex: sectionIndex
7559
+ sectionIndex: sectionIndex,
7560
+ countryCode: countryCode,
7561
+ currencySymbol: currencySymbol
7510
7562
  }))));
7511
7563
  }
7512
7564
 
@@ -7826,18 +7878,23 @@ const SingleVideoSlide = props => {
7826
7878
  completed
7827
7879
  }) => {
7828
7880
  if (days === 0 && hours < 24) {
7881
+ if (countryCode === 'KR') {
7882
+ return /*#__PURE__*/React.createElement("span", null, hours, " \uC2DC\uAC04 ", minutes, " \uBD84 ", seconds, "\uCD08");
7883
+ }
7829
7884
  return /*#__PURE__*/React.createElement("span", null, hours, "h ", minutes, "m ", seconds, "s");
7830
7885
  } else {
7831
7886
  let given = moment(props.data.endDate);
7832
7887
  let current = moment().startOf('day');
7833
- return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " day(s)");
7888
+ return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), ' ', countryCode === 'KR' ? '일' : 'day(s)');
7834
7889
  }
7835
7890
  };
7836
7891
  const {
7837
7892
  data,
7838
7893
  courseBuyNow,
7839
7894
  conversions = 20,
7840
- showCourseInstallment
7895
+ showCourseInstallment,
7896
+ countryCode,
7897
+ currencySymbol
7841
7898
  } = props;
7842
7899
  const showCourseInstallmentData = data?.courseOverviewData;
7843
7900
  const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
@@ -7870,6 +7927,41 @@ const SingleVideoSlide = props => {
7870
7927
  }) => {
7871
7928
  return (discount / price * 100).toFixed(2);
7872
7929
  };
7930
+ const renderHurryUpBannerText = () => {
7931
+ return countryCode === 'KR' ? `서두르세요! 현재 신청 가능 인원은 ${data.offerPriceValidFor - conversions}명 입니다.` : `Hurry up! Offer left for ${data.offerPriceValidFor - conversions} users now`;
7932
+ };
7933
+ const limitedPeriodOfferText = countryCode === 'KR' ? `기간 한정 딜이므로 서두르세요!` : 'Hurry up! Offer for limited period only';
7934
+ const renderOfferEndsInText = () => {
7935
+ if (countryCode === 'KR') {
7936
+ return /*#__PURE__*/React.createElement("p", {
7937
+ className: classes.offerText
7938
+ }, /*#__PURE__*/React.createElement("span", {
7939
+ className: classes.courseDetailTime
7940
+ }, /*#__PURE__*/React.createElement(Countdown, {
7941
+ renderer: renderer,
7942
+ date: data.endDate
7943
+ })), ' ', "\uD6C4\xA0\uC2E0\uCCAD\xA0\uB9C8\uAC10\xA0\uC608\uC815");
7944
+ } else {
7945
+ return /*#__PURE__*/React.createElement("p", {
7946
+ className: classes.offerText
7947
+ }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7948
+ className: classes.courseDetailTime
7949
+ }, /*#__PURE__*/React.createElement(Countdown, {
7950
+ renderer: renderer,
7951
+ date: data.endDate
7952
+ })));
7953
+ }
7954
+ };
7955
+ const effectivePrice = formatCurrency(countryCode, data?.effectivePrice, currencySymbol);
7956
+ const finalPrice = formatCurrency(countryCode, data?.price, currencySymbol);
7957
+ const buyNowText = countryCode === 'KR' ? '이 웨비나 신청하기' : 'BUY NOW';
7958
+ const handleReadMoreText = () => {
7959
+ if (countryCode === 'KR') {
7960
+ return '더 보기';
7961
+ } else {
7962
+ return 'Read More';
7963
+ }
7964
+ };
7873
7965
  return /*#__PURE__*/React.createElement("div", {
7874
7966
  className: classes.videoCarouselContainer
7875
7967
  }, /*#__PURE__*/React.createElement("div", {
@@ -7882,11 +7974,11 @@ const SingleVideoSlide = props => {
7882
7974
  className: classes.bannerContainer
7883
7975
  }, /*#__PURE__*/React.createElement("div", {
7884
7976
  className: classes.bannerContainerText
7885
- }, "Hurry up! Offer left for", ' ', data.offerPriceValidFor - conversions, " users now")) : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("div", {
7977
+ }, renderHurryUpBannerText())) : checkIfOfferIsValid() && /*#__PURE__*/React.createElement("div", {
7886
7978
  className: classes.bannerContainer
7887
7979
  }, /*#__PURE__*/React.createElement("div", {
7888
7980
  className: classes.bannerContainerText
7889
- }, "Hurry up! Offer for limited period only"))), /*#__PURE__*/React.createElement("div", {
7981
+ }, limitedPeriodOfferText))), /*#__PURE__*/React.createElement("div", {
7890
7982
  className: classes.emblemContainer
7891
7983
  }, data?.courseOverviewData?.courseTagList.length && data?.courseOverviewData?.courseTagList?.map(data => {
7892
7984
  return /*#__PURE__*/React.createElement("div", {
@@ -7942,7 +8034,7 @@ const SingleVideoSlide = props => {
7942
8034
  ref: data?.videoTextSubContent?.refSetter,
7943
8035
  className: classes.courseDetailViewFullDetails,
7944
8036
  dangerouslySetInnerHTML: {
7945
- __html: data.description.length > 250 && !isReadMore ? 'Read More' : null
8037
+ __html: data.description.length > 250 && !isReadMore ? handleReadMoreText() : null
7946
8038
  }
7947
8039
  }))), /*#__PURE__*/React.createElement("div", {
7948
8040
  style: {
@@ -7951,14 +8043,7 @@ const SingleVideoSlide = props => {
7951
8043
  }
7952
8044
  }, /*#__PURE__*/React.createElement("div", {
7953
8045
  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", {
8046
+ }, checkIfOfferIsValid() && (data.offerPriceValidFor !== null ? data.offerPriceValidFor - conversions > 0 : true) && renderOfferEndsInText(), /*#__PURE__*/React.createElement("div", {
7962
8047
  ref: data?.videoFrame?.refSetter,
7963
8048
  className: classes.iframeContainer
7964
8049
  }, /*#__PURE__*/React.createElement(VideoPlayer, {
@@ -7972,14 +8057,14 @@ const SingleVideoSlide = props => {
7972
8057
  className: classes.priceContainer
7973
8058
  }, /*#__PURE__*/React.createElement("div", {
7974
8059
  className: classes.offerPrice
7975
- }, "\u20B9 ", data.effectivePrice), checkForShowDiscount() && (data.endDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
8060
+ }, effectivePrice), checkForShowDiscount() && (data.endDate ? checkIfOfferIsValid() : true) && /*#__PURE__*/React.createElement("p", {
7976
8061
  style: {
7977
8062
  // fontSize: '20px',
7978
8063
  marginTop: '0px'
7979
8064
  }
7980
8065
  }, /*#__PURE__*/React.createElement("span", {
7981
8066
  className: classes.originalPrice
7982
- }, "\u20B9 ", data.price), ' ', /*#__PURE__*/React.createElement("span", {
8067
+ }, finalPrice), ' ', /*#__PURE__*/React.createElement("span", {
7983
8068
  className: classes.offerDiscount
7984
8069
  }, `${data && discount(data)}%`))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
7985
8070
  style: {
@@ -7988,7 +8073,7 @@ const SingleVideoSlide = props => {
7988
8073
  data: {
7989
8074
  // link: 'headerData?.loginCtaLink',
7990
8075
  // isLink: 1,
7991
- value: 'BUY NOW'
8076
+ value: buyNowText
7992
8077
  // isExternal: 1
7993
8078
  },
7994
8079
 
@@ -8024,10 +8109,12 @@ function CoursePromotionPage({
8024
8109
  sectionIndex
8025
8110
  }) {
8026
8111
  const {
8027
- isMobile,
8028
8112
  layout: {
8029
8113
  containerWidth
8030
- }
8114
+ },
8115
+ countryCode,
8116
+ currencySymbol,
8117
+ isMobile
8031
8118
  } = useContext(PageContext);
8032
8119
  const classes = useCoursePromotionPage({
8033
8120
  containerWidth,
@@ -8044,7 +8131,9 @@ function CoursePromotionPage({
8044
8131
  courseBuyNow: extraProps.courseBuyNow,
8045
8132
  showCourseInstallment: extraProps.showCourseInstallment,
8046
8133
  conversions: extraProps.conversions,
8047
- sectionIndex: sectionIndex
8134
+ sectionIndex: sectionIndex,
8135
+ countryCode: countryCode,
8136
+ currencySymbol: currencySymbol
8048
8137
  }))));
8049
8138
  }
8050
8139
 
@@ -8217,7 +8306,8 @@ const FormPage = ({
8217
8306
  const {
8218
8307
  _id,
8219
8308
  baseURLs,
8220
- isMobile
8309
+ isMobile,
8310
+ countryCode
8221
8311
  } = useContext(PageContext);
8222
8312
  const classes = useFormPageStyles({
8223
8313
  isMobile
@@ -8402,7 +8492,7 @@ const FormPage = ({
8402
8492
  data: {
8403
8493
  // link: 'headerData?.loginCtaLink',
8404
8494
  // isLink: 1,
8405
- value: 'SUBMIT'
8495
+ value: countryCode === 'KR' ? '제출하기' : 'SUBMIT'
8406
8496
  // isExternal: 1
8407
8497
  },
8408
8498