diy-template-components 2.0.58 → 2.0.60
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 +39 -38
- package/build/index.es.js.map +1 -1
- package/build/index.js +4 -3
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -9,7 +9,7 @@ function ___$insertStyle(css) {
|
|
|
9
9
|
return css;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
import React, { createContext, useContext
|
|
12
|
+
import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
|
|
13
13
|
import Slider from 'react-slick';
|
|
14
14
|
import axios from 'axios';
|
|
15
15
|
import moment from 'moment';
|
|
@@ -469,7 +469,7 @@ function useLinkBuilder(data) {
|
|
|
469
469
|
isEdit,
|
|
470
470
|
basePath,
|
|
471
471
|
isMasterTemplate
|
|
472
|
-
} = useContext
|
|
472
|
+
} = useContext(PageContext);
|
|
473
473
|
if (isEdit || !data.isLink) {
|
|
474
474
|
return null;
|
|
475
475
|
}
|
|
@@ -507,7 +507,7 @@ const Button = /*#__PURE__*/forwardRef(function Button({
|
|
|
507
507
|
}, ref) {
|
|
508
508
|
const {
|
|
509
509
|
isEdit
|
|
510
|
-
} = useContext
|
|
510
|
+
} = useContext(PageContext);
|
|
511
511
|
const link = useLinkBuilder(data);
|
|
512
512
|
const classes = buttonStyles({
|
|
513
513
|
fluid,
|
|
@@ -1072,7 +1072,7 @@ function OptionList({
|
|
|
1072
1072
|
const {
|
|
1073
1073
|
isPreview,
|
|
1074
1074
|
countryCode
|
|
1075
|
-
} = useContext
|
|
1075
|
+
} = useContext(PageContext);
|
|
1076
1076
|
function checkIsActiveTab(slug = '') {
|
|
1077
1077
|
if (typeof window !== 'undefined') {
|
|
1078
1078
|
const pathname = window.location.pathname;
|
|
@@ -1236,7 +1236,7 @@ const NextImageRenderer = ({
|
|
|
1236
1236
|
isCustomWebsite,
|
|
1237
1237
|
pageData,
|
|
1238
1238
|
isMobile
|
|
1239
|
-
} = useContext
|
|
1239
|
+
} = useContext(PageContext);
|
|
1240
1240
|
|
|
1241
1241
|
// return empty div if src is empty string or empty object or null
|
|
1242
1242
|
if (!src || typeof src === 'object' && Object.keys(src).length === 0) {
|
|
@@ -1312,7 +1312,7 @@ function DesktopHeader({
|
|
|
1312
1312
|
} = header;
|
|
1313
1313
|
const {
|
|
1314
1314
|
isCustomWebsite
|
|
1315
|
-
} = useContext
|
|
1315
|
+
} = useContext(PageContext);
|
|
1316
1316
|
const logoUrl = useLinkBuilder({
|
|
1317
1317
|
isLink: true,
|
|
1318
1318
|
link: '/'
|
|
@@ -1393,7 +1393,7 @@ function MobileHeader({
|
|
|
1393
1393
|
const {
|
|
1394
1394
|
isCustomWebsite,
|
|
1395
1395
|
countryCode
|
|
1396
|
-
} = useContext
|
|
1396
|
+
} = useContext(PageContext);
|
|
1397
1397
|
const {
|
|
1398
1398
|
isFixed = true
|
|
1399
1399
|
} = header;
|
|
@@ -1561,7 +1561,7 @@ function Header({
|
|
|
1561
1561
|
const {
|
|
1562
1562
|
isMobile,
|
|
1563
1563
|
isTutorWebsite
|
|
1564
|
-
} = useContext
|
|
1564
|
+
} = useContext(PageContext);
|
|
1565
1565
|
const filterHiddenNavs = () => {
|
|
1566
1566
|
return data?.navs?.filter(dt => !dt.isHiddenNav);
|
|
1567
1567
|
};
|
|
@@ -1795,7 +1795,7 @@ function Footer({
|
|
|
1795
1795
|
const theme = useTheme();
|
|
1796
1796
|
const {
|
|
1797
1797
|
isCustomWebsite
|
|
1798
|
-
} = useContext
|
|
1798
|
+
} = useContext(PageContext);
|
|
1799
1799
|
const classes = useSectionStyles$9({
|
|
1800
1800
|
isCustomWebsite
|
|
1801
1801
|
});
|
|
@@ -2458,7 +2458,8 @@ function PageRenderer$1({
|
|
|
2458
2458
|
isCustomWebsite,
|
|
2459
2459
|
_id,
|
|
2460
2460
|
countryCode,
|
|
2461
|
-
currencySymbol
|
|
2461
|
+
currencySymbol,
|
|
2462
|
+
pageData
|
|
2462
2463
|
}), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, countryCode, currencySymbol]);
|
|
2463
2464
|
const theme = useMemo(() => generateTheme(color, font, context.isMobile), [color, font, context.isMobile]);
|
|
2464
2465
|
const Wrapper = SectionWrapper || Fragment;
|
|
@@ -2783,7 +2784,7 @@ function Carousel({
|
|
|
2783
2784
|
const sliderRef = useRef();
|
|
2784
2785
|
const {
|
|
2785
2786
|
isMobile
|
|
2786
|
-
} = useContext
|
|
2787
|
+
} = useContext(PageContext);
|
|
2787
2788
|
const classes = useCarouselStyles({
|
|
2788
2789
|
isMobile,
|
|
2789
2790
|
buttonContainerClass,
|
|
@@ -2861,7 +2862,7 @@ function Section$4({
|
|
|
2861
2862
|
isMobile,
|
|
2862
2863
|
isCustomWebsite,
|
|
2863
2864
|
countryCode
|
|
2864
|
-
} = useContext
|
|
2865
|
+
} = useContext(PageContext);
|
|
2865
2866
|
const classes = useSectionStyles$8({
|
|
2866
2867
|
isCustomWebsite,
|
|
2867
2868
|
isMobile,
|
|
@@ -2918,7 +2919,7 @@ function BannerCarouselRight({
|
|
|
2918
2919
|
layout: {
|
|
2919
2920
|
containerWidth
|
|
2920
2921
|
}
|
|
2921
|
-
} = useContext
|
|
2922
|
+
} = useContext(PageContext);
|
|
2922
2923
|
const classes = useSectionStyles$8({
|
|
2923
2924
|
containerWidth,
|
|
2924
2925
|
isMobile
|
|
@@ -3115,7 +3116,7 @@ function List({
|
|
|
3115
3116
|
containerWidth
|
|
3116
3117
|
},
|
|
3117
3118
|
isMobile
|
|
3118
|
-
} = useContext
|
|
3119
|
+
} = useContext(PageContext);
|
|
3119
3120
|
const classes = useSectionStyles$7({
|
|
3120
3121
|
containerWidth,
|
|
3121
3122
|
isMobile
|
|
@@ -3380,7 +3381,7 @@ const Section$3 = ({
|
|
|
3380
3381
|
isMobile,
|
|
3381
3382
|
isCustomWebsite,
|
|
3382
3383
|
countryCode
|
|
3383
|
-
} = useContext
|
|
3384
|
+
} = useContext(PageContext);
|
|
3384
3385
|
const hasContent = Boolean(nodeData.cardHeading.metadata.value || nodeData.title.metadata.valu || nodeData.description.metadata.value);
|
|
3385
3386
|
const mobileImageSrc = isMobile && nodeData?.mobileImage?.metadata?.value;
|
|
3386
3387
|
const desktopImageSrc = nodeData?.image?.metadata?.value;
|
|
@@ -3619,7 +3620,7 @@ function Section$2({
|
|
|
3619
3620
|
isMobile,
|
|
3620
3621
|
isCustomWebsite,
|
|
3621
3622
|
countryCode
|
|
3622
|
-
} = useContext
|
|
3623
|
+
} = useContext(PageContext);
|
|
3623
3624
|
const classes = useSectionStyles$5({
|
|
3624
3625
|
isCustomWebsite,
|
|
3625
3626
|
isMobile,
|
|
@@ -3676,7 +3677,7 @@ function BannerCarouselLeft({
|
|
|
3676
3677
|
layout: {
|
|
3677
3678
|
containerWidth
|
|
3678
3679
|
}
|
|
3679
|
-
} = useContext
|
|
3680
|
+
} = useContext(PageContext);
|
|
3680
3681
|
const classes = useSectionStyles$5({
|
|
3681
3682
|
containerWidth
|
|
3682
3683
|
});
|
|
@@ -3975,7 +3976,7 @@ function SubscribeToNewsletter({
|
|
|
3975
3976
|
isEdit,
|
|
3976
3977
|
isLandingPages,
|
|
3977
3978
|
extraProps
|
|
3978
|
-
} = useContext
|
|
3979
|
+
} = useContext(PageContext);
|
|
3979
3980
|
const [nodeData] = sectionData.components;
|
|
3980
3981
|
const classes = useSectionStyles$4({
|
|
3981
3982
|
containerWidth,
|
|
@@ -4279,7 +4280,7 @@ function Section$1({
|
|
|
4279
4280
|
layout: {
|
|
4280
4281
|
containerWidth
|
|
4281
4282
|
}
|
|
4282
|
-
} = useContext
|
|
4283
|
+
} = useContext(PageContext);
|
|
4283
4284
|
const carouselList = nodeData?.cardCarousel?.components;
|
|
4284
4285
|
const cardsCount = carouselList?.length;
|
|
4285
4286
|
const slidesToShow = isMobile ? 1 : 2;
|
|
@@ -4749,7 +4750,7 @@ function VideoTestimonial({
|
|
|
4749
4750
|
countryCode,
|
|
4750
4751
|
currencySymbol,
|
|
4751
4752
|
isMobile
|
|
4752
|
-
} = useContext
|
|
4753
|
+
} = useContext(PageContext);
|
|
4753
4754
|
const classes = useVideoTestimonialStyles({
|
|
4754
4755
|
containerWidth,
|
|
4755
4756
|
isMobile
|
|
@@ -4973,7 +4974,7 @@ function Video({
|
|
|
4973
4974
|
layout: {
|
|
4974
4975
|
containerWidth
|
|
4975
4976
|
}
|
|
4976
|
-
} = useContext
|
|
4977
|
+
} = useContext(PageContext);
|
|
4977
4978
|
const [videoData] = sectionData.components;
|
|
4978
4979
|
const cardsCount = videoData?.videoCarousel?.components?.length;
|
|
4979
4980
|
const slidesToShow = isMobile ? 1 : 2;
|
|
@@ -5179,7 +5180,7 @@ function Info({
|
|
|
5179
5180
|
layout: {
|
|
5180
5181
|
containerWidth
|
|
5181
5182
|
}
|
|
5182
|
-
} = useContext
|
|
5183
|
+
} = useContext(PageContext);
|
|
5183
5184
|
const theme = useTheme();
|
|
5184
5185
|
const slidesToShow = isMobile ? 1 : 4;
|
|
5185
5186
|
const [nodeData] = sectionData.components;
|
|
@@ -5336,7 +5337,7 @@ const TextSection = ({
|
|
|
5336
5337
|
containerWidth
|
|
5337
5338
|
},
|
|
5338
5339
|
isMobile
|
|
5339
|
-
} = useContext
|
|
5340
|
+
} = useContext(PageContext);
|
|
5340
5341
|
const classes = useSectionStyles$2({
|
|
5341
5342
|
containerWidth,
|
|
5342
5343
|
isMobile
|
|
@@ -5519,7 +5520,7 @@ function PhotoGallery({
|
|
|
5519
5520
|
layout: {
|
|
5520
5521
|
containerWidth
|
|
5521
5522
|
}
|
|
5522
|
-
} = useContext
|
|
5523
|
+
} = useContext(PageContext);
|
|
5523
5524
|
const [nodeData] = sectionData.components;
|
|
5524
5525
|
const carouselList = nodeData?.cardCarousel?.components;
|
|
5525
5526
|
const cardsCount = carouselList?.length;
|
|
@@ -5713,7 +5714,7 @@ const FAQListing = ({
|
|
|
5713
5714
|
containerWidth
|
|
5714
5715
|
},
|
|
5715
5716
|
isMobile
|
|
5716
|
-
} = useContext
|
|
5717
|
+
} = useContext(PageContext);
|
|
5717
5718
|
const classes = useFaqListStyles({
|
|
5718
5719
|
selectedIndex,
|
|
5719
5720
|
containerWidth,
|
|
@@ -5896,7 +5897,7 @@ const TextGrid = ({
|
|
|
5896
5897
|
layout: {
|
|
5897
5898
|
containerWidth
|
|
5898
5899
|
}
|
|
5899
|
-
} = useContext
|
|
5900
|
+
} = useContext(PageContext);
|
|
5900
5901
|
const [nodeData] = sectionData.components;
|
|
5901
5902
|
const cardsCount = nodeData?.contentList?.components?.length;
|
|
5902
5903
|
const slidesToShow = isMobile ? 1 : 2;
|
|
@@ -6289,7 +6290,7 @@ function CourseCard({
|
|
|
6289
6290
|
const classes = useCourseStyles();
|
|
6290
6291
|
const {
|
|
6291
6292
|
isEdit
|
|
6292
|
-
} = useContext
|
|
6293
|
+
} = useContext(PageContext);
|
|
6293
6294
|
const discount = parseInt((card?.price - card?.finalPrice) / card?.price * 100).toFixed(2);
|
|
6294
6295
|
const defaultCardImg = 'https://cp-assets-public.s3.ap-south-1.amazonaws.com/cams/cards-icon/default_course.png';
|
|
6295
6296
|
const price = formatCurrency(countryCode, card?.price, currencySymbol);
|
|
@@ -6354,7 +6355,7 @@ function courses({
|
|
|
6354
6355
|
isEdit,
|
|
6355
6356
|
countryCode,
|
|
6356
6357
|
currencySymbol
|
|
6357
|
-
} = useContext
|
|
6358
|
+
} = useContext(PageContext);
|
|
6358
6359
|
const [cardList, setCardList] = useState(null);
|
|
6359
6360
|
const [errored, setErrored] = useState(false);
|
|
6360
6361
|
const [fallBackImages, setFallbackImages] = useState([]);
|
|
@@ -6754,7 +6755,7 @@ function TeamCard({
|
|
|
6754
6755
|
layout: {
|
|
6755
6756
|
containerWidth
|
|
6756
6757
|
}
|
|
6757
|
-
} = useContext
|
|
6758
|
+
} = useContext(PageContext);
|
|
6758
6759
|
const [teamData] = sectionData.components;
|
|
6759
6760
|
const cardsCount = teamData?.teamCarousel?.components?.length;
|
|
6760
6761
|
const slidesToShow = isMobile ? 1 : 4;
|
|
@@ -6993,7 +6994,7 @@ function FormEnquiry({
|
|
|
6993
6994
|
isEdit,
|
|
6994
6995
|
isLandingPages,
|
|
6995
6996
|
extraProps
|
|
6996
|
-
} = useContext
|
|
6997
|
+
} = useContext(PageContext);
|
|
6997
6998
|
const classes = useSectionStyles$1({
|
|
6998
6999
|
containerWidth,
|
|
6999
7000
|
isMobile
|
|
@@ -7454,7 +7455,7 @@ function Contact({
|
|
|
7454
7455
|
isEdit,
|
|
7455
7456
|
isLandingPages,
|
|
7456
7457
|
extraProps
|
|
7457
|
-
} = useContext
|
|
7458
|
+
} = useContext(PageContext);
|
|
7458
7459
|
let [btnDisabled, setBtnDisabled] = useState(false);
|
|
7459
7460
|
const [isSubmitted, setIsSubmitted] = useState(false);
|
|
7460
7461
|
const [nodeData] = sectionData.components;
|
|
@@ -8113,7 +8114,7 @@ function CoursePromotionPage$1({
|
|
|
8113
8114
|
countryCode,
|
|
8114
8115
|
currencySymbol,
|
|
8115
8116
|
isMobile
|
|
8116
|
-
} = useContext
|
|
8117
|
+
} = useContext(PageContext);
|
|
8117
8118
|
const classes = useWebinarPromotionPage({
|
|
8118
8119
|
containerWidth,
|
|
8119
8120
|
isMobile,
|
|
@@ -8448,7 +8449,7 @@ const SingleVideoSlide = props => {
|
|
|
8448
8449
|
},
|
|
8449
8450
|
isMobile,
|
|
8450
8451
|
isEdit
|
|
8451
|
-
} = useContext
|
|
8452
|
+
} = useContext(PageContext);
|
|
8452
8453
|
const renderer = ({
|
|
8453
8454
|
days,
|
|
8454
8455
|
hours,
|
|
@@ -8705,7 +8706,7 @@ function CoursePromotionPage({
|
|
|
8705
8706
|
countryCode,
|
|
8706
8707
|
currencySymbol,
|
|
8707
8708
|
isMobile
|
|
8708
|
-
} = useContext
|
|
8709
|
+
} = useContext(PageContext);
|
|
8709
8710
|
const classes = useCoursePromotionPage({
|
|
8710
8711
|
containerWidth,
|
|
8711
8712
|
isMobile
|
|
@@ -8897,7 +8898,7 @@ const FormPage = ({
|
|
|
8897
8898
|
baseURLs,
|
|
8898
8899
|
isMobile,
|
|
8899
8900
|
countryCode
|
|
8900
|
-
} = useContext
|
|
8901
|
+
} = useContext(PageContext);
|
|
8901
8902
|
const classes = useFormPageStyles({
|
|
8902
8903
|
isMobile
|
|
8903
8904
|
});
|
|
@@ -9188,7 +9189,7 @@ function Tiles({
|
|
|
9188
9189
|
},
|
|
9189
9190
|
isPreview,
|
|
9190
9191
|
isEdit
|
|
9191
|
-
} = useContext
|
|
9192
|
+
} = useContext(PageContext);
|
|
9192
9193
|
const classes = useTilesStyles({
|
|
9193
9194
|
isMobile
|
|
9194
9195
|
});
|
|
@@ -9937,7 +9938,7 @@ function ABOUT_INSTITUTE({
|
|
|
9937
9938
|
containerWidth
|
|
9938
9939
|
},
|
|
9939
9940
|
isMobile
|
|
9940
|
-
} = useContext
|
|
9941
|
+
} = useContext(PageContext);
|
|
9941
9942
|
const classes = useAboutInstituteStyles({
|
|
9942
9943
|
containerWidth,
|
|
9943
9944
|
isMobile
|
|
@@ -10137,7 +10138,7 @@ const TimerAndCall = ({
|
|
|
10137
10138
|
pageData
|
|
10138
10139
|
} = useContext(PageContext);
|
|
10139
10140
|
const [nodeData] = sectionData?.components;
|
|
10140
|
-
console.log('sid
|
|
10141
|
+
console.log('sid sectionData1', sectionData, extraProps, pageData);
|
|
10141
10142
|
const classes = useTimerCallPageStyles({
|
|
10142
10143
|
isMobile
|
|
10143
10144
|
});
|