diy-template-components 0.1.13 → 0.1.16

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
@@ -6805,7 +6805,7 @@ const SingleVideoSlide$1 = props => {
6805
6805
  className: classes.iframeSuperContainer
6806
6806
  }, /*#__PURE__*/React.createElement("div", {
6807
6807
  className: classes.videoDetails
6808
- }, data?.isPaid ? /*#__PURE__*/React.createElement("h3", {
6808
+ }, data?.isPaid && checkIfOfferIsValid() ? /*#__PURE__*/React.createElement("h3", {
6809
6809
  className: classes.bannerContainer
6810
6810
  }, 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")) : null, /*#__PURE__*/React.createElement("h3", {
6811
6811
  ref: data?.videoTextHeading?.refSetter,
@@ -6819,11 +6819,12 @@ 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.startDate).format('Do MMM YY') + ' ', moment(data.startTime).format('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
- name: 'Video'
6826
- }), /*#__PURE__*/React.createElement("div", null, data.webinarLocation))), /*#__PURE__*/React.createElement("p", {
6825
+ width: "20px",
6826
+ name: `${data.webinarLocation === 'Location' ? 'Location' : 'Video'}`
6827
+ }), /*#__PURE__*/React.createElement("div", null, data.webinarLocation === 'Location' ? data.webinarLink : data.webinarLocation))), /*#__PURE__*/React.createElement("p", {
6827
6828
  ref: data?.videoTextContent?.refSetter,
6828
6829
  className: classes.courseDetailContent,
6829
6830
  dangerouslySetInnerHTML: {
@@ -6857,7 +6858,7 @@ const SingleVideoSlide$1 = props => {
6857
6858
  className: classes.priceContainer
6858
6859
  }, /*#__PURE__*/React.createElement("div", {
6859
6860
  className: classes.offerPrice
6860
- }, "\u20B9", data?.effectivePrice), /*#__PURE__*/React.createElement("p", {
6861
+ }, "\u20B9", data?.effectivePrice), data?.discount > 0 && checkIfOfferIsValid() && /*#__PURE__*/React.createElement("p", {
6861
6862
  style: {
6862
6863
  fontSize: '20px',
6863
6864
  marginTop: '0px'
@@ -7033,7 +7034,9 @@ const useCoursePromotionPage = createUseStyles(theme => {
7033
7034
  backgroundColor: '#f4f9ff',
7034
7035
  display: 'flex',
7035
7036
  flexDirection: 'column',
7036
- borderRadius: '10px'
7037
+ borderRadius: '10px',
7038
+ paddingBottom: '10px',
7039
+ paddingTop: '10px'
7037
7040
  },
7038
7041
  bannerContainer: {
7039
7042
  background: '#EB5757',
@@ -7113,7 +7116,8 @@ const useCoursePromotionPage = createUseStyles(theme => {
7113
7116
  },
7114
7117
  '@media (max-width: 767px)': {
7115
7118
  courseViewContainer: {
7116
- width: '100%'
7119
+ width: '100%',
7120
+ paddingBottom: '10px'
7117
7121
  },
7118
7122
  courseSuperContainer: {
7119
7123
  padding: '20px 10px 60px 20px'
@@ -7156,17 +7160,18 @@ const SingleVideoSlide = props => {
7156
7160
  }, []);
7157
7161
 
7158
7162
  const renderer = ({
7163
+ days,
7159
7164
  hours,
7160
7165
  minutes,
7161
7166
  seconds,
7162
7167
  completed
7163
7168
  }) => {
7164
- if (hours < 24) {
7165
- 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");
7166
7171
  } else {
7167
- let given = moment(props.data.endTime);
7172
+ let given = moment(props.data.endDate);
7168
7173
  let current = moment().startOf('day');
7169
- 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");
7170
7175
  }
7171
7176
  };
7172
7177
 
@@ -7174,8 +7179,18 @@ const SingleVideoSlide = props => {
7174
7179
  data,
7175
7180
  courseBuyNow
7176
7181
  } = props;
7182
+
7183
+ const checkIfOfferIsValid = () => moment().diff(moment(props?.data?.endDate || 0)) < 0;
7184
+
7177
7185
  const classes = useCoursePromotionPage();
7178
- console.log(courseBuyNow, 'courseBuyNow');
7186
+
7187
+ const discount = ({
7188
+ price,
7189
+ discount
7190
+ }) => {
7191
+ return (discount / price * 100).toFixed(2);
7192
+ };
7193
+
7179
7194
  return /*#__PURE__*/React.createElement("div", {
7180
7195
  className: classes.videoCarouselContainer
7181
7196
  }, /*#__PURE__*/React.createElement("div", {
@@ -7184,7 +7199,7 @@ const SingleVideoSlide = props => {
7184
7199
  className: classes.iframeSuperContainer
7185
7200
  }, /*#__PURE__*/React.createElement("div", {
7186
7201
  className: classes.videoDetails
7187
- }, /*#__PURE__*/React.createElement("h3", {
7202
+ }, (checkIfOfferIsValid() || data.offerPriceValidFor > 0) && /*#__PURE__*/React.createElement("h3", {
7188
7203
  className: classes.bannerContainer
7189
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", {
7190
7205
  className: classes.emblemContainer
@@ -7230,7 +7245,7 @@ const SingleVideoSlide = props => {
7230
7245
  }
7231
7246
  }))), /*#__PURE__*/React.createElement("div", {
7232
7247
  className: classes.courseViewContainer
7233
- }, /*#__PURE__*/React.createElement("p", {
7248
+ }, checkIfOfferIsValid() && /*#__PURE__*/React.createElement("p", {
7234
7249
  className: classes.offerText
7235
7250
  }, "Offer Ends in", ' ', /*#__PURE__*/React.createElement("span", {
7236
7251
  className: classes.courseDetailTime
@@ -7250,7 +7265,7 @@ const SingleVideoSlide = props => {
7250
7265
  className: classes.priceContainer
7251
7266
  }, /*#__PURE__*/React.createElement("div", {
7252
7267
  className: classes.offerPrice
7253
- }, "\u20B9 ", data.effectivePrice), /*#__PURE__*/React.createElement("p", {
7268
+ }, "\u20B9 ", data.effectivePrice), data.discount > 0 && checkIfOfferIsValid() && /*#__PURE__*/React.createElement("p", {
7254
7269
  style: {
7255
7270
  fontSize: '20px',
7256
7271
  marginTop: '0px'
@@ -7259,7 +7274,7 @@ const SingleVideoSlide = props => {
7259
7274
  className: classes.originalPrice
7260
7275
  }, "\u20B9 ", data.price), ' ', /*#__PURE__*/React.createElement("span", {
7261
7276
  className: classes.offerDiscount
7262
- }, "50% OFF"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
7277
+ }, `${data && discount(data)}%`))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
7263
7278
  style: {
7264
7279
  width: '150px'
7265
7280
  },