diy-template-components 0.1.14 → 0.1.15

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
@@ -6819,7 +6819,7 @@ const SingleVideoSlide$1 = props => {
6819
6819
  className: classes.courseDetailTag
6820
6820
  }, /*#__PURE__*/React.createElement(Icon, {
6821
6821
  name: 'Calendar'
6822
- }), /*#__PURE__*/React.createElement("div", null, moment(data.startDate).format('dddd, MMMM Do, h:mm:ss'))), /*#__PURE__*/React.createElement("div", {
6822
+ }), /*#__PURE__*/React.createElement("div", null, moment(data.startTime).format('Do MMM YY, h:mm A'), /*#__PURE__*/React.createElement("span", null, " - "), moment(data.endTime).format('h:mm A'))), /*#__PURE__*/React.createElement("div", {
6823
6823
  className: classes.courseDetailTag
6824
6824
  }, /*#__PURE__*/React.createElement(Icon, {
6825
6825
  width: "20px",
@@ -6854,11 +6854,11 @@ const SingleVideoSlide$1 = props => {
6854
6854
  videoUrl: data.thumbnail
6855
6855
  })), /*#__PURE__*/React.createElement("div", {
6856
6856
  className: classes.bottomContainer
6857
- }, data.isPaid && checkIfOfferIsValid() ? /*#__PURE__*/React.createElement("div", {
6857
+ }, data.isPaid ? /*#__PURE__*/React.createElement("div", {
6858
6858
  className: classes.priceContainer
6859
6859
  }, /*#__PURE__*/React.createElement("div", {
6860
6860
  className: classes.offerPrice
6861
- }, "\u20B9", data?.effectivePrice), /*#__PURE__*/React.createElement("p", {
6861
+ }, "\u20B9", data?.effectivePrice), data?.discount > 0 && checkIfOfferIsValid() && /*#__PURE__*/React.createElement("p", {
6862
6862
  style: {
6863
6863
  fontSize: '20px',
6864
6864
  marginTop: '0px'
@@ -7034,7 +7034,9 @@ const useCoursePromotionPage = createUseStyles(theme => {
7034
7034
  backgroundColor: '#f4f9ff',
7035
7035
  display: 'flex',
7036
7036
  flexDirection: 'column',
7037
- borderRadius: '10px'
7037
+ borderRadius: '10px',
7038
+ paddingBottom: '10px',
7039
+ paddingTop: '10px'
7038
7040
  },
7039
7041
  bannerContainer: {
7040
7042
  background: '#EB5757',
@@ -7114,7 +7116,8 @@ const useCoursePromotionPage = createUseStyles(theme => {
7114
7116
  },
7115
7117
  '@media (max-width: 767px)': {
7116
7118
  courseViewContainer: {
7117
- width: '100%'
7119
+ width: '100%',
7120
+ paddingBottom: '10px'
7118
7121
  },
7119
7122
  courseSuperContainer: {
7120
7123
  padding: '20px 10px 60px 20px'
@@ -7157,17 +7160,18 @@ const SingleVideoSlide = props => {
7157
7160
  }, []);
7158
7161
 
7159
7162
  const renderer = ({
7163
+ days,
7160
7164
  hours,
7161
7165
  minutes,
7162
7166
  seconds,
7163
7167
  completed
7164
7168
  }) => {
7165
- if (hours < 24) {
7166
- return /*#__PURE__*/React.createElement("span", null, hours, ":", minutes, ":", seconds);
7169
+ if (days === 0 && hours < 24) {
7170
+ return /*#__PURE__*/React.createElement("span", null, hours, "h ", minutes, "m ", seconds, "s");
7167
7171
  } else {
7168
- let given = moment(props.data.endTime);
7172
+ let given = moment(props.data.endDate);
7169
7173
  let current = moment().startOf('day');
7170
- return /*#__PURE__*/React.createElement("span", null, moment.duration(given.diff(current)).asDays());
7174
+ return /*#__PURE__*/React.createElement("span", null, Math.floor(moment.duration(given.diff(current)).asDays()), " days");
7171
7175
  }
7172
7176
  };
7173
7177
 
@@ -7175,8 +7179,18 @@ const SingleVideoSlide = props => {
7175
7179
  data,
7176
7180
  courseBuyNow
7177
7181
  } = props;
7182
+
7183
+ const checkIfOfferIsValid = () => moment().diff(moment(props?.data?.endDate || 0)) < 0;
7184
+
7178
7185
  const classes = useCoursePromotionPage();
7179
- console.log(courseBuyNow, 'courseBuyNow');
7186
+
7187
+ const discount = ({
7188
+ price,
7189
+ discount
7190
+ }) => {
7191
+ return (discount / price * 100).toFixed(2);
7192
+ };
7193
+
7180
7194
  return /*#__PURE__*/React.createElement("div", {
7181
7195
  className: classes.videoCarouselContainer
7182
7196
  }, /*#__PURE__*/React.createElement("div", {
@@ -7185,7 +7199,7 @@ const SingleVideoSlide = props => {
7185
7199
  className: classes.iframeSuperContainer
7186
7200
  }, /*#__PURE__*/React.createElement("div", {
7187
7201
  className: classes.videoDetails
7188
- }, /*#__PURE__*/React.createElement("h3", {
7202
+ }, (checkIfOfferIsValid() || data.offerPriceValidFor > 0) && /*#__PURE__*/React.createElement("h3", {
7189
7203
  className: classes.bannerContainer
7190
7204
  }, data.offerPriceValidFor <= 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, "Hurry up! Offer for limited period only") : /*#__PURE__*/React.createElement(React.Fragment, null, "Hurry up! Offer is left for ", data.offerPriceValidFor, " users now")), /*#__PURE__*/React.createElement("div", {
7191
7205
  className: classes.emblemContainer
@@ -7231,7 +7245,7 @@ const SingleVideoSlide = props => {
7231
7245
  }
7232
7246
  }))), /*#__PURE__*/React.createElement("div", {
7233
7247
  className: classes.courseViewContainer
7234
- }, /*#__PURE__*/React.createElement("p", {
7248
+ }, checkIfOfferIsValid() && /*#__PURE__*/React.createElement("p", {
7235
7249
  className: classes.offerText
7236
7250
  }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7237
7251
  className: classes.courseDetailTime
@@ -7251,7 +7265,7 @@ const SingleVideoSlide = props => {
7251
7265
  className: classes.priceContainer
7252
7266
  }, /*#__PURE__*/React.createElement("div", {
7253
7267
  className: classes.offerPrice
7254
- }, "\u20B9 ", data.effectivePrice), /*#__PURE__*/React.createElement("p", {
7268
+ }, "\u20B9 ", data.effectivePrice), data.discount > 0 && checkIfOfferIsValid() && /*#__PURE__*/React.createElement("p", {
7255
7269
  style: {
7256
7270
  fontSize: '20px',
7257
7271
  marginTop: '0px'
@@ -7260,7 +7274,7 @@ const SingleVideoSlide = props => {
7260
7274
  className: classes.originalPrice
7261
7275
  }, "\u20B9 ", data.price), ' ', /*#__PURE__*/React.createElement("span", {
7262
7276
  className: classes.offerDiscount
7263
- }, "50% OFF"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
7277
+ }, `${data && discount(data)}%`))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
7264
7278
  style: {
7265
7279
  width: '150px'
7266
7280
  },