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.js CHANGED
@@ -5275,6 +5275,12 @@ function PhotoGallery({
5275
5275
  sectionIndex
5276
5276
  }) {
5277
5277
  const {
5278
+ templateId,
5279
+ navList,
5280
+ isPreview,
5281
+ isEdit,
5282
+ basePath,
5283
+ isMasterTemplate,
5278
5284
  isMobile,
5279
5285
  layout: {
5280
5286
  containerWidth
@@ -5300,17 +5306,34 @@ function PhotoGallery({
5300
5306
  centerPadding: isMobile ? '10px 0 0' : '80px 0 0',
5301
5307
  arrows: false
5302
5308
  };
5303
- const handleClick = link => {
5304
- if (link) {
5305
- window.open(link, '_blank');
5309
+ const handleClick = data => {
5310
+ let redirectUrl;
5311
+ const {
5312
+ isExistingLink,
5313
+ link
5314
+ } = data;
5315
+ if (isExistingLink && link === "courses") {
5316
+ redirectUrl = `//${basePath}/courses`;
5317
+ } else if (isExistingLink && link) {
5318
+ // const { pageId } = navList.find((el) => el.slug === data?.link) || {};
5319
+ redirectUrl = `//${basePath}/${link}`;
5320
+ } else {
5321
+ redirectUrl = link;
5322
+ }
5323
+ if (redirectUrl) {
5324
+ window.open(redirectUrl, '_blank');
5306
5325
  }
5307
5326
  };
5327
+
5328
+ // useLinkBuilder(data);
5329
+
5308
5330
  const carouselContent = carouselList?.map((el, idx) => {
5331
+ const metadata = el?.cardImage?.metadata;
5309
5332
  const link = el?.cardImage?.metadata?.link;
5310
5333
  return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
5311
5334
  key: idx
5312
5335
  }, /*#__PURE__*/React__default["default"].createElement("div", {
5313
- onClick: () => handleClick(link),
5336
+ onClick: () => handleClick(metadata),
5314
5337
  className: `${classes.singleCard} ${link && classes.cursorPointer}`
5315
5338
  }, /*#__PURE__*/React__default["default"].createElement(NextImageRenderer, {
5316
5339
  src: el?.cardImage?.metadata?.value,