@gem-sdk/components 2.0.0-dev.364 → 2.0.0-dev.365

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.
@@ -18,21 +18,20 @@ const useListCarousel = (props)=>{
18
18
  ]);
19
19
  const listRender = React.useMemo(()=>{
20
20
  const listItem = list();
21
- if (vertical) return [
22
- ...productImages
23
- ];
24
- if (listItem.length < itemPerRow) {
25
- const temp = [
21
+ if (listItem.length >= itemPerRow) {
22
+ return listItem;
23
+ }
24
+ if (vertical) {
25
+ return [
26
26
  ...productImages
27
27
  ];
28
- Array.from({
29
- length: itemPerRow - listItem.length
30
- }).forEach(()=>{
31
- temp.push(null);
32
- });
33
- return temp;
34
28
  }
35
- return listItem;
29
+ const temp = [
30
+ ...productImages
31
+ ];
32
+ const remainingItems = itemPerRow - listItem.length;
33
+ temp.push(...Array(remainingItems).fill(null));
34
+ return temp;
36
35
  }, [
37
36
  list,
38
37
  itemPerRow,
@@ -16,21 +16,20 @@ const useListCarousel = (props)=>{
16
16
  ]);
17
17
  const listRender = useMemo(()=>{
18
18
  const listItem = list();
19
- if (vertical) return [
20
- ...productImages
21
- ];
22
- if (listItem.length < itemPerRow) {
23
- const temp = [
19
+ if (listItem.length >= itemPerRow) {
20
+ return listItem;
21
+ }
22
+ if (vertical) {
23
+ return [
24
24
  ...productImages
25
25
  ];
26
- Array.from({
27
- length: itemPerRow - listItem.length
28
- }).forEach(()=>{
29
- temp.push(null);
30
- });
31
- return temp;
32
26
  }
33
- return listItem;
27
+ const temp = [
28
+ ...productImages
29
+ ];
30
+ const remainingItems = itemPerRow - listItem.length;
31
+ temp.push(...Array(remainingItems).fill(null));
32
+ return temp;
34
33
  }, [
35
34
  list,
36
35
  itemPerRow,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.364",
3
+ "version": "2.0.0-dev.365",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",