diy-template-components 1.0.35 → 1.0.36

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
@@ -5964,7 +5964,8 @@ const formatCurrency = (countryCode, value, currencySymbol) => {
5964
5964
  function CourseCard({
5965
5965
  card,
5966
5966
  countryCode,
5967
- currencySymbol
5967
+ currencySymbol,
5968
+ utmParams
5968
5969
  }) {
5969
5970
  const classes = useCourseStyles();
5970
5971
  const {
@@ -6014,7 +6015,7 @@ function CourseCard({
6014
6015
  className: classes.courseCardStrikePrice
6015
6016
  }, /*#__PURE__*/React__default["default"].createElement("span", null, price), " ", discount > 0 && discount + `% ${offText}`) : null), /*#__PURE__*/React__default["default"].createElement("a", {
6016
6017
  className: classes.coursesAnchorTag,
6017
- href: isEdit ? null : card?.shareableLink
6018
+ href: isEdit ? null : utmParams ? card?.shareableLink + `?flyy_utm_referrer=${utmParams}` : card?.shareableLink
6018
6019
  }, /*#__PURE__*/React__default["default"].createElement("div", {
6019
6020
  className: classes.courseCardBuyBtn
6020
6021
  }, buyNowText)))));
@@ -6044,6 +6045,7 @@ function courses({
6044
6045
  isMobile
6045
6046
  });
6046
6047
  const [nodeData] = sectionData?.components;
6048
+ const [utmParams, setUtmParams] = React.useState('');
6047
6049
  const handleApiCall = () => {
6048
6050
  if (baseURLs) {
6049
6051
  getCourseList(baseURLs, hashToken).then(response => {
@@ -6089,6 +6091,11 @@ function courses({
6089
6091
  else {
6090
6092
  handleApiCall();
6091
6093
  }
6094
+ const params = new URLSearchParams(window.location.search);
6095
+ const utmParams = params.get('flyy_utm_referrer');
6096
+ if (utmParams) {
6097
+ setUtmParams(utmParams);
6098
+ }
6092
6099
  }, []);
6093
6100
  const settings = {
6094
6101
  className: classes.slickContainer,
@@ -6126,7 +6133,8 @@ function courses({
6126
6133
  key: index,
6127
6134
  card: card,
6128
6135
  countryCode: countryCode,
6129
- currencySymbol: currencySymbol
6136
+ currencySymbol: currencySymbol,
6137
+ utmParams: utmParams
6130
6138
  })) : fallBackImages?.map((dt, ind) => {
6131
6139
  return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
6132
6140
  key: ind