diy-template-components 1.0.46 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.es.js CHANGED
@@ -5259,6 +5259,12 @@ function PhotoGallery({
5259
5259
  sectionIndex
5260
5260
  }) {
5261
5261
  const {
5262
+ templateId,
5263
+ navList,
5264
+ isPreview,
5265
+ isEdit,
5266
+ basePath,
5267
+ isMasterTemplate,
5262
5268
  isMobile,
5263
5269
  layout: {
5264
5270
  containerWidth
@@ -5284,17 +5290,34 @@ function PhotoGallery({
5284
5290
  centerPadding: isMobile ? '10px 0 0' : '80px 0 0',
5285
5291
  arrows: false
5286
5292
  };
5287
- const handleClick = link => {
5288
- if (link) {
5289
- window.open(link, '_blank');
5293
+ const handleClick = data => {
5294
+ let redirectUrl;
5295
+ const {
5296
+ isExistingLink,
5297
+ link
5298
+ } = data;
5299
+ if (isExistingLink && link === "courses") {
5300
+ redirectUrl = `//${basePath}/courses`;
5301
+ } else if (isExistingLink && link) {
5302
+ // const { pageId } = navList.find((el) => el.slug === data?.link) || {};
5303
+ redirectUrl = `//${basePath}/${link}`;
5304
+ } else {
5305
+ redirectUrl = link;
5306
+ }
5307
+ if (redirectUrl) {
5308
+ window.open(redirectUrl, '_blank');
5290
5309
  }
5291
5310
  };
5311
+
5312
+ // useLinkBuilder(data);
5313
+
5292
5314
  const carouselContent = carouselList?.map((el, idx) => {
5315
+ const metadata = el?.cardImage?.metadata;
5293
5316
  const link = el?.cardImage?.metadata?.link;
5294
5317
  return /*#__PURE__*/React.createElement(Fragment, {
5295
5318
  key: idx
5296
5319
  }, /*#__PURE__*/React.createElement("div", {
5297
- onClick: () => handleClick(link),
5320
+ onClick: () => handleClick(metadata),
5298
5321
  className: `${classes.singleCard} ${link && classes.cursorPointer}`
5299
5322
  }, /*#__PURE__*/React.createElement(NextImageRenderer, {
5300
5323
  src: el?.cardImage?.metadata?.value,