diy-template-components 0.2.66 → 0.2.67

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
@@ -1134,10 +1134,8 @@ const NextImageRenderer = ({
1134
1134
  const {
1135
1135
  isCustomWebsite,
1136
1136
  pageData,
1137
- isMobile,
1138
- ASSET_PREFIX_URL
1137
+ isMobile
1139
1138
  } = useContext(PageContext);
1140
- console.log("pageRenderer wrapper", ASSET_PREFIX_URL);
1141
1139
  try {
1142
1140
  let {
1143
1141
  refSetter,
@@ -1155,8 +1153,8 @@ const NextImageRenderer = ({
1155
1153
  desktop: 1200
1156
1154
  };
1157
1155
  const dynamicWidth = isMobile ? breakpoints.mobile : breakpoints?.desktop;
1158
- if (ASSET_PREFIX_URL !== undefined) {
1159
- return `${ASSET_PREFIX_URL}/_next/image?url=${src}&w=${width}&q=${quality || 75}`;
1156
+ if (process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX !== undefined) {
1157
+ return `${process.env.NEXT_PUBLIC_ENV_ASSET_PREFIX}/_next/image?url=${src}&w=${width}&q=${quality || 75}`;
1160
1158
  } else {
1161
1159
  return `/_next/image?url=${src}&w=${width}&q=${quality || 75}`;
1162
1160
  }
@@ -2070,11 +2068,9 @@ function PageRenderer$1({
2070
2068
  isTutorWebsite = false,
2071
2069
  extraProps,
2072
2070
  hideLogin,
2073
- isCustomWebsite,
2074
- ASSET_PREFIX_URL = undefined
2071
+ isCustomWebsite
2075
2072
  }) {
2076
2073
  const theme = useMemo(() => getTheme(color, font), [color, font]);
2077
- console.log("pageRenderer", ASSET_PREFIX_URL);
2078
2074
  const navList = header?.navs;
2079
2075
  const context = useMemo(() => ({
2080
2076
  isMobile,
@@ -2093,9 +2089,8 @@ function PageRenderer$1({
2093
2089
  extraProps,
2094
2090
  hideLogin,
2095
2091
  isCustomWebsite,
2096
- _id,
2097
- ASSET_PREFIX_URL
2098
- }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, ASSET_PREFIX_URL]);
2092
+ _id
2093
+ }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
2099
2094
  const Wrapper = SectionWrapper || Fragment;
2100
2095
  return /*#__PURE__*/React.createElement(ThemeProvider, {
2101
2096
  theme: theme
@@ -7108,6 +7103,9 @@ const SingleVideoSlide$1 = props => {
7108
7103
  };
7109
7104
  const checkIfOfferIsValid = () => moment().diff(moment(props.data.offerPriceEndDate)) < 0;
7110
7105
  const checkForShowDiscount = () => {
7106
+ if (checkIfOfferIsValid() && data?.discount) {
7107
+ return true;
7108
+ }
7111
7109
  if (props.data.endDate === null || checkIfOfferIsValid()) {
7112
7110
  if (data.discount > 0 && data.offerPriceValidFor === 0) {
7113
7111
  return true;
@@ -7143,7 +7141,7 @@ const SingleVideoSlide$1 = props => {
7143
7141
  className: classes.iframeSuperContainer
7144
7142
  }, /*#__PURE__*/React.createElement("div", {
7145
7143
  className: classes.videoDetails
7146
- }, data?.isPaid !== 0 && (checkIfOfferIsValid() || data.offerPriceValidFor > 0) && data.offerPriceValidFor > conversions && /*#__PURE__*/React.createElement("div", null, data.offerPriceValidFor - conversions > 0 && data.discount && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) ? /*#__PURE__*/React.createElement("div", {
7144
+ }, data?.isPaid !== 0 && (checkIfOfferIsValid() || data.offerPriceValidFor > 0) && /*#__PURE__*/React.createElement("div", null, data.offerPriceValidFor - conversions > 0 && data.discount && (data.offerPriceEndDate ? checkIfOfferIsValid() : true) ? /*#__PURE__*/React.createElement("div", {
7147
7145
  className: classes.bannerContainer
7148
7146
  }, /*#__PURE__*/React.createElement("div", {
7149
7147
  className: classes.bannerContainerText
@@ -7191,7 +7189,7 @@ const SingleVideoSlide$1 = props => {
7191
7189
  }
7192
7190
  }))), /*#__PURE__*/React.createElement("div", {
7193
7191
  className: classes.courseViewContainer
7194
- }, data.isPaid !== 0 && checkIfOfferIsValid() && (data.offerPriceValidFor !== 0 ? data.offerPriceValidFor - conversions > 0 : true) && /*#__PURE__*/React.createElement("p", {
7192
+ }, data.isPaid !== 0 && checkIfOfferIsValid() && (data.offerPriceValidFor === 0 ? data.offerPriceValidFor - conversions > 0 : true) && /*#__PURE__*/React.createElement("p", {
7195
7193
  className: classes.offerText
7196
7194
  }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7197
7195
  className: classes.courseDetailTime
@@ -8833,12 +8831,10 @@ function PageRenderer({
8833
8831
  templateId,
8834
8832
  isTutorWebsite = false,
8835
8833
  extraProps,
8836
- hideLogin,
8837
- ASSET_PREFIX_URL
8834
+ hideLogin
8838
8835
  }) {
8839
8836
  const theme = useMemo(() => getTheme(color, font), [color, font]);
8840
8837
  const navList = header?.navs;
8841
- console.log("pageRenderer static", ASSET_PREFIX_URL);
8842
8838
  const context = useMemo(() => ({
8843
8839
  isMobile,
8844
8840
  isLandingPages,
@@ -8856,9 +8852,8 @@ function PageRenderer({
8856
8852
  extraProps,
8857
8853
  hideLogin,
8858
8854
  isCustomWebsite,
8859
- _id,
8860
- ASSET_PREFIX_URL
8861
- }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id, ASSET_PREFIX_URL]);
8855
+ _id
8856
+ }), [isMobile, isLandingPages, layout, baseURLs, hashToken, isPreview, isEdit, templateId, navList, isMasterTemplate, basePath, validations, isTutorWebsite, extraProps, hideLogin, _id]);
8862
8857
  const Wrapper = SectionWrapper || Fragment;
8863
8858
  return /*#__PURE__*/React.createElement(ThemeProvider, {
8864
8859
  theme: theme