diy-template-components 2.0.16 → 2.0.18

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
@@ -362,9 +362,10 @@ const buttonStyles = createUseStyles(theme => ({
362
362
  color: ({
363
363
  disabled
364
364
  } = {}) => disabled ? colorMixer(theme?.palette?.background?.default, 0.5).color : theme?.colors?.CtaTextColor,
365
- background: ({
365
+ background: theme?.colors?.ctaColor,
366
+ opacity: ({
366
367
  disabled
367
- } = {}) => disabled ? colorMixer(theme?.palette?.primary.main, 0.5).color : theme?.colors?.ctaColor,
368
+ } = {}) => disabled ? 0.5 : 1,
368
369
  border: 'none',
369
370
  textDecoration: 'none',
370
371
  cursor: ({
@@ -388,9 +389,10 @@ const buttonStyles = createUseStyles(theme => ({
388
389
  color: ({
389
390
  disabled
390
391
  } = {}) => disabled ? colorMixer(theme.palette.primary.main, 0.5).color : theme?.colors?.CtaTextColor,
391
- background: ({
392
+ background: theme?.colors?.ctaColor,
393
+ opacity: ({
392
394
  disabled
393
- } = {}) => disabled ? colorMixer(theme?.palette?.parimar?.default, 0.5).color : theme?.colors?.ctaColor,
395
+ } = {}) => disabled ? 0.5 : 1,
394
396
  border: ({
395
397
  disabled
396
398
  } = {}) => disabled ? `1px solid ${colorMixer(theme.palette.primary.main, 0.5).color}` : `1px solid ${theme?.colors?.ctaColor}`,
@@ -1081,6 +1083,7 @@ function OptionList({
1081
1083
  const downloadAppText = countryCode === 'KR' ? '앱다운로드' : 'Download App';
1082
1084
  const renderDownloadAppButton = () => {
1083
1085
  return /*#__PURE__*/React.createElement(React.Fragment, null, apkURL && /*#__PURE__*/React.createElement("a", {
1086
+ download: true,
1084
1087
  href: headerData?.apkURL,
1085
1088
  target: "_blank",
1086
1089
  className: classes.socialBtnItems,
@@ -1414,7 +1417,7 @@ function MobileHeader({
1414
1417
  onClick: () => {
1415
1418
  let url = getAppDownloadLink(apkURL, iosDownloadLink);
1416
1419
  window.open(url, '_blank');
1417
- if (url === apkURL && typeof onDownloadAppTriggered == 'function') {
1420
+ if (!header?.iosUrl && typeof onDownloadAppTriggered == 'function') {
1418
1421
  onDownloadAppTriggered(header?.isAndroidDelisted, header?.apkURL);
1419
1422
  }
1420
1423
  }
@@ -1449,7 +1452,7 @@ function MobileHeader({
1449
1452
  onClick: () => {
1450
1453
  let url = getAppDownloadLink(apkURL, iosDownloadLink);
1451
1454
  window.open(url, '_blank');
1452
- if (url === apkURL && typeof onDownloadAppTriggered == 'function') {
1455
+ if (!header?.iosUrl && typeof onDownloadAppTriggered == 'function') {
1453
1456
  onDownloadAppTriggered(header?.isAndroidDelisted, header?.apkURL);
1454
1457
  }
1455
1458
  }
@@ -1590,6 +1593,7 @@ const useSectionStyles$9 = createUseStyles(theme => ({
1590
1593
 
1591
1594
  // '& img': { maxHeight: '55px' }
1592
1595
  },
1596
+
1593
1597
  upperContainerItem1Img: {
1594
1598
  maxHeight: '55px',
1595
1599
  paddingBottom: '84px',
@@ -2016,6 +2020,7 @@ const mobilePadding = {
2016
2020
  // 24px
2017
2021
  medium: baseFactor * 6 // 48px
2018
2022
  };
2023
+
2019
2024
  const padding = {
2020
2025
  minute: baseFactor * 2,
2021
2026
  // 16px
@@ -2481,6 +2486,7 @@ const useSectionStyles$8 = createUseStyles(theme => ({
2481
2486
  // }
2482
2487
  // }
2483
2488
  },
2489
+
2484
2490
  sectionContainer: {
2485
2491
  margin: '0 auto',
2486
2492
  maxWidth: ({
@@ -3050,6 +3056,7 @@ const useSectionStyles$7 = createUseStyles(theme => ({
3050
3056
  // padding: '0'
3051
3057
  }
3052
3058
  },
3059
+
3053
3060
  '&:nth-child(2n+1)': {
3054
3061
  marginRight: '0',
3055
3062
  '& $contentText': {
@@ -3059,6 +3066,7 @@ const useSectionStyles$7 = createUseStyles(theme => ({
3059
3066
  }
3060
3067
  }
3061
3068
  },
3069
+
3062
3070
  contentNumber: {
3063
3071
  width: '100%',
3064
3072
  padding: '24px',
@@ -3451,6 +3459,7 @@ const useSectionStyles$5 = createUseStyles(theme => {
3451
3459
  // }
3452
3460
  // }
3453
3461
  },
3462
+
3454
3463
  sectionContainer: {
3455
3464
  margin: '0 auto',
3456
3465
  maxWidth: ({
@@ -3464,6 +3473,7 @@ const useSectionStyles$5 = createUseStyles(theme => {
3464
3473
 
3465
3474
  // padding: `${theme?.spacing?.padding?.regular}px ${theme?.spacing?.padding?.medium}px 0px ${theme?.spacing?.padding?.medium}px`
3466
3475
  },
3476
+
3467
3477
  imageContainerDiv: {
3468
3478
  width: '50%',
3469
3479
  position: 'relative'
@@ -3535,6 +3545,7 @@ const useSectionStyles$5 = createUseStyles(theme => {
3535
3545
  width: '100%'
3536
3546
  // padding: `${theme?.spacing?.padding?.medium}px ${theme?.spacing?.padding?.regular}px`
3537
3547
  },
3548
+
3538
3549
  imageContainer: {
3539
3550
  height: 'unset !important',
3540
3551
  '& img': {
@@ -4541,6 +4552,7 @@ const useVideoTestimonialStyles = createUseStyles(theme => {
4541
4552
  fontFamily: theme?.typography?.fontFamily
4542
4553
  // boxSizing: 'border-box'
4543
4554
  },
4555
+
4544
4556
  '& h2,& h3,& p': {
4545
4557
  marginTop: '0'
4546
4558
  }
@@ -4565,6 +4577,7 @@ const useVideoTestimonialStyles = createUseStyles(theme => {
4565
4577
  wordBreak: 'break-word'
4566
4578
  // marginBottom: '8px'
4567
4579
  },
4580
+
4568
4581
  videoTestimonialTitle: {
4569
4582
  fontSize: theme.typography.fontSize.h2,
4570
4583
  // lineHeight: '71px',
@@ -5005,6 +5018,7 @@ const useSectionStyles$3 = createUseStyles(theme => ({
5005
5018
  // }
5006
5019
  // }
5007
5020
  },
5021
+
5008
5022
  sectionContainer: {
5009
5023
  margin: '0 auto',
5010
5024
  maxWidth: ({
@@ -5362,6 +5376,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
5362
5376
  // }
5363
5377
  // }
5364
5378
  },
5379
+
5365
5380
  sectionContainer: {
5366
5381
  margin: '0 auto',
5367
5382
  maxWidth: ({
@@ -5392,6 +5407,7 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
5392
5407
  position: 'relative',
5393
5408
  paddingBottom: '59.83%' // keeping aspect ratio 585x350
5394
5409
  },
5410
+
5395
5411
  contentRow: {
5396
5412
  display: 'grid',
5397
5413
  gridTemplateColumns: ({
@@ -5938,6 +5954,7 @@ const useCourseStyles = createUseStyles(theme => {
5938
5954
  // }
5939
5955
  // }
5940
5956
  },
5957
+
5941
5958
  sectionContainer: {
5942
5959
  margin: '0 auto',
5943
5960
  maxWidth: ({
@@ -5970,6 +5987,7 @@ const useCourseStyles = createUseStyles(theme => {
5970
5987
  // textAlign: 'center',
5971
5988
  // wordBreak: 'break-word'
5972
5989
  },
5990
+
5973
5991
  slickContainer: {
5974
5992
  marginRight: '-20px'
5975
5993
  },
@@ -6017,6 +6035,7 @@ const useCourseStyles = createUseStyles(theme => {
6017
6035
  justifyContent: 'space-between'
6018
6036
  //alignItems: 'center',
6019
6037
  },
6038
+
6020
6039
  courseCardTags: {
6021
6040
  display: 'flex',
6022
6041
  justifyContent: 'flex-start',
@@ -6047,6 +6066,7 @@ const useCourseStyles = createUseStyles(theme => {
6047
6066
  // whiteSpace: 'nowrap',
6048
6067
  // textOverflow: 'ellipsis'
6049
6068
  },
6069
+
6050
6070
  courseCardDiscount: {
6051
6071
  display: 'flex',
6052
6072
  justifyContent: 'flex-start',
@@ -6153,6 +6173,7 @@ const useCourseStyles = createUseStyles(theme => {
6153
6173
  // whiteSpace: 'nowrap',
6154
6174
  // textOverflow: 'ellipsis'
6155
6175
  },
6176
+
6156
6177
  singleCard: {
6157
6178
  margin: '6px 2px'
6158
6179
  // width: 'calc(100% - 12px)'
@@ -6528,6 +6549,7 @@ const useTeamStyles = createUseStyles(theme => {
6528
6549
  margin: '20px 0 0'
6529
6550
  // overflowWrap: 'break-word'
6530
6551
  },
6552
+
6531
6553
  teamDetailsHeading: {
6532
6554
  fontSize: theme.typography.fontSize.h6,
6533
6555
  fontWeight: theme.typography.fontWeight.bold,
@@ -6571,6 +6593,7 @@ const useTeamStyles = createUseStyles(theme => {
6571
6593
  // margin: '15px 0 0',
6572
6594
  // paddingBottom: '0'
6573
6595
  },
6596
+
6574
6597
  teamDetailsHeading: {
6575
6598
  fontSize: '16px',
6576
6599
  lineHeight: '24px',
@@ -6703,6 +6726,7 @@ const useSectionStyles$1 = createUseStyles(theme => ({
6703
6726
  // }
6704
6727
  // }
6705
6728
  },
6729
+
6706
6730
  formContainer: {
6707
6731
  margin: '0 auto',
6708
6732
  maxWidth: ({
@@ -6739,12 +6763,14 @@ const useSectionStyles$1 = createUseStyles(theme => ({
6739
6763
  display: 'flex'
6740
6764
  // alignItems: 'flex-start',
6741
6765
  },
6766
+
6742
6767
  leftContainerForm: {
6743
6768
  width: '65%',
6744
6769
  display: 'flex',
6745
6770
  flexDirection: 'column'
6746
6771
  // justifyContent: 'space-between'
6747
6772
  },
6773
+
6748
6774
  subtitle: {
6749
6775
  // margin: '0 0 40px 0',
6750
6776
  fontSize: theme.typography.fontSize.h5,
@@ -6812,6 +6838,7 @@ const useSectionStyles$1 = createUseStyles(theme => ({
6812
6838
  width: '100%'
6813
6839
  // padding: '0 16ox'
6814
6840
  },
6841
+
6815
6842
  rightContainer: {
6816
6843
  width: '100%',
6817
6844
  padding: '0'
@@ -6863,6 +6890,7 @@ function FormEnquiry({
6863
6890
  isMobile
6864
6891
  });
6865
6892
  const [nodeData] = sectionData.components;
6893
+ const [isSubmitted, setIsSubmitted] = useState(false);
6866
6894
  const theme = useTheme();
6867
6895
  let [btnDisabled, setBtnDisabled] = useState(false);
6868
6896
  let formInitialValue = {
@@ -6879,12 +6907,12 @@ function FormEnquiry({
6879
6907
  messageValid: 1
6880
6908
  });
6881
6909
  useEffect(() => {
6882
- if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
6910
+ if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid && inputVal?.email && inputVal?.name && inputVal?.phone && inputVal?.message) {
6883
6911
  setBtnDisabled(false);
6884
6912
  } else {
6885
6913
  setBtnDisabled(true);
6886
6914
  }
6887
- }, [validData]);
6915
+ }, [validData, inputVal]);
6888
6916
  const handleSubmit = () => {
6889
6917
  let data = {
6890
6918
  sectionId: sectionData?._id || null,
@@ -6899,6 +6927,10 @@ function FormEnquiry({
6899
6927
  if (!(isPreview || isEdit)) postApiCall(baseURLs, data);
6900
6928
  setBtnDisabled(true);
6901
6929
  setInputVal(formInitialValue);
6930
+ setIsSubmitted(true);
6931
+ setTimeout(() => {
6932
+ setIsSubmitted(false);
6933
+ }, 1000);
6902
6934
  };
6903
6935
  const checkValidity = (regexField, fieldname, fieldValidity) => {
6904
6936
  if (validations?.[regexField]?.length) {
@@ -7079,7 +7111,7 @@ function FormEnquiry({
7079
7111
  className: classes.btnContainer
7080
7112
  }, /*#__PURE__*/React.createElement(Button, {
7081
7113
  ref: nodeData?.cta?.refSetter,
7082
- data: btnDisabled && validData?.messageValid && validData?.emailValid && validData?.nameValid && validData?.phoneValid ? {
7114
+ data: isSubmitted ? {
7083
7115
  value: 'Submitted'
7084
7116
  } : {
7085
7117
  value: nodeData.cta.metadata.value
@@ -7119,6 +7151,7 @@ const useSectionStyles = createUseStyles(theme => ({
7119
7151
  // }
7120
7152
  // }
7121
7153
  },
7154
+
7122
7155
  contactContainer: {
7123
7156
  width: '100%',
7124
7157
  margin: '0 auto',
@@ -7157,6 +7190,7 @@ const useSectionStyles = createUseStyles(theme => ({
7157
7190
  // justifyContent: 'space-between',
7158
7191
  // flex: 1
7159
7192
  },
7193
+
7160
7194
  subtitle: {
7161
7195
  // margin: '0 0 auto 0',
7162
7196
  fontSize: theme.typography.fontSize.h6,
@@ -7313,6 +7347,7 @@ function Contact({
7313
7347
  extraProps
7314
7348
  } = useContext(PageContext);
7315
7349
  let [btnDisabled, setBtnDisabled] = useState(false);
7350
+ const [isSubmitted, setIsSubmitted] = useState(false);
7316
7351
  const [nodeData] = sectionData.components;
7317
7352
  const classes = useSectionStyles({
7318
7353
  containerWidth,
@@ -7345,14 +7380,18 @@ function Contact({
7345
7380
  if (!(isPreview || isEdit)) postApiCall(baseURLs, data);
7346
7381
  setBtnDisabled(true);
7347
7382
  setInputVal(formInitialValue);
7383
+ setIsSubmitted(true);
7384
+ setTimeout(() => {
7385
+ setIsSubmitted(false);
7386
+ }, 1000);
7348
7387
  };
7349
7388
  useEffect(() => {
7350
- if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
7389
+ if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid && inputVal?.email && inputVal?.name && inputVal?.phone && inputVal?.message) {
7351
7390
  setBtnDisabled(false);
7352
7391
  } else {
7353
7392
  setBtnDisabled(true);
7354
7393
  }
7355
- }, [validData]);
7394
+ }, [validData, inputVal]);
7356
7395
  const checkValidity = (regexField, fieldname, fieldValidity) => {
7357
7396
  if (validations?.[regexField]?.length) {
7358
7397
  let regex = new RegExp(validations[regexField]);
@@ -7495,7 +7534,7 @@ function Contact({
7495
7534
  className: classes.btnContainer
7496
7535
  }, /*#__PURE__*/React.createElement(Button, {
7497
7536
  ref: nodeData?.cta?.refSetter,
7498
- data: btnDisabled && validData?.messageValid && validData?.emailValid && validData?.nameValid && validData?.phoneValid ? {
7537
+ data: isSubmitted ? {
7499
7538
  value: 'Submitted'
7500
7539
  } : {
7501
7540
  value: nodeData.cta.metadata.value
@@ -7596,6 +7635,7 @@ const useWebinarPromotionPage = createUseStyles(theme => {
7596
7635
  marginTop: '5%'
7597
7636
  // padding: '0px 5% 0px 5%'
7598
7637
  },
7638
+
7599
7639
  iframe: {
7600
7640
  position: 'absolute',
7601
7641
  width: '100%',
@@ -7943,6 +7983,7 @@ const SingleVideoSlide$1 = props => {
7943
7983
  value: data.isPaid ? buyNowText : registerNowText
7944
7984
  // isExternal: 1
7945
7985
  },
7986
+
7946
7987
  onClick: webinarCtaClick,
7947
7988
  type: 'primary',
7948
7989
  size: 'medium',
@@ -8011,6 +8052,7 @@ const useCoursePromotionPage = createUseStyles(theme => {
8011
8052
  // }
8012
8053
  // }
8013
8054
  },
8055
+
8014
8056
  sectionContainer: {
8015
8057
  margin: '0 auto',
8016
8058
  maxWidth: ({
@@ -8128,6 +8170,7 @@ const useCoursePromotionPage = createUseStyles(theme => {
8128
8170
  // paddingBottom: '10px',
8129
8171
  // paddingTop: '10px'
8130
8172
  },
8173
+
8131
8174
  bannerContainer: {
8132
8175
  width: '100%',
8133
8176
  background: theme?.colors?.bannerColor,
@@ -8142,6 +8185,7 @@ const useCoursePromotionPage = createUseStyles(theme => {
8142
8185
  clipPath: 'polygon(0 0, 100% 0, 100% calc(100% - 10px), 0 calc(100% - 10px), 15px calc(50% - 10px/2))'
8143
8186
  // marginBottom: '16px'
8144
8187
  },
8188
+
8145
8189
  bannerContainerText: {
8146
8190
  transform: 'rotate(180deg)'
8147
8191
  },
@@ -8254,6 +8298,7 @@ const useCoursePromotionPage = createUseStyles(theme => {
8254
8298
  height: 'max-content'
8255
8299
  // paddingRight: '10px'
8256
8300
  },
8301
+
8257
8302
  videoDetails: {
8258
8303
  width: '100%'
8259
8304
  },
@@ -8512,6 +8557,7 @@ const SingleVideoSlide = props => {
8512
8557
  value: buyNowText
8513
8558
  // isExternal: 1
8514
8559
  },
8560
+
8515
8561
  onClick: courseBuyNow,
8516
8562
  type: 'primary',
8517
8563
  size: 'medium',
@@ -8616,6 +8662,7 @@ const useFormPageStyles = createUseStyles(theme => ({
8616
8662
  // border: '1px solid #D8E0F0',
8617
8663
  // borderRadius: '16px'
8618
8664
  },
8665
+
8619
8666
  inputFieldLabel: {
8620
8667
  color: theme?.colors?.lightblack,
8621
8668
  fontSize: theme.typography.fontSize.body,
@@ -8928,6 +8975,7 @@ const FormPage = ({
8928
8975
  value: countryCode === 'KR' ? '제출하기' : 'SUBMIT'
8929
8976
  // isExternal: 1
8930
8977
  },
8978
+
8931
8979
  type: 'primary',
8932
8980
  size: 'medium',
8933
8981
  target: null,
@@ -9110,6 +9158,7 @@ const useEmailStyles = createUseStyles(theme => ({
9110
9158
  height: '48px'
9111
9159
  /* margin: 18px 0px; */
9112
9160
  },
9161
+
9113
9162
  'p-young-guru-title': {
9114
9163
  fontFamily: theme?.typography?.fontFamily,
9115
9164
  fontStyle: 'normal',
@@ -9137,6 +9186,7 @@ const useEmailStyles = createUseStyles(theme => ({
9137
9186
  textAlign: 'center'
9138
9187
  /* padding:35px 0 40px */
9139
9188
  },
9189
+
9140
9190
  'two-columns .column': {
9141
9191
  width: '100%',
9142
9192
  maxWidth: '275px',