+
+
+
Oops, Nothing Found!
+
+ Looks like we're on a wild goose chase! {emptyText} to have them displayed here.
+
+
+ );
+}
+
+export { List };
diff --git a/frontend/src/pages/collection/assets/not-found.svg b/frontend/src/components/list/not-found.svg
similarity index 100%
rename from frontend/src/pages/collection/assets/not-found.svg
rename to frontend/src/components/list/not-found.svg
diff --git a/frontend/src/features/create-simple-collection/components/parameters-form/parameters-form.tsx b/frontend/src/features/create-simple-collection/components/parameters-form/parameters-form.tsx
index 42289d2..c260627 100644
--- a/frontend/src/features/create-simple-collection/components/parameters-form/parameters-form.tsx
+++ b/frontend/src/features/create-simple-collection/components/parameters-form/parameters-form.tsx
@@ -6,10 +6,10 @@ import { z } from 'zod';
import VaraSVG from '@/assets/vara.svg?react';
import { Container } from '@/components';
+import { useChangeEffect } from '@/hooks';
import CrossSVG from '../../assets/cross-tag.svg?react';
import PercentSVG from '../../assets/percent.svg?react';
-import { useChangeEffect } from '../../hooks';
import { ParametersValues } from '../../types';
import styles from './parameters-form.module.scss';
diff --git a/frontend/src/features/create-simple-collection/hooks.ts b/frontend/src/features/create-simple-collection/hooks.ts
index ff289c9..1771c73 100644
--- a/frontend/src/features/create-simple-collection/hooks.ts
+++ b/frontend/src/features/create-simple-collection/hooks.ts
@@ -1,5 +1,5 @@
import { useAlert } from '@gear-js/react-hooks';
-import { useRef, useEffect, useState, ChangeEvent, DependencyList, EffectCallback } from 'react';
+import { useRef, useState, ChangeEvent } from 'react';
import { MAX_IMAGE_SIZE_MB } from './consts';
import { getBytesSize } from './utils';
@@ -52,22 +52,4 @@ function useImageInput(defaultValue: File | undefined, types: string[]) {
return { value, props, handleClick, handleReset };
}
-function useChangeEffect(callback: EffectCallback, dependencies?: DependencyList) {
- const mounted = useRef(false);
-
- useEffect(
- () => () => {
- mounted.current = false;
- },
- [],
- );
-
- useEffect(() => {
- if (mounted.current) return callback();
-
- mounted.current = true;
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, dependencies);
-}
-
-export { useImageInput, useChangeEffect };
+export { useImageInput };
diff --git a/frontend/src/features/lists/index.ts b/frontend/src/features/lists/index.ts
index 32cb980..0c78f82 100644
--- a/frontend/src/features/lists/index.ts
+++ b/frontend/src/features/lists/index.ts
@@ -1,4 +1,5 @@
import { GridSize } from './components';
+import { GRID_SIZE } from './consts';
import { useGridSize } from './hooks';
-export { GridSize, useGridSize };
+export { GridSize, GRID_SIZE, useGridSize };
diff --git a/frontend/src/hooks/index.ts b/frontend/src/hooks/index.ts
index a09a1bc..c262f3a 100644
--- a/frontend/src/hooks/index.ts
+++ b/frontend/src/hooks/index.ts
@@ -1,6 +1,15 @@
import { useMarketplaceMessage, useCollectionMessage, useApprovedMessage } from './api';
+import { useChangeEffect } from './use-change-effect';
import { useIsOwner } from './use-is-owner';
import { useLoading } from './use-loading';
import { useModal } from './use-modal';
-export { useMarketplaceMessage, useCollectionMessage, useApprovedMessage, useModal, useIsOwner, useLoading };
+export {
+ useMarketplaceMessage,
+ useCollectionMessage,
+ useApprovedMessage,
+ useModal,
+ useIsOwner,
+ useLoading,
+ useChangeEffect,
+};
diff --git a/frontend/src/hooks/use-change-effect.ts b/frontend/src/hooks/use-change-effect.ts
new file mode 100644
index 0000000..6349ec9
--- /dev/null
+++ b/frontend/src/hooks/use-change-effect.ts
@@ -0,0 +1,21 @@
+import { EffectCallback, DependencyList, useRef, useEffect } from 'react';
+
+function useChangeEffect(callback: EffectCallback, dependencies?: DependencyList) {
+ const mounted = useRef(false);
+
+ useEffect(
+ () => () => {
+ mounted.current = false;
+ },
+ [],
+ );
+
+ useEffect(() => {
+ if (mounted.current) return callback();
+
+ mounted.current = true;
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, dependencies);
+}
+
+export { useChangeEffect };
diff --git a/frontend/src/pages/collection/collection.tsx b/frontend/src/pages/collection/collection.tsx
index d5573c1..84f5540 100644
--- a/frontend/src/pages/collection/collection.tsx
+++ b/frontend/src/pages/collection/collection.tsx
@@ -2,15 +2,14 @@ import { useState } from 'react';
import { useForm } from 'react-hook-form';
import { generatePath, useParams } from 'react-router-dom';
-import { Breadcrumbs, Container, FilterButton, InfoCard, SearchInput } from '@/components';
+import { Breadcrumbs, Container, FilterButton, InfoCard, List, SearchInput } from '@/components';
import { ROUTE } from '@/consts';
import { MintLimitInfoCard, MintNFT, NFTCard, Skeleton } from '@/features/collections';
import CollectionHeaderSkeletonSVG from '@/features/collections/assets/collection-header-skeleton.svg?react';
import NFTCardSkeletonSVG from '@/features/collections/assets/nft-card-skeleton.svg?react';
-import { GridSize, useGridSize } from '@/features/lists';
-import { cx, getIpfsLink } from '@/utils';
+import { GRID_SIZE, GridSize, useGridSize } from '@/features/lists';
+import { getIpfsLink } from '@/utils';
-import NotFoundSVG from './assets/not-found.svg?react';
import UserSVG from './assets/user.svg?react';
import styles from './collection.module.scss';
import { SOCIAL_ICON } from './consts';
@@ -29,7 +28,7 @@ type Params = {
id: string;
};
-const NFT_SKELETONS = new Array(4).fill(null);
+const NFT_SKELETONS = new Array