diy-template-components 0.2.33 → 0.2.34

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
@@ -1,16 +1,17 @@
1
- function ___$insertStyle(css) {
2
- if (!css || typeof window === 'undefined') {
3
- return;
4
- }
5
- const style = document.createElement('style');
6
- style.setAttribute('type', 'text/css');
7
- style.innerHTML = css;
8
- document.head.appendChild(style);
9
- return css;
1
+ function ___$insertStyle(css) {
2
+ if (!css || !window) {
3
+ return;
4
+ }
5
+ const style = document.createElement('style');
6
+ style.setAttribute('type', 'text/css');
7
+ style.innerHTML = css;
8
+ document.head.appendChild(style);
9
+ return css;
10
10
  }
11
11
 
12
12
  import React, { createContext, useContext, forwardRef, useRef, useEffect, useState, useMemo, useLayoutEffect, Suspense, memo, lazy, Fragment } from 'react';
13
13
  import Slider from 'react-slick';
14
+ import Image from 'next/image';
14
15
  import axios from 'axios';
15
16
  import moment from 'moment';
16
17
  import Countdown from 'react-countdown';
@@ -2271,39 +2272,34 @@ const NextImageRenderer = ({
2271
2272
  src,
2272
2273
  ...props
2273
2274
  }) => {
2274
- try {
2275
- const {
2276
- isCustomWebsite
2277
- } = useContext(PageContext);
2278
- let {
2279
- refSetter,
2280
- className
2281
- } = props;
2282
- if (isCustomWebsite) {
2283
- return /*#__PURE__*/React.createElement(require.resolve('next/image').default, {
2284
- src: src,
2285
- // height: "640",
2286
- // width: "959",
2287
- layout: 'fill',
2288
- ref: {
2289
- refSetter
2290
- },
2291
- className: {
2292
- className
2293
- },
2294
- ...props
2295
- });
2296
- } else {
2297
- return /*#__PURE__*/React.createElement("img", {
2298
- ref: refSetter,
2299
- className: className,
2300
- src: src
2301
- });
2302
- }
2303
- } catch (err) {
2304
- return {
2305
- notFound: true
2306
- };
2275
+ const {
2276
+ isCustomWebsite
2277
+ } = useContext(PageContext);
2278
+ let {
2279
+ refSetter,
2280
+ className
2281
+ } = props;
2282
+ if (isCustomWebsite) {
2283
+ // return (React.createElement(require.resolve('next/image').default, {
2284
+ // src: src,
2285
+ // layout: 'fill',
2286
+ // ref: { refSetter },
2287
+ // className: { className },
2288
+ // ...props
2289
+ // });)
2290
+
2291
+ return /*#__PURE__*/React.createElement(Image, _extends({
2292
+ src: src,
2293
+ layout: 'fill',
2294
+ ref: refSetter,
2295
+ className: className
2296
+ }, props));
2297
+ } else {
2298
+ return /*#__PURE__*/React.createElement("img", {
2299
+ ref: refSetter,
2300
+ className: className,
2301
+ src: src
2302
+ });
2307
2303
  }
2308
2304
  };
2309
2305