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