@gem-sdk/plugin-loox 1.0.0 → 1.11.0
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.
|
@@ -6,29 +6,41 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var Script = require('next/script');
|
|
8
8
|
|
|
9
|
-
const ProductReview = ({ productId, type, shop
|
|
10
|
-
const props = react.useMemo(()
|
|
11
|
-
switch
|
|
12
|
-
case 'star':
|
|
13
|
-
return {
|
|
14
|
-
'data-fetch': true,
|
|
15
|
-
className: 'loox-rating',
|
|
16
|
-
'data-id': productId
|
|
17
|
-
};
|
|
18
|
-
case 'carousel':
|
|
19
|
-
return {
|
|
20
|
-
id: 'looxCarousel',
|
|
21
|
-
'data-show-more': true,
|
|
22
|
-
'data-product-ids': productId
|
|
23
|
-
};
|
|
24
|
-
default:
|
|
25
|
-
return {
|
|
26
|
-
id: 'looxReviews',
|
|
27
|
-
'data-product-id': productId
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}, [
|
|
31
|
-
|
|
9
|
+
const ProductReview = ({ productId , type , shop })=>{
|
|
10
|
+
const props = react.useMemo(()=>{
|
|
11
|
+
switch(type){
|
|
12
|
+
case 'star':
|
|
13
|
+
return {
|
|
14
|
+
'data-fetch': true,
|
|
15
|
+
className: 'loox-rating',
|
|
16
|
+
'data-id': productId
|
|
17
|
+
};
|
|
18
|
+
case 'carousel':
|
|
19
|
+
return {
|
|
20
|
+
id: 'looxCarousel',
|
|
21
|
+
'data-show-more': true,
|
|
22
|
+
'data-product-ids': productId
|
|
23
|
+
};
|
|
24
|
+
default:
|
|
25
|
+
return {
|
|
26
|
+
id: 'looxReviews',
|
|
27
|
+
'data-product-id': productId
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}, [
|
|
31
|
+
productId,
|
|
32
|
+
type
|
|
33
|
+
]);
|
|
34
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ jsxRuntime.jsx(Script, {
|
|
37
|
+
src: `//loox.io/widget/loox.js?shop=${shop}`
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
40
|
+
...props
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
});
|
|
32
44
|
};
|
|
33
45
|
|
|
34
46
|
exports.default = ProductReview;
|
|
@@ -2,29 +2,41 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import Script from 'next/script';
|
|
4
4
|
|
|
5
|
-
const ProductReview = ({ productId, type, shop
|
|
6
|
-
const props = useMemo(()
|
|
7
|
-
switch
|
|
8
|
-
case 'star':
|
|
9
|
-
return {
|
|
10
|
-
'data-fetch': true,
|
|
11
|
-
className: 'loox-rating',
|
|
12
|
-
'data-id': productId
|
|
13
|
-
};
|
|
14
|
-
case 'carousel':
|
|
15
|
-
return {
|
|
16
|
-
id: 'looxCarousel',
|
|
17
|
-
'data-show-more': true,
|
|
18
|
-
'data-product-ids': productId
|
|
19
|
-
};
|
|
20
|
-
default:
|
|
21
|
-
return {
|
|
22
|
-
id: 'looxReviews',
|
|
23
|
-
'data-product-id': productId
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}, [
|
|
27
|
-
|
|
5
|
+
const ProductReview = ({ productId , type , shop })=>{
|
|
6
|
+
const props = useMemo(()=>{
|
|
7
|
+
switch(type){
|
|
8
|
+
case 'star':
|
|
9
|
+
return {
|
|
10
|
+
'data-fetch': true,
|
|
11
|
+
className: 'loox-rating',
|
|
12
|
+
'data-id': productId
|
|
13
|
+
};
|
|
14
|
+
case 'carousel':
|
|
15
|
+
return {
|
|
16
|
+
id: 'looxCarousel',
|
|
17
|
+
'data-show-more': true,
|
|
18
|
+
'data-product-ids': productId
|
|
19
|
+
};
|
|
20
|
+
default:
|
|
21
|
+
return {
|
|
22
|
+
id: 'looxReviews',
|
|
23
|
+
'data-product-id': productId
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}, [
|
|
27
|
+
productId,
|
|
28
|
+
type
|
|
29
|
+
]);
|
|
30
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ jsx(Script, {
|
|
33
|
+
src: `//loox.io/widget/loox.js?shop=${shop}`
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ jsx("div", {
|
|
36
|
+
...props
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
28
40
|
};
|
|
29
41
|
|
|
30
42
|
export { ProductReview as default };
|
package/dist/esm/index.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
type ProductReviewProps = {
|
|
2
|
-
productId: string;
|
|
3
|
-
type?: 'star' | 'carousel' | 'default';
|
|
4
|
-
shop: string;
|
|
5
|
-
};
|
|
1
|
+
type ProductReviewProps = {
|
|
2
|
+
productId: string;
|
|
3
|
+
type?: 'star' | 'carousel' | 'default';
|
|
4
|
+
shop: string;
|
|
5
|
+
};
|
|
6
6
|
declare const ProductReview: React.FC<ProductReviewProps>;
|
|
7
7
|
|
|
8
8
|
export { ProductReview as default };
|