diy-template-components 0.2.21 → 0.2.22
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/650233e8e2d7dfee.png +0 -0
- package/build/d15660fcfffcc0c8.png +0 -0
- package/build/index.es.js +239 -145
- package/build/index.es.js.map +1 -1
- package/build/index.js +239 -145
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
function ___$insertStyle(css) {
|
|
6
|
-
if (!css ||
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
const style = document.createElement('style');
|
|
10
|
-
style.setAttribute('type', 'text/css');
|
|
11
|
-
style.innerHTML = css;
|
|
12
|
-
document.head.appendChild(style);
|
|
13
|
-
return css;
|
|
5
|
+
function ___$insertStyle(css) {
|
|
6
|
+
if (!css || !window) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const style = document.createElement('style');
|
|
10
|
+
style.setAttribute('type', 'text/css');
|
|
11
|
+
style.innerHTML = css;
|
|
12
|
+
document.head.appendChild(style);
|
|
13
|
+
return css;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -33,17 +33,20 @@ var Countdown__default = /*#__PURE__*/_interopDefaultLegacy(Countdown);
|
|
|
33
33
|
var ReactDOMServer__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOMServer);
|
|
34
34
|
|
|
35
35
|
function _extends() {
|
|
36
|
-
_extends = Object.assign
|
|
36
|
+
_extends = Object.assign || function (target) {
|
|
37
37
|
for (var i = 1; i < arguments.length; i++) {
|
|
38
38
|
var source = arguments[i];
|
|
39
|
+
|
|
39
40
|
for (var key in source) {
|
|
40
41
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
41
42
|
target[key] = source[key];
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
|
|
45
47
|
return target;
|
|
46
48
|
};
|
|
49
|
+
|
|
47
50
|
return _extends.apply(this, arguments);
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -299,17 +302,21 @@ const alpha = {
|
|
|
299
302
|
seventyPercent: 0.7,
|
|
300
303
|
eightyPercent: 0.8
|
|
301
304
|
};
|
|
305
|
+
|
|
302
306
|
const getRGBFromHex = hex => {
|
|
303
307
|
const r = parseInt(hex.slice(1, 3), 16);
|
|
304
308
|
const g = parseInt(hex.slice(3, 5), 16);
|
|
305
309
|
const b = parseInt(hex.slice(5, 7), 16);
|
|
306
310
|
return [r, g, b];
|
|
307
311
|
};
|
|
312
|
+
|
|
308
313
|
const hexToRgbA = (hex, alpha = null) => {
|
|
309
314
|
const values = getRGBFromHex(hex);
|
|
315
|
+
|
|
310
316
|
if (alpha !== null) {
|
|
311
317
|
values.push(alpha);
|
|
312
318
|
}
|
|
319
|
+
|
|
313
320
|
return `rgba(${values.join(',')})`;
|
|
314
321
|
};
|
|
315
322
|
const colorMixer = (hex1, weightage = 1, hex2 = colors.white) => {
|
|
@@ -449,24 +456,29 @@ function useLinkBuilder(data) {
|
|
|
449
456
|
basePath,
|
|
450
457
|
isMasterTemplate
|
|
451
458
|
} = React.useContext(PageContext);
|
|
459
|
+
|
|
452
460
|
if (isEdit || !data.isLink) {
|
|
453
461
|
return null;
|
|
454
462
|
}
|
|
463
|
+
|
|
455
464
|
if (data?.isExistingLink === false) {
|
|
456
465
|
return data.link;
|
|
457
466
|
}
|
|
467
|
+
|
|
458
468
|
if (data?.isExternal) {
|
|
459
469
|
return data.link;
|
|
460
470
|
}
|
|
471
|
+
|
|
461
472
|
if (!isPreview) {
|
|
462
473
|
const link = data.link === '/' ? '' : '/' + data.link;
|
|
463
474
|
return basePath ? `//${basePath}${link}` : null;
|
|
464
|
-
}
|
|
475
|
+
} // courses in preview: special case
|
|
476
|
+
|
|
465
477
|
|
|
466
|
-
// courses in preview: special case
|
|
467
478
|
if (data.link === 'courses') {
|
|
468
479
|
return `//${basePath}/courses`;
|
|
469
480
|
}
|
|
481
|
+
|
|
470
482
|
const {
|
|
471
483
|
pageId
|
|
472
484
|
} = navList.find(el => el.slug === data?.link) || {};
|
|
@@ -642,12 +654,14 @@ var calendar$1 = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2218%
|
|
|
642
654
|
var video = "data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M15.8625%205.1275C15.555%204.9625%2014.91%204.79%2014.0325%205.405L12.93%206.185C12.8475%203.8525%2011.835%202.9375%209.375%202.9375H4.875C2.31%202.9375%201.3125%203.935%201.3125%206.5V12.5C1.3125%2014.225%202.25%2016.0625%204.875%2016.0625H9.375C11.835%2016.0625%2012.8475%2015.1475%2012.93%2012.815L14.0325%2013.595C14.4975%2013.925%2014.9025%2014.03%2015.225%2014.03C15.5025%2014.03%2015.72%2013.9475%2015.8625%2013.8725C16.17%2013.715%2016.6875%2013.2875%2016.6875%2012.215V6.785C16.6875%205.7125%2016.17%205.285%2015.8625%205.1275ZM8.25%209.035C7.4775%209.035%206.84%208.405%206.84%207.625C6.84%206.845%207.4775%206.215%208.25%206.215C9.0225%206.215%209.66%206.845%209.66%207.625C9.66%208.405%209.0225%209.035%208.25%209.035Z%22%20fill%3D%22%23589DF5%22%2F%3E%3C%2Fsvg%3E";
|
|
643
655
|
|
|
644
656
|
/** @returns {import('./types').IconData} */
|
|
657
|
+
|
|
645
658
|
const getConfiguredIcon1 = url => ({
|
|
646
659
|
url,
|
|
647
660
|
svgChildrenConfigs: []
|
|
648
661
|
});
|
|
649
|
-
|
|
650
662
|
/** @returns {import('./types').IconData} */
|
|
663
|
+
|
|
664
|
+
|
|
651
665
|
const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
652
666
|
url,
|
|
653
667
|
svgChildrenConfigs: [{
|
|
@@ -656,6 +670,7 @@ const getConfiguredIcon2 = (url, stroke, fill) => ({
|
|
|
656
670
|
fill
|
|
657
671
|
}]
|
|
658
672
|
});
|
|
673
|
+
|
|
659
674
|
const icons = {
|
|
660
675
|
'Live class': getConfiguredIcon2(liveTv, false, true),
|
|
661
676
|
'Recorded videos': getConfiguredIcon2(liveTv2, false, true),
|
|
@@ -688,51 +703,41 @@ const icons = {
|
|
|
688
703
|
'Video Play': getConfiguredIcon2(videoPlay, false, true),
|
|
689
704
|
Quote: getConfiguredIcon2(quote, false, true),
|
|
690
705
|
// Stock
|
|
691
|
-
|
|
692
706
|
'Stock Growth': getConfiguredIcon2(stockGrowth, false, true),
|
|
693
707
|
Money: getConfiguredIcon2(money, false, true),
|
|
694
708
|
Split: getConfiguredIcon2(split, false, true),
|
|
695
709
|
Chart: getConfiguredIcon2(chart, false, true),
|
|
696
710
|
// Personality Development
|
|
697
|
-
|
|
698
711
|
Leaders: getConfiguredIcon2(leaders, false, true),
|
|
699
712
|
Women: getConfiguredIcon2(women, false, true),
|
|
700
713
|
Program: getConfiguredIcon2(program, false, true),
|
|
701
714
|
// Photography
|
|
702
|
-
|
|
703
715
|
'Video Editing': getConfiguredIcon2(videoEditing, false, true),
|
|
704
716
|
Editing: getConfiguredIcon2(editing, false, true),
|
|
705
717
|
Camera: getConfiguredIcon2(camera, false, true),
|
|
706
718
|
Sessions: getConfiguredIcon2(sessions, false, true),
|
|
707
719
|
// Computer
|
|
708
|
-
|
|
709
720
|
'Regular Batches': getConfiguredIcon2(regularBatches, false, true),
|
|
710
721
|
'Alternate Batches': getConfiguredIcon2(alternateBatches, false, true),
|
|
711
722
|
'Weekend Batches': getConfiguredIcon2(weekendBatches, false, true),
|
|
712
723
|
// Life Coach
|
|
713
|
-
|
|
714
724
|
Girl: getConfiguredIcon2(girl, false, true),
|
|
715
725
|
Smile: getConfiguredIcon2(smile, false, true),
|
|
716
726
|
Relationships: getConfiguredIcon2(relationships, false, true),
|
|
717
727
|
// Music
|
|
718
|
-
|
|
719
728
|
Vocal: getConfiguredIcon2(vocal, false, true),
|
|
720
729
|
Instrument: getConfiguredIcon2(instrument, false, true),
|
|
721
730
|
Music: getConfiguredIcon2(music, false, true),
|
|
722
731
|
// Fitness
|
|
723
|
-
|
|
724
732
|
Workout: getConfiguredIcon2(workout, false, true),
|
|
725
733
|
Barbell: getConfiguredIcon2(barbell, false, true),
|
|
726
734
|
Trainer: getConfiguredIcon2(trainer, false, true),
|
|
727
735
|
Report: getConfiguredIcon2(report, false, true),
|
|
728
736
|
// Govt Exam
|
|
729
|
-
|
|
730
737
|
'Govt Exam': getConfiguredIcon2(govtExam, false, true),
|
|
731
738
|
// IIT JEE
|
|
732
|
-
|
|
733
739
|
College: getConfiguredIcon2(college, false, true),
|
|
734
740
|
// Others
|
|
735
|
-
|
|
736
741
|
Teachers: getConfiguredIcon2(teachers, false, true),
|
|
737
742
|
Learning: getConfiguredIcon2(learning, false, true),
|
|
738
743
|
Success: getConfiguredIcon2(success, false, true),
|
|
@@ -744,9 +749,12 @@ const icons = {
|
|
|
744
749
|
Video: getConfiguredIcon2(video, false, true)
|
|
745
750
|
};
|
|
746
751
|
|
|
747
|
-
const someMethod1 = (
|
|
752
|
+
const someMethod1 = (
|
|
753
|
+
/** @type {import('./types').IconData["svgChildrenConfigs"]} */
|
|
754
|
+
svgChildrenConfigs, color, hoverColor) => {
|
|
748
755
|
/** @type {{ [k:string]:React.CSSProperties; }} */
|
|
749
756
|
const obj = {};
|
|
757
|
+
|
|
750
758
|
for (const svgChildConfig of svgChildrenConfigs) {
|
|
751
759
|
if (color) obj['& ' + svgChildConfig.selector] = {
|
|
752
760
|
fill: svgChildConfig.fill ? color : undefined,
|
|
@@ -757,8 +765,10 @@ const someMethod1 = ( /** @type {import('./types').IconData["svgChildrenConfigs"
|
|
|
757
765
|
stroke: svgChildConfig.stroke ? hoverColor : undefined
|
|
758
766
|
};
|
|
759
767
|
}
|
|
768
|
+
|
|
760
769
|
return obj;
|
|
761
770
|
};
|
|
771
|
+
|
|
762
772
|
const useStyles$1 = reactJss.createUseStyles({
|
|
763
773
|
'@keyframes slideRight': {
|
|
764
774
|
to: {
|
|
@@ -802,8 +812,8 @@ const defaultSvgState = {
|
|
|
802
812
|
childrenConfigs: [],
|
|
803
813
|
attributes: defaultAttributes
|
|
804
814
|
};
|
|
805
|
-
|
|
806
815
|
/** @type {import('./props.type').IconProps} */
|
|
816
|
+
|
|
807
817
|
const iconDefaultProps = {
|
|
808
818
|
name: undefined,
|
|
809
819
|
width: 'auto',
|
|
@@ -813,8 +823,8 @@ const iconDefaultProps = {
|
|
|
813
823
|
opacity: undefined,
|
|
814
824
|
className: undefined
|
|
815
825
|
};
|
|
816
|
-
|
|
817
826
|
/** @type {import("react").FC<import('./props.type').IconProps>} */
|
|
827
|
+
|
|
818
828
|
const Icon = ({
|
|
819
829
|
name,
|
|
820
830
|
width,
|
|
@@ -833,8 +843,10 @@ const Icon = ({
|
|
|
833
843
|
}, []);
|
|
834
844
|
/** */
|
|
835
845
|
|
|
836
|
-
const rootRef = React.useRef(
|
|
837
|
-
|
|
846
|
+
const rootRef = React.useRef(
|
|
847
|
+
/** @type {HTMLElement} */
|
|
848
|
+
null); // this ref is used to cancel the fetch promise success callback in case name prop changed
|
|
849
|
+
|
|
838
850
|
const currentName = React.useRef(name);
|
|
839
851
|
const [svgState, setSvgState] = React.useState(defaultSvgState);
|
|
840
852
|
const styles = useStyles$1({
|
|
@@ -845,41 +857,46 @@ const Icon = ({
|
|
|
845
857
|
opacity,
|
|
846
858
|
hoverColor
|
|
847
859
|
});
|
|
860
|
+
|
|
848
861
|
const _className = React.useMemo(() => `${styles.root} ${className || ''}`, [className]);
|
|
862
|
+
|
|
849
863
|
React.useEffect(() => {
|
|
850
864
|
// reset
|
|
851
865
|
currentName.current = name;
|
|
852
866
|
setSvgState(defaultSvgState);
|
|
853
867
|
const icon = icons[name];
|
|
868
|
+
|
|
854
869
|
if (icon) {
|
|
855
870
|
/**
|
|
856
871
|
* retrieve from cache
|
|
857
872
|
* @type {Promise<string>}
|
|
858
873
|
*/
|
|
859
874
|
let svgProm = Icon.getCachedSvgPromise(name);
|
|
875
|
+
|
|
860
876
|
if (!svgProm) {
|
|
861
877
|
svgProm = fetch(icon.url).then(r => r.text()).catch(() => {
|
|
862
878
|
// unset in cache
|
|
863
879
|
Icon.setCachedSvgPromise(name, undefined);
|
|
864
880
|
return null;
|
|
865
|
-
});
|
|
866
|
-
|
|
881
|
+
}); //save in cache
|
|
882
|
+
|
|
867
883
|
Icon.setCachedSvgPromise(name, svgProm);
|
|
868
884
|
}
|
|
885
|
+
|
|
869
886
|
svgProm.then(svg => {
|
|
870
887
|
if (svg && isMounted.current && name === currentName.current) {
|
|
871
888
|
const div = document.createElement('div');
|
|
872
|
-
div.innerHTML = svg;
|
|
889
|
+
div.innerHTML = svg; // set the new attributes
|
|
873
890
|
|
|
874
|
-
// set the new attributes
|
|
875
891
|
const newAttributes = {};
|
|
892
|
+
|
|
876
893
|
for (const ob of div.firstElementChild.attributes) {
|
|
877
894
|
const camelCased = ob.name.replace(/(-|:)([a-z])/g, g => g[1].toUpperCase());
|
|
878
895
|
newAttributes[camelCased] = ob.value;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
// setting the state in last.
|
|
896
|
+
} // setting the state in last.
|
|
882
897
|
// Set state calls are called immediately inside asynchronous operations, timeouts, and intervals.
|
|
898
|
+
|
|
899
|
+
|
|
883
900
|
setSvgState({
|
|
884
901
|
innerHtml: div.firstElementChild.innerHTML,
|
|
885
902
|
childrenConfigs: icon.svgChildrenConfigs,
|
|
@@ -899,11 +916,14 @@ const Icon = ({
|
|
|
899
916
|
onClick: onClick
|
|
900
917
|
}));
|
|
901
918
|
};
|
|
902
|
-
Icon.defaultProps = iconDefaultProps;
|
|
903
919
|
|
|
920
|
+
Icon.defaultProps = iconDefaultProps;
|
|
904
921
|
/** static properties for caching */
|
|
922
|
+
|
|
905
923
|
Icon.cacheStore = {};
|
|
924
|
+
|
|
906
925
|
Icon.getCachedSvgPromise = name => Icon.cacheStore[name];
|
|
926
|
+
|
|
907
927
|
Icon.setCachedSvgPromise = (name, prom) => Icon.cacheStore[name] = prom;
|
|
908
928
|
|
|
909
929
|
const useDropdownStyles = createUseStyles(theme => ({
|
|
@@ -1015,6 +1035,7 @@ function OptionList({
|
|
|
1015
1035
|
isLandingPages
|
|
1016
1036
|
}) {
|
|
1017
1037
|
React.useContext(PageContext);
|
|
1038
|
+
|
|
1018
1039
|
const tabsDataModifier = () => {
|
|
1019
1040
|
return optionsData?.map(dt => {
|
|
1020
1041
|
return {
|
|
@@ -1026,6 +1047,7 @@ function OptionList({
|
|
|
1026
1047
|
};
|
|
1027
1048
|
});
|
|
1028
1049
|
};
|
|
1050
|
+
|
|
1029
1051
|
const tabData = tabsDataModifier();
|
|
1030
1052
|
const classes = useSectionStyles$a();
|
|
1031
1053
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -1114,24 +1136,31 @@ function DesktopHeader({
|
|
|
1114
1136
|
const classes = useSectionStyles$a({
|
|
1115
1137
|
isFixed
|
|
1116
1138
|
});
|
|
1139
|
+
|
|
1117
1140
|
const optionDataFn = () => {
|
|
1118
1141
|
let optionsArr = navData;
|
|
1119
1142
|
let optionsData = [];
|
|
1143
|
+
|
|
1120
1144
|
if (optionsArr?.length > 5) {
|
|
1121
1145
|
optionsData = optionsArr?.slice(0, 4);
|
|
1122
1146
|
} else {
|
|
1123
1147
|
optionsData = optionsArr;
|
|
1124
1148
|
}
|
|
1149
|
+
|
|
1125
1150
|
return optionsData;
|
|
1126
1151
|
};
|
|
1152
|
+
|
|
1127
1153
|
const moreContentFn = () => {
|
|
1128
1154
|
let optionsArr = navData;
|
|
1129
1155
|
let moreContent = [];
|
|
1156
|
+
|
|
1130
1157
|
if (optionsArr?.length > 5) {
|
|
1131
1158
|
moreContent = optionsArr?.slice(4);
|
|
1132
1159
|
}
|
|
1160
|
+
|
|
1133
1161
|
return moreContent;
|
|
1134
1162
|
};
|
|
1163
|
+
|
|
1135
1164
|
return /*#__PURE__*/React__default["default"].createElement("nav", {
|
|
1136
1165
|
className: classes.section
|
|
1137
1166
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -1189,6 +1218,7 @@ function MobileHeader({
|
|
|
1189
1218
|
const navEl = React.useRef(null);
|
|
1190
1219
|
React.useLayoutEffect(() => {
|
|
1191
1220
|
const body = navEl?.current?.ownerDocument?.body;
|
|
1221
|
+
|
|
1192
1222
|
if (sideMenu) {
|
|
1193
1223
|
body?.setAttribute('style', 'overflow: hidden;');
|
|
1194
1224
|
} else {
|
|
@@ -1198,6 +1228,7 @@ function MobileHeader({
|
|
|
1198
1228
|
let iosUrl = null;
|
|
1199
1229
|
let androidUrl = null;
|
|
1200
1230
|
let downloadLink = null;
|
|
1231
|
+
|
|
1201
1232
|
if (isTutorWebsite) {
|
|
1202
1233
|
if (header?.iosUrl) {
|
|
1203
1234
|
iosUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
@@ -1220,6 +1251,7 @@ function MobileHeader({
|
|
|
1220
1251
|
}
|
|
1221
1252
|
});
|
|
1222
1253
|
}
|
|
1254
|
+
|
|
1223
1255
|
if (header?.androidURL) {
|
|
1224
1256
|
androidUrl = /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
1225
1257
|
data: {
|
|
@@ -1240,6 +1272,7 @@ function MobileHeader({
|
|
|
1240
1272
|
}
|
|
1241
1273
|
});
|
|
1242
1274
|
}
|
|
1275
|
+
|
|
1243
1276
|
if (iosUrl && androidUrl) {
|
|
1244
1277
|
downloadLink = /*#__PURE__*/React__default["default"].createElement("div", null, iosUrl, androidUrl);
|
|
1245
1278
|
} else if (header?.iosUrl) {
|
|
@@ -1289,6 +1322,7 @@ function MobileHeader({
|
|
|
1289
1322
|
downloadLink = null;
|
|
1290
1323
|
}
|
|
1291
1324
|
}
|
|
1325
|
+
|
|
1292
1326
|
return /*#__PURE__*/React__default["default"].createElement("nav", {
|
|
1293
1327
|
ref: navEl,
|
|
1294
1328
|
className: classes.section
|
|
@@ -1345,9 +1379,11 @@ function Header({
|
|
|
1345
1379
|
isMobile,
|
|
1346
1380
|
isTutorWebsite
|
|
1347
1381
|
} = React.useContext(PageContext);
|
|
1382
|
+
|
|
1348
1383
|
const filterHiddenNavs = () => {
|
|
1349
1384
|
return data?.navs?.filter(dt => !dt.isHiddenNav);
|
|
1350
1385
|
};
|
|
1386
|
+
|
|
1351
1387
|
return isMobile ? /*#__PURE__*/React__default["default"].createElement(MobileHeader, {
|
|
1352
1388
|
navData: filterHiddenNavs(),
|
|
1353
1389
|
header: data,
|
|
@@ -1703,6 +1739,7 @@ const rustTheme = {
|
|
|
1703
1739
|
light: colors.lightRust,
|
|
1704
1740
|
lightest: colors.lightestRust
|
|
1705
1741
|
};
|
|
1742
|
+
|
|
1706
1743
|
const generateThemePalette = themeColors => ({
|
|
1707
1744
|
primary: themeColors,
|
|
1708
1745
|
background: {
|
|
@@ -1725,6 +1762,7 @@ const generateThemePalette = themeColors => ({
|
|
|
1725
1762
|
tertiary: colors.blueGrey
|
|
1726
1763
|
}
|
|
1727
1764
|
});
|
|
1765
|
+
|
|
1728
1766
|
const bluePalette = generateThemePalette(blueTheme);
|
|
1729
1767
|
const redPalette = generateThemePalette(redTheme);
|
|
1730
1768
|
const orangePalette = generateThemePalette(orangeTheme);
|
|
@@ -1765,7 +1803,9 @@ const fontComponents = {
|
|
|
1765
1803
|
'Merriweather Sans': MerriweatherSans,
|
|
1766
1804
|
'Arima Madurai': ArimaMadurai
|
|
1767
1805
|
};
|
|
1806
|
+
|
|
1768
1807
|
const getFontComponent = font => fontComponents[font] || (() => null);
|
|
1808
|
+
|
|
1769
1809
|
function FontSeeder({
|
|
1770
1810
|
fontFamily
|
|
1771
1811
|
}) {
|
|
@@ -1775,30 +1815,37 @@ function FontSeeder({
|
|
|
1775
1815
|
const useRubikFont = reactJss.createUseStyles({
|
|
1776
1816
|
'@import': `url('https://fonts.googleapis.com/css2?family=Lato&family=Rubik:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap')`
|
|
1777
1817
|
});
|
|
1818
|
+
|
|
1778
1819
|
function Rubik() {
|
|
1779
1820
|
// to import "Rubik" font css
|
|
1780
1821
|
useRubikFont();
|
|
1781
1822
|
return null;
|
|
1782
1823
|
}
|
|
1824
|
+
|
|
1783
1825
|
const useIbmPlexSansFont = reactJss.createUseStyles({
|
|
1784
1826
|
'@import': 'url(https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
|
|
1785
1827
|
});
|
|
1828
|
+
|
|
1786
1829
|
function IbmPlexSans() {
|
|
1787
1830
|
// to import "Ibm Plex Sans" font css
|
|
1788
1831
|
useIbmPlexSansFont();
|
|
1789
1832
|
return null;
|
|
1790
1833
|
}
|
|
1834
|
+
|
|
1791
1835
|
const useMerriweatherSansFont = reactJss.createUseStyles({
|
|
1792
1836
|
'@import': 'url(https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap)'
|
|
1793
1837
|
});
|
|
1838
|
+
|
|
1794
1839
|
function MerriweatherSans() {
|
|
1795
1840
|
// to import "Merriweather Sans" font css
|
|
1796
1841
|
useMerriweatherSansFont();
|
|
1797
1842
|
return null;
|
|
1798
1843
|
}
|
|
1844
|
+
|
|
1799
1845
|
const useArimaMaduraiFont = reactJss.createUseStyles({
|
|
1800
1846
|
'@import': 'url(https://fonts.googleapis.com/css2?family=Arima+Madurai:wght@400;500;700&display=swap)'
|
|
1801
1847
|
});
|
|
1848
|
+
|
|
1802
1849
|
function ArimaMadurai() {
|
|
1803
1850
|
// to import "Arima Madurai" font css
|
|
1804
1851
|
useArimaMaduraiFont();
|
|
@@ -1829,7 +1876,9 @@ const TYPE_TO_COMPONENT_MAP$1 = {
|
|
|
1829
1876
|
TILES_SECTION: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index$1; })),
|
|
1830
1877
|
EMAIL_DRIP_MARKET: /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return index; }))
|
|
1831
1878
|
};
|
|
1879
|
+
|
|
1832
1880
|
const getCompToRender$1 = type => TYPE_TO_COMPONENT_MAP$1[type] || (() => null);
|
|
1881
|
+
|
|
1833
1882
|
const MemoisedSection$1 = /*#__PURE__*/React.memo(({
|
|
1834
1883
|
sectionData,
|
|
1835
1884
|
extraProps
|
|
@@ -1846,7 +1895,9 @@ function SectionRenderer$1({
|
|
|
1846
1895
|
extraProps
|
|
1847
1896
|
}) {
|
|
1848
1897
|
return /*#__PURE__*/React__default["default"].createElement(React.Suspense, {
|
|
1849
|
-
fallback: null
|
|
1898
|
+
fallback: null
|
|
1899
|
+
/*GIF maybe*/
|
|
1900
|
+
|
|
1850
1901
|
}, /*#__PURE__*/React__default["default"].createElement(MemoisedSection$1, {
|
|
1851
1902
|
sectionData: sectionData,
|
|
1852
1903
|
extraProps: extraProps
|
|
@@ -2130,18 +2181,23 @@ const getArrowRotationAngle = props => {
|
|
|
2130
2181
|
switch (true) {
|
|
2131
2182
|
case props.left:
|
|
2132
2183
|
return 180;
|
|
2184
|
+
|
|
2133
2185
|
case props.up:
|
|
2134
2186
|
return 270;
|
|
2187
|
+
|
|
2135
2188
|
case props.down:
|
|
2136
2189
|
return 90;
|
|
2190
|
+
|
|
2137
2191
|
case props.right:
|
|
2138
2192
|
default:
|
|
2139
2193
|
return 0;
|
|
2140
2194
|
}
|
|
2141
2195
|
};
|
|
2196
|
+
|
|
2142
2197
|
const sizeHandler = ({
|
|
2143
2198
|
size
|
|
2144
2199
|
}) => size === 'small' ? '32px' : '48px';
|
|
2200
|
+
|
|
2145
2201
|
const useArrowButtonStyles = createUseStyles(theme => ({
|
|
2146
2202
|
arrowButtonContainer: {
|
|
2147
2203
|
cursor: 'pointer',
|
|
@@ -2181,6 +2237,7 @@ function dotsToShow(i, n) {
|
|
|
2181
2237
|
const leftToShow = i < elementsToShow / 2;
|
|
2182
2238
|
const rightToShow = n - i - 1 < elementsToShow / 2;
|
|
2183
2239
|
let leftCount, rightCount;
|
|
2240
|
+
|
|
2184
2241
|
if (leftToShow) {
|
|
2185
2242
|
leftCount = i;
|
|
2186
2243
|
rightCount = elementsToShow - i - 1;
|
|
@@ -2191,11 +2248,13 @@ function dotsToShow(i, n) {
|
|
|
2191
2248
|
leftCount = 2;
|
|
2192
2249
|
rightCount = 2;
|
|
2193
2250
|
}
|
|
2251
|
+
|
|
2194
2252
|
return {
|
|
2195
2253
|
leftCount,
|
|
2196
2254
|
rightCount
|
|
2197
2255
|
};
|
|
2198
2256
|
}
|
|
2257
|
+
|
|
2199
2258
|
function Carousel({
|
|
2200
2259
|
settings,
|
|
2201
2260
|
children,
|
|
@@ -2249,12 +2308,15 @@ function Carousel({
|
|
|
2249
2308
|
...settings,
|
|
2250
2309
|
className: settings?.className ? settings?.className + ' ' + classes.sliderClass : classes.sliderClass
|
|
2251
2310
|
};
|
|
2311
|
+
|
|
2252
2312
|
const nextClick = () => {
|
|
2253
2313
|
sliderRef.current.slickNext();
|
|
2254
2314
|
};
|
|
2315
|
+
|
|
2255
2316
|
const previousClick = () => {
|
|
2256
2317
|
sliderRef.current.slickPrev();
|
|
2257
2318
|
};
|
|
2319
|
+
|
|
2258
2320
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Slider__default["default"], _extends({
|
|
2259
2321
|
ref: sliderRef
|
|
2260
2322
|
}, sliderSettings), children), hideArrow || isMobile ? null : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2319,6 +2381,7 @@ function Section$4({
|
|
|
2319
2381
|
src: nodeData.image.metadata.value
|
|
2320
2382
|
})));
|
|
2321
2383
|
}
|
|
2384
|
+
|
|
2322
2385
|
function BannerCarouselRight({
|
|
2323
2386
|
sectionData
|
|
2324
2387
|
}) {
|
|
@@ -2344,7 +2407,9 @@ function BannerCarouselRight({
|
|
|
2344
2407
|
className: classes.sectionContainer
|
|
2345
2408
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$4, {
|
|
2346
2409
|
nodeData: node,
|
|
2347
|
-
key: idx
|
|
2410
|
+
key: idx
|
|
2411
|
+
/* or some other unique property */
|
|
2412
|
+
|
|
2348
2413
|
})))));
|
|
2349
2414
|
}
|
|
2350
2415
|
|
|
@@ -2551,9 +2616,11 @@ function List({
|
|
|
2551
2616
|
containerWidth
|
|
2552
2617
|
});
|
|
2553
2618
|
const [nodeData] = sectionData.components;
|
|
2619
|
+
|
|
2554
2620
|
const getNumber = val => {
|
|
2555
2621
|
return val.toString().length == 1 ? '0' + val : val;
|
|
2556
2622
|
};
|
|
2623
|
+
|
|
2557
2624
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
2558
2625
|
className: classes.section
|
|
2559
2626
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2745,6 +2812,7 @@ const Section$3 = ({
|
|
|
2745
2812
|
size: isMobile ? 'small' : 'medium'
|
|
2746
2813
|
})))));
|
|
2747
2814
|
};
|
|
2815
|
+
|
|
2748
2816
|
function BannerCarouselCenter({
|
|
2749
2817
|
sectionData
|
|
2750
2818
|
}) {
|
|
@@ -2761,7 +2829,9 @@ function BannerCarouselCenter({
|
|
|
2761
2829
|
className: classes.bannerCarouselCenterSection
|
|
2762
2830
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, wrapperProps, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$3, {
|
|
2763
2831
|
nodeData: node,
|
|
2764
|
-
key: idx
|
|
2832
|
+
key: idx
|
|
2833
|
+
/* or some other unique property */
|
|
2834
|
+
|
|
2765
2835
|
}))));
|
|
2766
2836
|
}
|
|
2767
2837
|
|
|
@@ -2928,6 +2998,7 @@ function Section$2({
|
|
|
2928
2998
|
size: isMobile ? 'small' : 'medium'
|
|
2929
2999
|
})));
|
|
2930
3000
|
}
|
|
3001
|
+
|
|
2931
3002
|
function BannerCarouselLeft({
|
|
2932
3003
|
sectionData
|
|
2933
3004
|
}) {
|
|
@@ -2949,7 +3020,9 @@ function BannerCarouselLeft({
|
|
|
2949
3020
|
className: classes.sectionContainer
|
|
2950
3021
|
}, /*#__PURE__*/React__default["default"].createElement(Wrapper, null, bannerCarousel.components.map((node, idx) => /*#__PURE__*/React__default["default"].createElement(Section$2, {
|
|
2951
3022
|
nodeData: node,
|
|
2952
|
-
key: idx
|
|
3023
|
+
key: idx
|
|
3024
|
+
/* or some other unique property */
|
|
3025
|
+
|
|
2953
3026
|
})))));
|
|
2954
3027
|
}
|
|
2955
3028
|
|
|
@@ -3104,6 +3177,7 @@ async function postApiCall(baseURLs, data) {
|
|
|
3104
3177
|
},
|
|
3105
3178
|
data
|
|
3106
3179
|
});
|
|
3180
|
+
|
|
3107
3181
|
if (res) {
|
|
3108
3182
|
return res.data;
|
|
3109
3183
|
}
|
|
@@ -3128,6 +3202,7 @@ async function postApiCallForm(baseURLs, data, extraProps) {
|
|
|
3128
3202
|
if (extraProps && extraProps.formSubmitSuccess) {
|
|
3129
3203
|
extraProps.formSubmitSuccess();
|
|
3130
3204
|
}
|
|
3205
|
+
|
|
3131
3206
|
return res.data;
|
|
3132
3207
|
});
|
|
3133
3208
|
} catch (err) {
|
|
@@ -3240,6 +3315,7 @@ function SubscribeToNewsletter({
|
|
|
3240
3315
|
const [inputVal, setInputVal] = React.useState(formInitialValue);
|
|
3241
3316
|
let [isValid, setIsValid] = React.useState(true);
|
|
3242
3317
|
let [btnDisabled, setBtnDisabled] = React.useState(false);
|
|
3318
|
+
|
|
3243
3319
|
const handleSubmit = () => {
|
|
3244
3320
|
let data = {
|
|
3245
3321
|
sectionId: sectionData.sectionId,
|
|
@@ -3255,9 +3331,11 @@ function SubscribeToNewsletter({
|
|
|
3255
3331
|
setBtnDisabled(true);
|
|
3256
3332
|
setInputVal(formInitialValue);
|
|
3257
3333
|
};
|
|
3334
|
+
|
|
3258
3335
|
const checkValidity = () => {
|
|
3259
3336
|
if (validations?.[nodeData?.inputField?.metadata?.validationType]?.length) {
|
|
3260
3337
|
let regex = new RegExp(validations[nodeData?.inputField?.metadata?.validationType]);
|
|
3338
|
+
|
|
3261
3339
|
if (regex?.test(inputVal)) {
|
|
3262
3340
|
setIsValid(true);
|
|
3263
3341
|
} else {
|
|
@@ -3265,6 +3343,7 @@ function SubscribeToNewsletter({
|
|
|
3265
3343
|
}
|
|
3266
3344
|
}
|
|
3267
3345
|
};
|
|
3346
|
+
|
|
3268
3347
|
React.useEffect(() => {
|
|
3269
3348
|
if (!isValid) {
|
|
3270
3349
|
setBtnDisabled(true);
|
|
@@ -3592,6 +3671,7 @@ function Section$1({
|
|
|
3592
3671
|
className: classes.contentRow
|
|
3593
3672
|
}, carouselContent))));
|
|
3594
3673
|
}
|
|
3674
|
+
|
|
3595
3675
|
function Testimonials({
|
|
3596
3676
|
sectionData
|
|
3597
3677
|
}) {
|
|
@@ -3656,6 +3736,7 @@ const loaderStyle = theme => ({
|
|
|
3656
3736
|
});
|
|
3657
3737
|
|
|
3658
3738
|
const useStyles = reactJss.createUseStyles(loaderStyle);
|
|
3739
|
+
|
|
3659
3740
|
function Loader({
|
|
3660
3741
|
texts
|
|
3661
3742
|
}) {
|
|
@@ -3667,11 +3748,13 @@ function Loader({
|
|
|
3667
3748
|
React.useEffect(() => {
|
|
3668
3749
|
if (texts && texts.length) {
|
|
3669
3750
|
let textID = '';
|
|
3751
|
+
|
|
3670
3752
|
for (let i = 0; i < texts.length; i++) {
|
|
3671
3753
|
textID = setTimeout(() => {
|
|
3672
3754
|
setLoaderText(texts[i]);
|
|
3673
3755
|
}, 2000 * i);
|
|
3674
3756
|
}
|
|
3757
|
+
|
|
3675
3758
|
return () => {
|
|
3676
3759
|
clearTimeout(textID);
|
|
3677
3760
|
};
|
|
@@ -3739,15 +3822,18 @@ function VideoPlayer(props) {
|
|
|
3739
3822
|
imageUrl: imageUrl
|
|
3740
3823
|
});
|
|
3741
3824
|
const theme = useTheme();
|
|
3825
|
+
|
|
3742
3826
|
function getId(url) {
|
|
3743
3827
|
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
|
|
3744
3828
|
var match = url?.match(regExp);
|
|
3829
|
+
|
|
3745
3830
|
if (match?.[2].length == 11) {
|
|
3746
3831
|
return 'https://www.youtube.com/embed/' + match[2];
|
|
3747
3832
|
} else {
|
|
3748
3833
|
return url;
|
|
3749
3834
|
}
|
|
3750
3835
|
}
|
|
3836
|
+
|
|
3751
3837
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isLoaded && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3752
3838
|
className: classes.imgContainer
|
|
3753
3839
|
}, isEnabled ? /*#__PURE__*/React__default["default"].createElement(Loader, null) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, props.onlyThumbnail ? null : /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
@@ -4590,8 +4676,8 @@ const usePhotoGalleryStyles = createUseStyles(theme => {
|
|
|
4590
4676
|
width: 'calc(100% - 2px)',
|
|
4591
4677
|
position: 'relative',
|
|
4592
4678
|
paddingBottom: '59.83%' // keeping aspect ratio 585x350
|
|
4593
|
-
},
|
|
4594
4679
|
|
|
4680
|
+
},
|
|
4595
4681
|
contentRow: {
|
|
4596
4682
|
display: 'grid',
|
|
4597
4683
|
gridTemplateColumns: ({
|
|
@@ -4850,6 +4936,7 @@ const FAQListing = ({
|
|
|
4850
4936
|
isSelected: selectedIndex === index
|
|
4851
4937
|
})))));
|
|
4852
4938
|
};
|
|
4939
|
+
|
|
4853
4940
|
const Accordion = ({
|
|
4854
4941
|
item,
|
|
4855
4942
|
isSelected,
|
|
@@ -5134,10 +5221,9 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5134
5221
|
flexGrow: 1,
|
|
5135
5222
|
display: 'flex',
|
|
5136
5223
|
flexDirection: 'column',
|
|
5137
|
-
justifyContent: 'space-between'
|
|
5138
|
-
//alignItems: 'center',
|
|
5139
|
-
},
|
|
5224
|
+
justifyContent: 'space-between' //alignItems: 'center',
|
|
5140
5225
|
|
|
5226
|
+
},
|
|
5141
5227
|
courseCardTags: {
|
|
5142
5228
|
display: 'flex',
|
|
5143
5229
|
justifyContent: 'flex-start',
|
|
@@ -5163,12 +5249,11 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5163
5249
|
wordBreak: 'break-word',
|
|
5164
5250
|
padding: '12px 0px',
|
|
5165
5251
|
textAlign: 'left',
|
|
5166
|
-
display: 'inline-block'
|
|
5167
|
-
// overflow: 'hidden',
|
|
5252
|
+
display: 'inline-block' // overflow: 'hidden',
|
|
5168
5253
|
// whiteSpace: 'nowrap',
|
|
5169
5254
|
// textOverflow: 'ellipsis'
|
|
5170
|
-
},
|
|
5171
5255
|
|
|
5256
|
+
},
|
|
5172
5257
|
courseCardDiscount: {
|
|
5173
5258
|
display: 'flex',
|
|
5174
5259
|
justifyContent: 'flex-start',
|
|
@@ -5250,8 +5335,7 @@ const useCourseStyles = createUseStyles(theme => {
|
|
|
5250
5335
|
}
|
|
5251
5336
|
},
|
|
5252
5337
|
'@media (max-width: 768px)': {
|
|
5253
|
-
coursesContainer: {
|
|
5254
|
-
//background: theme?.palette?.background?.primary
|
|
5338
|
+
coursesContainer: {//background: theme?.palette?.background?.primary
|
|
5255
5339
|
},
|
|
5256
5340
|
coursesCardAndText: {
|
|
5257
5341
|
padding: '70px 30px'
|
|
@@ -5283,6 +5367,7 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5283
5367
|
if (!hashToken) {
|
|
5284
5368
|
throw 'Missing hash token';
|
|
5285
5369
|
}
|
|
5370
|
+
|
|
5286
5371
|
const res = await axios__default["default"]({
|
|
5287
5372
|
method: 'get',
|
|
5288
5373
|
baseURL: baseURLs?.API_COURSE_URL,
|
|
@@ -5294,6 +5379,7 @@ async function getCourseList(baseURLs, hashToken) {
|
|
|
5294
5379
|
requiredFilters: '[10]'
|
|
5295
5380
|
}
|
|
5296
5381
|
});
|
|
5382
|
+
|
|
5297
5383
|
if (res) {
|
|
5298
5384
|
return res.data;
|
|
5299
5385
|
}
|
|
@@ -5305,6 +5391,7 @@ function getShortenedSubstring(name, length, allowDots = true) {
|
|
|
5305
5391
|
if (name) {
|
|
5306
5392
|
return name.length < length ? name : `${name.substr(0, length)}${allowDots && '...'}`;
|
|
5307
5393
|
}
|
|
5394
|
+
|
|
5308
5395
|
return '';
|
|
5309
5396
|
}
|
|
5310
5397
|
|
|
@@ -5384,11 +5471,13 @@ function courses({
|
|
|
5384
5471
|
containerWidth
|
|
5385
5472
|
});
|
|
5386
5473
|
const [nodeData] = sectionData?.components;
|
|
5474
|
+
|
|
5387
5475
|
const handleApiCall = () => {
|
|
5388
5476
|
if (baseURLs) {
|
|
5389
5477
|
getCourseList(baseURLs, hashToken).then(response => {
|
|
5390
5478
|
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5391
5479
|
const coursesData = response?.data?.coursesData;
|
|
5480
|
+
|
|
5392
5481
|
if (coursesData && coursesData.length) {
|
|
5393
5482
|
setCardList(response?.data?.coursesData);
|
|
5394
5483
|
setShowShimmer(false);
|
|
@@ -5399,12 +5488,12 @@ function courses({
|
|
|
5399
5488
|
setShowShimmer(false);
|
|
5400
5489
|
setFallbackImages(placeholders);
|
|
5401
5490
|
}
|
|
5402
|
-
}
|
|
5403
|
-
// For User Website & Draft Preview: If no data found, hide section.
|
|
5491
|
+
} // For User Website & Draft Preview: If no data found, hide section.
|
|
5404
5492
|
else setErrored(true);
|
|
5405
5493
|
}
|
|
5406
5494
|
}).catch(err => {
|
|
5407
5495
|
const errMsg = err?.response?.data?.data?.message;
|
|
5496
|
+
|
|
5408
5497
|
if (errMsg === 'NOT_FOUND') {
|
|
5409
5498
|
if (nodeData?.cardCarousel?.metadata?.placeholders?.length && isEdit) {
|
|
5410
5499
|
setShowShimmer(false);
|
|
@@ -5416,16 +5505,16 @@ function courses({
|
|
|
5416
5505
|
});
|
|
5417
5506
|
}
|
|
5418
5507
|
};
|
|
5508
|
+
|
|
5419
5509
|
React.useEffect(() => {
|
|
5420
|
-
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders;
|
|
5421
|
-
|
|
5510
|
+
const placeholders = nodeData?.cardCarousel?.metadata?.placeholders; // For Master template Preview: Show placeholder images. If placeholder doesn't come from backend, show shimmer.
|
|
5511
|
+
|
|
5422
5512
|
if (isMasterTemplate) {
|
|
5423
5513
|
if (placeholders && placeholders.length) {
|
|
5424
5514
|
setShowShimmer(false);
|
|
5425
5515
|
setFallbackImages(placeholders);
|
|
5426
5516
|
}
|
|
5427
|
-
}
|
|
5428
|
-
// other
|
|
5517
|
+
} // other
|
|
5429
5518
|
else {
|
|
5430
5519
|
handleApiCall();
|
|
5431
5520
|
}
|
|
@@ -5490,6 +5579,7 @@ function courses({
|
|
|
5490
5579
|
});
|
|
5491
5580
|
})))));
|
|
5492
5581
|
}
|
|
5582
|
+
|
|
5493
5583
|
function SimpleCardsContainer({
|
|
5494
5584
|
children,
|
|
5495
5585
|
classes
|
|
@@ -5905,6 +5995,7 @@ function FormEnquiry({
|
|
|
5905
5995
|
setBtnDisabled(true);
|
|
5906
5996
|
}
|
|
5907
5997
|
}, [validData]);
|
|
5998
|
+
|
|
5908
5999
|
const handleSubmit = () => {
|
|
5909
6000
|
let data = {
|
|
5910
6001
|
sectionId: sectionData?._id || null,
|
|
@@ -5915,22 +6006,23 @@ function FormEnquiry({
|
|
|
5915
6006
|
setBtnDisabled(true);
|
|
5916
6007
|
setInputVal(formInitialValue);
|
|
5917
6008
|
};
|
|
6009
|
+
|
|
5918
6010
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
5919
6011
|
if (validations?.[regexField]?.length) {
|
|
5920
6012
|
let regex = new RegExp(validations[regexField]);
|
|
6013
|
+
|
|
5921
6014
|
if (regex?.test(inputVal[fieldname])) {
|
|
5922
|
-
setValidData({
|
|
5923
|
-
...validData,
|
|
6015
|
+
setValidData({ ...validData,
|
|
5924
6016
|
[fieldValidity]: 1
|
|
5925
6017
|
});
|
|
5926
6018
|
} else {
|
|
5927
|
-
setValidData({
|
|
5928
|
-
...validData,
|
|
6019
|
+
setValidData({ ...validData,
|
|
5929
6020
|
[fieldValidity]: 0
|
|
5930
6021
|
});
|
|
5931
6022
|
}
|
|
5932
6023
|
}
|
|
5933
6024
|
};
|
|
6025
|
+
|
|
5934
6026
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
5935
6027
|
className: classes.section
|
|
5936
6028
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -6010,8 +6102,7 @@ function FormEnquiry({
|
|
|
6010
6102
|
isValid: validData.nameValid,
|
|
6011
6103
|
inputType: 'input',
|
|
6012
6104
|
onChange: e => {
|
|
6013
|
-
setInputVal({
|
|
6014
|
-
...inputVal,
|
|
6105
|
+
setInputVal({ ...inputVal,
|
|
6015
6106
|
name: e.target.value
|
|
6016
6107
|
});
|
|
6017
6108
|
},
|
|
@@ -6019,8 +6110,7 @@ function FormEnquiry({
|
|
|
6019
6110
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6020
6111
|
},
|
|
6021
6112
|
onFocus: () => {
|
|
6022
|
-
setValidData({
|
|
6023
|
-
...validData,
|
|
6113
|
+
setValidData({ ...validData,
|
|
6024
6114
|
nameValid: 1
|
|
6025
6115
|
});
|
|
6026
6116
|
}
|
|
@@ -6032,8 +6122,7 @@ function FormEnquiry({
|
|
|
6032
6122
|
isValid: validData.phoneValid,
|
|
6033
6123
|
inputType: 'input',
|
|
6034
6124
|
onChange: e => {
|
|
6035
|
-
setInputVal({
|
|
6036
|
-
...inputVal,
|
|
6125
|
+
setInputVal({ ...inputVal,
|
|
6037
6126
|
phone: e.target.value
|
|
6038
6127
|
});
|
|
6039
6128
|
},
|
|
@@ -6041,8 +6130,7 @@ function FormEnquiry({
|
|
|
6041
6130
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6042
6131
|
},
|
|
6043
6132
|
onFocus: () => {
|
|
6044
|
-
setValidData({
|
|
6045
|
-
...validData,
|
|
6133
|
+
setValidData({ ...validData,
|
|
6046
6134
|
phoneValid: 1
|
|
6047
6135
|
});
|
|
6048
6136
|
}
|
|
@@ -6054,8 +6142,7 @@ function FormEnquiry({
|
|
|
6054
6142
|
isValid: validData.emailValid,
|
|
6055
6143
|
inputType: 'input',
|
|
6056
6144
|
onChange: e => {
|
|
6057
|
-
setInputVal({
|
|
6058
|
-
...inputVal,
|
|
6145
|
+
setInputVal({ ...inputVal,
|
|
6059
6146
|
email: e.target.value
|
|
6060
6147
|
});
|
|
6061
6148
|
},
|
|
@@ -6063,8 +6150,7 @@ function FormEnquiry({
|
|
|
6063
6150
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6064
6151
|
},
|
|
6065
6152
|
onFocus: () => {
|
|
6066
|
-
setValidData({
|
|
6067
|
-
...validData,
|
|
6153
|
+
setValidData({ ...validData,
|
|
6068
6154
|
emailValid: 1
|
|
6069
6155
|
});
|
|
6070
6156
|
}
|
|
@@ -6076,8 +6162,7 @@ function FormEnquiry({
|
|
|
6076
6162
|
isValid: validData.messageValid,
|
|
6077
6163
|
inputType: 'textarea',
|
|
6078
6164
|
onChange: e => {
|
|
6079
|
-
setInputVal({
|
|
6080
|
-
...inputVal,
|
|
6165
|
+
setInputVal({ ...inputVal,
|
|
6081
6166
|
message: e.target.value
|
|
6082
6167
|
});
|
|
6083
6168
|
},
|
|
@@ -6085,8 +6170,7 @@ function FormEnquiry({
|
|
|
6085
6170
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6086
6171
|
},
|
|
6087
6172
|
onFocus: () => {
|
|
6088
|
-
setValidData({
|
|
6089
|
-
...validData,
|
|
6173
|
+
setValidData({ ...validData,
|
|
6090
6174
|
messageValid: 1
|
|
6091
6175
|
});
|
|
6092
6176
|
}
|
|
@@ -6317,6 +6401,7 @@ function Contact({
|
|
|
6317
6401
|
phoneValid: 1,
|
|
6318
6402
|
messageValid: 1
|
|
6319
6403
|
});
|
|
6404
|
+
|
|
6320
6405
|
const handleSubmit = () => {
|
|
6321
6406
|
const data = {
|
|
6322
6407
|
sectionId: sectionData?._id || null,
|
|
@@ -6327,6 +6412,7 @@ function Contact({
|
|
|
6327
6412
|
setBtnDisabled(true);
|
|
6328
6413
|
setInputVal(formInitialValue);
|
|
6329
6414
|
};
|
|
6415
|
+
|
|
6330
6416
|
React.useEffect(() => {
|
|
6331
6417
|
if (validData?.nameValid && validData?.emailValid && validData?.phoneValid && validData?.messageValid) {
|
|
6332
6418
|
setBtnDisabled(false);
|
|
@@ -6334,22 +6420,23 @@ function Contact({
|
|
|
6334
6420
|
setBtnDisabled(true);
|
|
6335
6421
|
}
|
|
6336
6422
|
}, [validData]);
|
|
6423
|
+
|
|
6337
6424
|
const checkValidity = (regexField, fieldname, fieldValidity) => {
|
|
6338
6425
|
if (validations?.[regexField]?.length) {
|
|
6339
6426
|
let regex = new RegExp(validations[regexField]);
|
|
6427
|
+
|
|
6340
6428
|
if (regex?.test(inputVal[fieldname])) {
|
|
6341
|
-
setValidData({
|
|
6342
|
-
...validData,
|
|
6429
|
+
setValidData({ ...validData,
|
|
6343
6430
|
[fieldValidity]: 1
|
|
6344
6431
|
});
|
|
6345
6432
|
} else {
|
|
6346
|
-
setValidData({
|
|
6347
|
-
...validData,
|
|
6433
|
+
setValidData({ ...validData,
|
|
6348
6434
|
[fieldValidity]: 0
|
|
6349
6435
|
});
|
|
6350
6436
|
}
|
|
6351
6437
|
}
|
|
6352
6438
|
};
|
|
6439
|
+
|
|
6353
6440
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
6354
6441
|
className: classes.section
|
|
6355
6442
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -6391,8 +6478,7 @@ function Contact({
|
|
|
6391
6478
|
isValid: validData.nameValid,
|
|
6392
6479
|
inputType: 'input',
|
|
6393
6480
|
onChange: e => {
|
|
6394
|
-
setInputVal({
|
|
6395
|
-
...inputVal,
|
|
6481
|
+
setInputVal({ ...inputVal,
|
|
6396
6482
|
name: e.target.value
|
|
6397
6483
|
});
|
|
6398
6484
|
},
|
|
@@ -6400,8 +6486,7 @@ function Contact({
|
|
|
6400
6486
|
checkValidity(nodeData?.nameField?.metadata?.validationType, 'name', 'nameValid');
|
|
6401
6487
|
},
|
|
6402
6488
|
onFocus: () => {
|
|
6403
|
-
setValidData({
|
|
6404
|
-
...validData,
|
|
6489
|
+
setValidData({ ...validData,
|
|
6405
6490
|
nameValid: 1
|
|
6406
6491
|
});
|
|
6407
6492
|
}
|
|
@@ -6413,8 +6498,7 @@ function Contact({
|
|
|
6413
6498
|
isValid: validData.phoneValid,
|
|
6414
6499
|
inputType: 'input',
|
|
6415
6500
|
onChange: e => {
|
|
6416
|
-
setInputVal({
|
|
6417
|
-
...inputVal,
|
|
6501
|
+
setInputVal({ ...inputVal,
|
|
6418
6502
|
phone: e.target.value
|
|
6419
6503
|
});
|
|
6420
6504
|
},
|
|
@@ -6422,8 +6506,7 @@ function Contact({
|
|
|
6422
6506
|
checkValidity(nodeData?.phoneField?.metadata?.validationType, 'phone', 'phoneValid');
|
|
6423
6507
|
},
|
|
6424
6508
|
onFocus: () => {
|
|
6425
|
-
setValidData({
|
|
6426
|
-
...validData,
|
|
6509
|
+
setValidData({ ...validData,
|
|
6427
6510
|
phoneValid: 1
|
|
6428
6511
|
});
|
|
6429
6512
|
}
|
|
@@ -6435,8 +6518,7 @@ function Contact({
|
|
|
6435
6518
|
isValid: validData.emailValid,
|
|
6436
6519
|
inputType: 'input',
|
|
6437
6520
|
onChange: e => {
|
|
6438
|
-
setInputVal({
|
|
6439
|
-
...inputVal,
|
|
6521
|
+
setInputVal({ ...inputVal,
|
|
6440
6522
|
email: e.target.value
|
|
6441
6523
|
});
|
|
6442
6524
|
},
|
|
@@ -6444,8 +6526,7 @@ function Contact({
|
|
|
6444
6526
|
checkValidity(nodeData?.emailField?.metadata?.validationType, 'email', 'emailValid');
|
|
6445
6527
|
},
|
|
6446
6528
|
onFocus: () => {
|
|
6447
|
-
setValidData({
|
|
6448
|
-
...validData,
|
|
6529
|
+
setValidData({ ...validData,
|
|
6449
6530
|
emailValid: 1
|
|
6450
6531
|
});
|
|
6451
6532
|
}
|
|
@@ -6457,8 +6538,7 @@ function Contact({
|
|
|
6457
6538
|
isValid: validData.messageValid,
|
|
6458
6539
|
inputType: 'textarea',
|
|
6459
6540
|
onChange: e => {
|
|
6460
|
-
setInputVal({
|
|
6461
|
-
...inputVal,
|
|
6541
|
+
setInputVal({ ...inputVal,
|
|
6462
6542
|
message: e.target.value
|
|
6463
6543
|
});
|
|
6464
6544
|
},
|
|
@@ -6466,8 +6546,7 @@ function Contact({
|
|
|
6466
6546
|
checkValidity(nodeData?.messageField?.metadata?.validationType, 'message', 'messageValid');
|
|
6467
6547
|
},
|
|
6468
6548
|
onFocus: () => {
|
|
6469
|
-
setValidData({
|
|
6470
|
-
...validData,
|
|
6549
|
+
setValidData({ ...validData,
|
|
6471
6550
|
messageValid: 1
|
|
6472
6551
|
});
|
|
6473
6552
|
}
|
|
@@ -6728,8 +6807,7 @@ const useWebinarPromotionPage = createUseStyles(theme => {
|
|
|
6728
6807
|
const SingleVideoSlide$1 = props => {
|
|
6729
6808
|
const [isReadMore, setIsReadMore] = React.useState(false);
|
|
6730
6809
|
const theme = useTheme();
|
|
6731
|
-
React.useEffect(() => {
|
|
6732
|
-
// remaining days epoch
|
|
6810
|
+
React.useEffect(() => {// remaining days epoch
|
|
6733
6811
|
// current date epoch
|
|
6734
6812
|
// subtract remaining days from current day epoch
|
|
6735
6813
|
// moment the result - and see if there are days
|
|
@@ -6741,6 +6819,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6741
6819
|
webinarCtaClick,
|
|
6742
6820
|
conversions = 0
|
|
6743
6821
|
} = props;
|
|
6822
|
+
|
|
6744
6823
|
const renderer = ({
|
|
6745
6824
|
days,
|
|
6746
6825
|
hours,
|
|
@@ -6756,7 +6835,9 @@ const SingleVideoSlide$1 = props => {
|
|
|
6756
6835
|
return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
|
|
6757
6836
|
}
|
|
6758
6837
|
};
|
|
6838
|
+
|
|
6759
6839
|
const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props.data.offerPriceEndDate)) < 0;
|
|
6840
|
+
|
|
6760
6841
|
const checkForShowDiscount = () => {
|
|
6761
6842
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
6762
6843
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -6768,16 +6849,19 @@ const SingleVideoSlide$1 = props => {
|
|
|
6768
6849
|
if (data.offerPriceValidFor <= conversions) {
|
|
6769
6850
|
return false;
|
|
6770
6851
|
}
|
|
6852
|
+
|
|
6771
6853
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
6772
6854
|
return false;
|
|
6773
6855
|
} else {
|
|
6774
6856
|
return true;
|
|
6775
6857
|
}
|
|
6776
6858
|
}
|
|
6859
|
+
|
|
6777
6860
|
if (data.discount > 0) {
|
|
6778
6861
|
return true;
|
|
6779
6862
|
}
|
|
6780
6863
|
};
|
|
6864
|
+
|
|
6781
6865
|
const discount = ({
|
|
6782
6866
|
price,
|
|
6783
6867
|
discount
|
|
@@ -6785,6 +6869,7 @@ const SingleVideoSlide$1 = props => {
|
|
|
6785
6869
|
console.log('discountxx', props.data.price, props.data.discount);
|
|
6786
6870
|
return (discount / price * 100).toFixed(2);
|
|
6787
6871
|
};
|
|
6872
|
+
|
|
6788
6873
|
const classes = useWebinarPromotionPage();
|
|
6789
6874
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
6790
6875
|
className: classes.videoCarouselContainer
|
|
@@ -6880,10 +6965,9 @@ const SingleVideoSlide$1 = props => {
|
|
|
6880
6965
|
data: {
|
|
6881
6966
|
// link: 'headerData?.loginCtaLink',
|
|
6882
6967
|
// isLink: 1,
|
|
6883
|
-
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW'
|
|
6884
|
-
// isExternal: 1
|
|
6885
|
-
},
|
|
6968
|
+
value: data.isPaid ? 'BUY NOW' : 'REGISTER NOW' // isExternal: 1
|
|
6886
6969
|
|
|
6970
|
+
},
|
|
6887
6971
|
onClick: webinarCtaClick,
|
|
6888
6972
|
type: 'primary',
|
|
6889
6973
|
size: 'medium',
|
|
@@ -7217,14 +7301,14 @@ const SingleVideoSlide = props => {
|
|
|
7217
7301
|
isEdit
|
|
7218
7302
|
} = React.useContext(PageContext);
|
|
7219
7303
|
console.log(isEdit, 'isEdit');
|
|
7220
|
-
React.useEffect(() => {
|
|
7221
|
-
// remaining days epoch
|
|
7304
|
+
React.useEffect(() => {// remaining days epoch
|
|
7222
7305
|
// current date epoch
|
|
7223
7306
|
// subtract remaining days from current day epoch
|
|
7224
7307
|
// moment the result - and see if there are days
|
|
7225
7308
|
// days is present show days
|
|
7226
7309
|
// else start reverse timer
|
|
7227
7310
|
}, []);
|
|
7311
|
+
|
|
7228
7312
|
const renderer = ({
|
|
7229
7313
|
days,
|
|
7230
7314
|
hours,
|
|
@@ -7240,6 +7324,7 @@ const SingleVideoSlide = props => {
|
|
|
7240
7324
|
return /*#__PURE__*/React__default["default"].createElement("span", null, Math.floor(moment__default["default"].duration(given.diff(current)).asDays()), " day(s)");
|
|
7241
7325
|
}
|
|
7242
7326
|
};
|
|
7327
|
+
|
|
7243
7328
|
const {
|
|
7244
7329
|
data,
|
|
7245
7330
|
courseBuyNow,
|
|
@@ -7248,7 +7333,9 @@ const SingleVideoSlide = props => {
|
|
|
7248
7333
|
} = props;
|
|
7249
7334
|
const showCourseInstallmentData = data?.courseOverviewData;
|
|
7250
7335
|
const InstalmentData = isEdit ? data?.courseOverviewData?.installments?.formData?.installments[0].installmentAmount : data?.courseOverviewData?.installments?.formData?.installmentInfo?.installments[0].installmentPrice;
|
|
7336
|
+
|
|
7251
7337
|
const checkIfOfferIsValid = () => moment__default["default"]().diff(moment__default["default"](props?.data?.endDate || 0)) < 0;
|
|
7338
|
+
|
|
7252
7339
|
const checkForShowDiscount = () => {
|
|
7253
7340
|
if (props.data.endDate === null || checkIfOfferIsValid()) {
|
|
7254
7341
|
if (data.discount > 0 && data.offerPriceValidFor === 0) {
|
|
@@ -7260,23 +7347,28 @@ const SingleVideoSlide = props => {
|
|
|
7260
7347
|
if (data.offerPriceValidFor <= conversions) {
|
|
7261
7348
|
return false;
|
|
7262
7349
|
}
|
|
7350
|
+
|
|
7263
7351
|
if (data.offerPriceValidFor - conversions < 0) {
|
|
7264
7352
|
return false;
|
|
7265
7353
|
} else {
|
|
7266
7354
|
return true;
|
|
7267
7355
|
}
|
|
7268
7356
|
}
|
|
7357
|
+
|
|
7269
7358
|
if (data.discount > 0) {
|
|
7270
7359
|
return true;
|
|
7271
7360
|
}
|
|
7272
7361
|
};
|
|
7362
|
+
|
|
7273
7363
|
const classes = useCoursePromotionPage();
|
|
7364
|
+
|
|
7274
7365
|
const discount = ({
|
|
7275
7366
|
price,
|
|
7276
7367
|
discount
|
|
7277
7368
|
}) => {
|
|
7278
7369
|
return (discount / price * 100).toFixed(2);
|
|
7279
7370
|
};
|
|
7371
|
+
|
|
7280
7372
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
7281
7373
|
className: classes.videoCarouselContainer
|
|
7282
7374
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -7390,16 +7482,15 @@ const SingleVideoSlide = props => {
|
|
|
7390
7482
|
data: {
|
|
7391
7483
|
// link: 'headerData?.loginCtaLink',
|
|
7392
7484
|
// isLink: 1,
|
|
7393
|
-
value: 'BUY NOW'
|
|
7394
|
-
// isExternal: 1
|
|
7395
|
-
},
|
|
7485
|
+
value: 'BUY NOW' // isExternal: 1
|
|
7396
7486
|
|
|
7487
|
+
},
|
|
7397
7488
|
onClick: courseBuyNow,
|
|
7398
7489
|
type: 'primary',
|
|
7399
7490
|
size: 'medium',
|
|
7400
7491
|
target: null,
|
|
7401
|
-
rel: null
|
|
7402
|
-
|
|
7492
|
+
rel: null // styling={isMobile ? { margin: '0 40px' } : {}}
|
|
7493
|
+
|
|
7403
7494
|
})))), showCourseInstallmentData && InstalmentData && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
7404
7495
|
className: classes.payInstallmentContainer,
|
|
7405
7496
|
onClick: showCourseInstallment
|
|
@@ -7604,15 +7695,18 @@ const FormPage = ({
|
|
|
7604
7695
|
_id,
|
|
7605
7696
|
baseURLs
|
|
7606
7697
|
} = React.useContext(PageContext);
|
|
7698
|
+
|
|
7607
7699
|
const handleSubmit = async e => {
|
|
7608
7700
|
e.preventDefault();
|
|
7609
7701
|
let formResponse = [];
|
|
7702
|
+
|
|
7610
7703
|
for (const [key, value] of Object.entries(formData)) {
|
|
7611
7704
|
if (value.questionType === 'MC') {
|
|
7612
7705
|
if (value.solutionArray.length > 1) {
|
|
7613
7706
|
value.solutionArray.shift();
|
|
7614
7707
|
}
|
|
7615
7708
|
}
|
|
7709
|
+
|
|
7616
7710
|
formResponse.push({
|
|
7617
7711
|
questionId: key,
|
|
7618
7712
|
questionName: value.questionName,
|
|
@@ -7620,6 +7714,7 @@ const FormPage = ({
|
|
|
7620
7714
|
solutionArray: value.solutionArray
|
|
7621
7715
|
});
|
|
7622
7716
|
}
|
|
7717
|
+
|
|
7623
7718
|
const data = {
|
|
7624
7719
|
sectionId: sectionData?.components?.[0]?._id || null,
|
|
7625
7720
|
landingPageId: _id || null,
|
|
@@ -7629,6 +7724,7 @@ const FormPage = ({
|
|
|
7629
7724
|
setFormData({});
|
|
7630
7725
|
setformSubmitted(!formSubmitted);
|
|
7631
7726
|
};
|
|
7727
|
+
|
|
7632
7728
|
React.useEffect(() => {
|
|
7633
7729
|
//add all questions to formData
|
|
7634
7730
|
let formData = {};
|
|
@@ -7641,26 +7737,23 @@ const FormPage = ({
|
|
|
7641
7737
|
});
|
|
7642
7738
|
setFormData(formData);
|
|
7643
7739
|
}, [metadata, formSubmitted]);
|
|
7740
|
+
|
|
7644
7741
|
const handleOnClick = (e, item, option) => {
|
|
7645
7742
|
// if the checkbox is checked
|
|
7646
7743
|
if (!e.target.checked) {
|
|
7647
7744
|
// if the checkbox is checked and the solution array is empty
|
|
7648
7745
|
if (!formData[item._id]?.solutionArray?.length) {
|
|
7649
|
-
setFormData({
|
|
7650
|
-
...formData,
|
|
7746
|
+
setFormData({ ...formData,
|
|
7651
7747
|
[item._id]: {
|
|
7652
7748
|
questionName: item.text,
|
|
7653
7749
|
solutionArray: [option.value],
|
|
7654
7750
|
questionType: 'MC'
|
|
7655
7751
|
}
|
|
7656
7752
|
});
|
|
7657
|
-
}
|
|
7658
|
-
// if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7753
|
+
} // if the checkbox is checked and the solution array is not empty and the value is already in the array remove it
|
|
7659
7754
|
else if (formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7660
7755
|
// if only one value is in the array remove it
|
|
7661
|
-
|
|
7662
|
-
setFormData({
|
|
7663
|
-
...formData,
|
|
7756
|
+
setFormData({ ...formData,
|
|
7664
7757
|
[item._id]: {
|
|
7665
7758
|
questionName: item.text,
|
|
7666
7759
|
solutionArray: formData[item._id]?.solutionArray?.filter(item => item !== option.value),
|
|
@@ -7668,24 +7761,20 @@ const FormPage = ({
|
|
|
7668
7761
|
}
|
|
7669
7762
|
});
|
|
7670
7763
|
}
|
|
7671
|
-
}
|
|
7672
|
-
// if the checkbox is unchecked
|
|
7764
|
+
} // if the checkbox is unchecked
|
|
7673
7765
|
else {
|
|
7674
7766
|
// if the checkbox is unchecked and the solution array is empty
|
|
7675
7767
|
if (typeof formData[item._id]?.solutionArray?.length === 'undefined') {
|
|
7676
|
-
setFormData({
|
|
7677
|
-
...formData,
|
|
7768
|
+
setFormData({ ...formData,
|
|
7678
7769
|
[item._id]: {
|
|
7679
7770
|
questionName: item.text,
|
|
7680
7771
|
solutionArray: [option.value],
|
|
7681
7772
|
questionType: 'MC'
|
|
7682
7773
|
}
|
|
7683
7774
|
});
|
|
7684
|
-
}
|
|
7685
|
-
// if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7775
|
+
} // if the checkbox is unchecked and the solution array is not empty and the value is not in the array add it
|
|
7686
7776
|
else if (!formData[item._id]?.solutionArray?.includes(option.value)) {
|
|
7687
|
-
setFormData({
|
|
7688
|
-
...formData,
|
|
7777
|
+
setFormData({ ...formData,
|
|
7689
7778
|
[item._id]: {
|
|
7690
7779
|
questionName: item.text,
|
|
7691
7780
|
solutionArray: [...formData[item._id]?.solutionArray, option.value],
|
|
@@ -7695,6 +7784,7 @@ const FormPage = ({
|
|
|
7695
7784
|
}
|
|
7696
7785
|
}
|
|
7697
7786
|
};
|
|
7787
|
+
|
|
7698
7788
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
7699
7789
|
className: classes.formPageSection
|
|
7700
7790
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -7721,8 +7811,7 @@ const FormPage = ({
|
|
|
7721
7811
|
placeholder: "Short answer",
|
|
7722
7812
|
name: item._id,
|
|
7723
7813
|
onChange: e => {
|
|
7724
|
-
setFormData({
|
|
7725
|
-
...formData,
|
|
7814
|
+
setFormData({ ...formData,
|
|
7726
7815
|
[item._id]: {
|
|
7727
7816
|
index,
|
|
7728
7817
|
questionName: item.text,
|
|
@@ -7762,13 +7851,11 @@ const FormPage = ({
|
|
|
7762
7851
|
name: "text",
|
|
7763
7852
|
required: item.isRequired,
|
|
7764
7853
|
value: option.value,
|
|
7765
|
-
checked: formData[item._id]?.solutionArray?.[0] === option.value
|
|
7766
|
-
// name={option.value}
|
|
7854
|
+
checked: formData[item._id]?.solutionArray?.[0] === option.value // name={option.value}
|
|
7767
7855
|
// id={option.value}
|
|
7768
7856
|
,
|
|
7769
7857
|
onClick: e => {
|
|
7770
|
-
setFormData({
|
|
7771
|
-
...formData,
|
|
7858
|
+
setFormData({ ...formData,
|
|
7772
7859
|
[item._id]: {
|
|
7773
7860
|
questionName: item.text,
|
|
7774
7861
|
solutionArray: [option.value],
|
|
@@ -7784,10 +7871,9 @@ const FormPage = ({
|
|
|
7784
7871
|
data: {
|
|
7785
7872
|
// link: 'headerData?.loginCtaLink',
|
|
7786
7873
|
// isLink: 1,
|
|
7787
|
-
value: 'SUBMIT'
|
|
7788
|
-
// isExternal: 1
|
|
7789
|
-
},
|
|
7874
|
+
value: 'SUBMIT' // isExternal: 1
|
|
7790
7875
|
|
|
7876
|
+
},
|
|
7791
7877
|
type: 'primary',
|
|
7792
7878
|
size: 'medium',
|
|
7793
7879
|
target: null,
|
|
@@ -7881,6 +7967,7 @@ function Tiles({
|
|
|
7881
7967
|
const nodeData = sectionData.components;
|
|
7882
7968
|
console.log(nodeData);
|
|
7883
7969
|
const tilesList = nodeData[0]?.tilesList.components;
|
|
7970
|
+
|
|
7884
7971
|
const handleClick = value => {
|
|
7885
7972
|
if (!isEdit && value) {
|
|
7886
7973
|
if (value.indexOf('http://') == 0 || value.indexOf('https://') == 0) {
|
|
@@ -7890,6 +7977,7 @@ function Tiles({
|
|
|
7890
7977
|
}
|
|
7891
7978
|
}
|
|
7892
7979
|
};
|
|
7980
|
+
|
|
7893
7981
|
const TileDiv = tilesList?.map((tile, i) => {
|
|
7894
7982
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
7895
7983
|
key: i
|
|
@@ -7952,8 +8040,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
7952
8040
|
width: 'auto',
|
|
7953
8041
|
height: '48px'
|
|
7954
8042
|
/* margin: 18px 0px; */
|
|
7955
|
-
},
|
|
7956
8043
|
|
|
8044
|
+
},
|
|
7957
8045
|
'p-young-guru-title': {
|
|
7958
8046
|
fontFamily: theme?.typography?.fontFamily,
|
|
7959
8047
|
fontStyle: 'normal',
|
|
@@ -7980,8 +8068,8 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
7980
8068
|
fontSize: '0',
|
|
7981
8069
|
textAlign: 'center'
|
|
7982
8070
|
/* padding:35px 0 40px */
|
|
7983
|
-
},
|
|
7984
8071
|
|
|
8072
|
+
},
|
|
7985
8073
|
'two-columns .column': {
|
|
7986
8074
|
width: '100%',
|
|
7987
8075
|
maxWidth: '275px',
|
|
@@ -7997,10 +8085,9 @@ const useEmailStyles = createUseStyles(theme => ({
|
|
|
7997
8085
|
color: '#030a21',
|
|
7998
8086
|
marginBottom: '5px',
|
|
7999
8087
|
textAlign: 'left'
|
|
8000
|
-
}
|
|
8001
|
-
|
|
8002
|
-
// @media screen and (max-width: 600px) {
|
|
8088
|
+
} // @media screen and (max-width: 600px) {
|
|
8003
8089
|
// }
|
|
8090
|
+
|
|
8004
8091
|
}));
|
|
8005
8092
|
|
|
8006
8093
|
function Section({
|
|
@@ -8029,8 +8116,8 @@ function Section({
|
|
|
8029
8116
|
}, /*#__PURE__*/React__default["default"].createElement("tbody", null, customHtmlData?.isCustomHtml ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8030
8117
|
className: classes.email_description_para,
|
|
8031
8118
|
dangerouslySetInnerHTML: {
|
|
8032
|
-
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}`
|
|
8033
|
-
|
|
8119
|
+
__html: `${customHtmlData?.html ? customHtmlData?.html : ''}` // __html: '<div>sdnfksdnflksdnfklsndk</div>'
|
|
8120
|
+
|
|
8034
8121
|
}
|
|
8035
8122
|
}) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, header?.isActive ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("tr", null, /*#__PURE__*/React__default["default"].createElement("td", null, /*#__PURE__*/React__default["default"].createElement("table", {
|
|
8036
8123
|
style: {
|
|
@@ -8050,7 +8137,7 @@ function Section({
|
|
|
8050
8137
|
width: 'auto',
|
|
8051
8138
|
height: '48px'
|
|
8052
8139
|
}
|
|
8053
|
-
}) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8140
|
+
}) : renderHTML ? null : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8054
8141
|
style: {
|
|
8055
8142
|
display: 'flex',
|
|
8056
8143
|
alignItems: 'center',
|
|
@@ -8063,8 +8150,7 @@ function Section({
|
|
|
8063
8150
|
textAlign: 'center'
|
|
8064
8151
|
}
|
|
8065
8152
|
}, header?.components[1]?.metadata?.image?.length ? /*#__PURE__*/React__default["default"].createElement("img", {
|
|
8066
|
-
src: header?.components[1]?.metadata?.image
|
|
8067
|
-
// width={600}
|
|
8153
|
+
src: header?.components[1]?.metadata?.image // width={600}
|
|
8068
8154
|
,
|
|
8069
8155
|
alt: "",
|
|
8070
8156
|
style: {
|
|
@@ -8072,7 +8158,7 @@ function Section({
|
|
|
8072
8158
|
width: '100%',
|
|
8073
8159
|
marginBottom: '-4px'
|
|
8074
8160
|
}
|
|
8075
|
-
}) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8161
|
+
}) : renderHTML ? null : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8076
8162
|
style: {
|
|
8077
8163
|
maxWidth: '600px',
|
|
8078
8164
|
width: '100%',
|
|
@@ -8157,7 +8243,7 @@ function Section({
|
|
|
8157
8243
|
width: '100%',
|
|
8158
8244
|
borderRadius: '10px'
|
|
8159
8245
|
}
|
|
8160
|
-
}) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8246
|
+
}) : renderHTML ? null : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8161
8247
|
style: {
|
|
8162
8248
|
background: '#D9D9D9F0',
|
|
8163
8249
|
width: '100%',
|
|
@@ -8347,12 +8433,14 @@ function Section({
|
|
|
8347
8433
|
}
|
|
8348
8434
|
}, "All rights reserved.")))))))))))))) : null)))));
|
|
8349
8435
|
}
|
|
8436
|
+
|
|
8350
8437
|
function EmailDripMarket({
|
|
8351
8438
|
sectionData,
|
|
8352
8439
|
extraProps = {}
|
|
8353
8440
|
}) {
|
|
8354
8441
|
console.log('extrapropstemplate', extraProps);
|
|
8355
8442
|
const isInitialMount = React.useRef(true);
|
|
8443
|
+
|
|
8356
8444
|
const convertToHtml = sectionData => {
|
|
8357
8445
|
const html = ReactDOMServer__default["default"].renderToStaticMarkup( /*#__PURE__*/React__default["default"].createElement(Section, {
|
|
8358
8446
|
nodeData: sectionData,
|
|
@@ -8362,15 +8450,15 @@ function EmailDripMarket({
|
|
|
8362
8450
|
}));
|
|
8363
8451
|
return html;
|
|
8364
8452
|
};
|
|
8453
|
+
|
|
8365
8454
|
React.useEffect(() => {
|
|
8366
8455
|
if (isInitialMount.current) {
|
|
8367
8456
|
isInitialMount.current = false;
|
|
8368
8457
|
} else {
|
|
8369
8458
|
extraProps?.callbackHtml(convertToHtml(sectionData));
|
|
8370
8459
|
}
|
|
8371
|
-
}, [extraProps?.convertedHtml]);
|
|
8460
|
+
}, [extraProps?.convertedHtml]); // const mockData = sectionData?.sections[0];
|
|
8372
8461
|
|
|
8373
|
-
// const mockData = sectionData?.sections[0];
|
|
8374
8462
|
const emailRef = React.useRef(null);
|
|
8375
8463
|
return /*#__PURE__*/React__default["default"].createElement("section", {
|
|
8376
8464
|
style: {
|
|
@@ -8380,6 +8468,7 @@ function EmailDripMarket({
|
|
|
8380
8468
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
8381
8469
|
onClick: e => {
|
|
8382
8470
|
e.stopPropagation(); // prevent the click from event Capturing, in email onClick events do not work
|
|
8471
|
+
|
|
8383
8472
|
e.preventDefault();
|
|
8384
8473
|
}
|
|
8385
8474
|
}, /*#__PURE__*/React__default["default"].createElement(Section, {
|
|
@@ -8418,7 +8507,9 @@ const TYPE_TO_COMPONENT_MAP = {
|
|
|
8418
8507
|
TILES_SECTION: Tiles,
|
|
8419
8508
|
EMAIL_DRIP_MARKET: EmailDripMarket
|
|
8420
8509
|
};
|
|
8510
|
+
|
|
8421
8511
|
const getCompToRender = type => TYPE_TO_COMPONENT_MAP[type] || (() => null);
|
|
8512
|
+
|
|
8422
8513
|
const MemoisedSection = /*#__PURE__*/React.memo(({
|
|
8423
8514
|
sectionData,
|
|
8424
8515
|
extraProps
|
|
@@ -8531,9 +8622,11 @@ const componentParser = compObj => {
|
|
|
8531
8622
|
});
|
|
8532
8623
|
return component;
|
|
8533
8624
|
}
|
|
8625
|
+
|
|
8534
8626
|
if (Array.isArray(compObj.components)) {
|
|
8535
8627
|
compObj.components = compObj.components.map(componentParser);
|
|
8536
8628
|
}
|
|
8629
|
+
|
|
8537
8630
|
return compObj;
|
|
8538
8631
|
};
|
|
8539
8632
|
const inverseComponentParser = compObj => {
|
|
@@ -8558,6 +8651,7 @@ const inverseComponentParser = compObj => {
|
|
|
8558
8651
|
if (compObj.components) {
|
|
8559
8652
|
compObj.components = compObj.components.map(inverseComponentParser);
|
|
8560
8653
|
}
|
|
8654
|
+
|
|
8561
8655
|
return compObj;
|
|
8562
8656
|
}
|
|
8563
8657
|
};
|