@ludo.ninja/components 2.3.26 → 2.3.28

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.
Files changed (56) hide show
  1. package/build/api/server-assets/queries/useFetchAssets/index.js +3 -6
  2. package/build/api/server-assets/queries/useFetchDynamicAssetLikes/index.js +3 -6
  3. package/build/api/server-assets/queries/useFetchDynamicAssetsLikes/index.js +3 -6
  4. package/build/api/server-experiences/queries/useFetchMyActivityStreak/index.js +2 -5
  5. package/build/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +2 -5
  6. package/build/api/server-experiences/queries/useFetchMyTasks/index.js +2 -5
  7. package/build/api/server-galleries/mutations/useDeleteGallery/index.js +3 -5
  8. package/build/api/server-galleries/mutations/useRemoveAssetFromGallery/index.js +3 -5
  9. package/build/api/server-identities/mutations/useAddWalletElrond/index.js +3 -6
  10. package/build/api/server-identities/mutations/useAddWalletFlow/index.js +3 -6
  11. package/build/api/server-identities/mutations/useAddWalletMetamask/index.js +3 -6
  12. package/build/api/server-identities/mutations/useAddWalletSolana/index.js +3 -6
  13. package/build/api/server-identities/mutations/useAddWalletTezos/index.js +3 -6
  14. package/build/api/server-identities/mutations/useAddWalletTon/index.js +3 -6
  15. package/build/api/server-identities/mutations/useFollowProfile/index.js +2 -4
  16. package/build/api/server-identities/mutations/useInviteCode/index.js +2 -5
  17. package/build/api/server-identities/mutations/useRemoveWallet/index.js +2 -6
  18. package/build/api/server-identities/mutations/useSaveEmailOfJoiner/index.js +2 -5
  19. package/build/api/server-identities/mutations/useUnfollowProfile/index.js +2 -4
  20. package/build/api/server-identities/queries/useFetchProfile/index.js +2 -5
  21. package/build/api/server-opportunities/mutations/useCopyOpportunityShareLink/index.js +2 -5
  22. package/build/api/server-opportunities/mutations/useDislikeOpportunity.js +2 -5
  23. package/build/api/server-opportunities/mutations/useLikeOpportunity.js +2 -5
  24. package/build/api/server-opportunities/mutations/useOpenOpportunity/index.js +2 -5
  25. package/build/api/server-opportunities/queries/useGetOpportunities.d.ts +1 -1
  26. package/build/api/server-opportunities/queries/useGetOpportunities.js +3 -6
  27. package/build/api/server-preferences/mutations/useSaveUserExpectations/index.js +2 -5
  28. package/build/api/server-preferences/mutations/useSaveUserInterests/index.js +2 -5
  29. package/build/api/server-search/queries/useFetchCollections/index.js +3 -6
  30. package/build/api/server-search/queries/useFetchDynamicCollectionData/index.js +3 -6
  31. package/build/api/server-search/queries/useFindCreations/index.js +3 -6
  32. package/build/hoc/HOCSignUpInterceptor/HOCSignUpInterceptor.d.ts +1 -1
  33. package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +5 -11
  34. package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +7 -16
  35. package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +7 -16
  36. package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.js +5 -11
  37. package/build/hooks/likes/dynamic/useFindCreationsAndLikes.js +5 -11
  38. package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.js +3 -6
  39. package/build/hooks/likes/dynamic/useGetCreationsAndLikes.js +5 -11
  40. package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.js +7 -16
  41. package/build/hooks/likes/dynamic/useGetTableLikes.js +5 -11
  42. package/build/hooks/likes/useGetLikesAsset.js +5 -11
  43. package/build/layouts/AppLayout.d.ts +1 -1
  44. package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +7 -16
  45. package/build/modules/gallery/api/useGetFavoriteGallery.js +3 -6
  46. package/build/modules/gallery/ui/chooseGalleryItems/index.js +2 -5
  47. package/build/modules/gallery/ui/createGalleryForm/index.js +2 -5
  48. package/build/modules/gallery/ui/editGalleryForm/index.js +2 -5
  49. package/build/modules/notifications/CreatorNotifications.js +2 -1
  50. package/build/modules/user/auth/HOCAuthSearchParamsLocalhostInterceptor.d.ts +1 -1
  51. package/build/modules/user/profileData/profileDataInitialization.js +2 -5
  52. package/build/store/ui/index.js +6 -0
  53. package/build/store/ui/types.d.ts +1 -0
  54. package/build/utils/getErrorAlertProps/index.d.ts +1 -1
  55. package/build/utils/getErrorAlertProps/index.js +8 -1
  56. package/package.json +1 -1
@@ -6,8 +6,8 @@ const types_1 = require("../../../../entities/labelCreationType/types");
6
6
  const ui_1 = require("../../../../store/ui");
7
7
  const client_1 = require("@apollo/client");
8
8
  const api_1 = require("@ludo.ninja/api");
9
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
10
9
  const react_1 = require("react");
10
+ const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
11
11
  // export const prefetchFindCollections = (
12
12
  // { term, input, pageSize, pageToken }: schema.IQueryFindCollectionsArgs,
13
13
  // apolloClient: ApolloClient<NormalizedCacheObject>
@@ -44,11 +44,8 @@ const useFindCollections = ({ term, input, page }) => {
44
44
  setResults(results);
45
45
  setNextPageToken(nextPageToken);
46
46
  },
47
- onError: () => {
48
- openAlert({
49
- type: type_1.alertVariants.error,
50
- caption: "Oops, something went wrong.",
51
- });
47
+ onError: (err) => {
48
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
52
49
  setCollections([]);
53
50
  setNextPageToken(null);
54
51
  },
@@ -5,8 +5,8 @@ const collectionCreationBuilder_1 = require("../../../../entities/creation/colle
5
5
  const ui_1 = require("../../../../store/ui");
6
6
  const client_1 = require("@apollo/client");
7
7
  const api_1 = require("@ludo.ninja/api");
8
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
9
8
  const react_1 = require("react");
9
+ const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
10
10
  const maxCollectionListLength = 1000;
11
11
  const useFetchDynamicCollectionData = ({ input }) => {
12
12
  const [collectionAssetsList, setCollectionAssetsList] = (0, react_1.useState)([]);
@@ -29,11 +29,8 @@ const useFetchDynamicCollectionData = ({ input }) => {
29
29
  collectionId: collectionAsset.assetId,
30
30
  })));
31
31
  },
32
- onError: () => {
33
- openAlert({
34
- type: type_1.alertVariants.error,
35
- caption: "Oops, something went wrong.",
36
- });
32
+ onError: (err) => {
33
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
37
34
  setCollectionAssetsList([]);
38
35
  setNextPageToken(null);
39
36
  },
@@ -5,8 +5,8 @@ const builder_1 = require("../../../../entities/creation/builder");
5
5
  const ui_1 = require("../../../../store/ui");
6
6
  const client_1 = require("@apollo/client");
7
7
  const api_1 = require("@ludo.ninja/api");
8
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
9
8
  const react_1 = require("react");
9
+ const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
10
10
  const prefetchFindCreations = ({ term, input, page }, apolloClient) => {
11
11
  return apolloClient
12
12
  .query({
@@ -46,11 +46,8 @@ const useFindCreations = ({ term, input, page }) => {
46
46
  setResults(nextPage.nextPage?.elements || 0);
47
47
  setNextPageToken(nextPage.nextPage?.token || null);
48
48
  },
49
- onError: () => {
50
- openAlert({
51
- type: type_1.alertVariants.error,
52
- caption: "Oops, something went wrong.",
53
- });
49
+ onError: (err) => {
50
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
54
51
  setCreations([]);
55
52
  setNextPageToken(null);
56
53
  },
@@ -1,2 +1,2 @@
1
1
  import { ReactNode } from "react";
2
- export declare const HOCSignUpInterceptor: (Component: ReactNode, isAuthorized?: boolean) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<import("react").AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
2
+ export declare const HOCSignUpInterceptor: (Component: ReactNode, isAuthorized?: boolean) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<import("react").AwaitedReactNode> | null | undefined;
@@ -11,8 +11,8 @@ const client_1 = require("@apollo/client");
11
11
  const api_1 = require("@ludo.ninja/api");
12
12
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/galleriesHost/schema");
13
13
  const schema_2 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
14
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
15
14
  const react_1 = require("react");
15
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
16
16
  const useGetFavoriteGallaryCreations = ({ galleryId, itemsCount, }) => {
17
17
  const [gallery, setGallery] = (0, react_1.useState)([]);
18
18
  const [assets, setAssets] = (0, react_1.useState)(null);
@@ -53,11 +53,8 @@ const useGetFavoriteGallaryCreations = ({ galleryId, itemsCount, }) => {
53
53
  })),
54
54
  ]);
55
55
  },
56
- onError: () => {
57
- openAlert({
58
- type: type_1.alertVariants.error,
59
- caption: "Oops, something went wrong.",
60
- });
56
+ onError: (err) => {
57
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
61
58
  setAssets([]);
62
59
  setFetchError(true);
63
60
  },
@@ -71,11 +68,8 @@ const useGetFavoriteGallaryCreations = ({ galleryId, itemsCount, }) => {
71
68
  ...data.map((collection) => (0, collectionCreationBuilder_1.buildCollectionCreation)(collection, types_1.LabelKeys.collection)),
72
69
  ]);
73
70
  },
74
- onError: () => {
75
- openAlert({
76
- type: type_1.alertVariants.error,
77
- caption: "Oops, something went wrong.",
78
- });
71
+ onError: (err) => {
72
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
79
73
  setCollections([]);
80
74
  setFetchError(true);
81
75
  },
@@ -10,8 +10,8 @@ const client_1 = require("@apollo/client");
10
10
  const api_1 = require("@ludo.ninja/api");
11
11
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/galleriesHost/schema");
12
12
  const schema_2 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
13
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
14
13
  const react_1 = require("react");
14
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
15
15
  const maxUserFavoritesLength = 1000;
16
16
  const useGetUserFevoritesCreations = ({ userId, pageSize, pageToken }) => {
17
17
  const [assets, setAsset] = (0, react_1.useState)(null);
@@ -33,11 +33,8 @@ const useGetUserFevoritesCreations = ({ userId, pageSize, pageToken }) => {
33
33
  setFavorites(galleries.map((gallery) => (0, builder_2.buildGallery)(gallery)));
34
34
  setLoading(false);
35
35
  },
36
- onError: () => {
37
- openAlert({
38
- type: type_1.alertVariants.error,
39
- caption: "Oops, something went wrong while fetching favorites.",
40
- });
36
+ onError: (err) => {
37
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
41
38
  setFavorites([]);
42
39
  setLoading(false);
43
40
  },
@@ -53,11 +50,8 @@ const useGetUserFevoritesCreations = ({ userId, pageSize, pageToken }) => {
53
50
  })));
54
51
  setLoading(false);
55
52
  },
56
- onError: () => {
57
- openAlert({
58
- type: type_1.alertVariants.error,
59
- caption: "Oops, something went wrong.",
60
- });
53
+ onError: (err) => {
54
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
61
55
  setAsset(null);
62
56
  setLoading(false);
63
57
  },
@@ -69,11 +63,8 @@ const useGetUserFevoritesCreations = ({ userId, pageSize, pageToken }) => {
69
63
  setCollections(data.map((collection) => (0, collectionCreationBuilder_1.buildCollectionCreation)(collection)));
70
64
  setLoading(false);
71
65
  },
72
- onError: () => {
73
- openAlert({
74
- type: type_1.alertVariants.error,
75
- caption: "Oops, something went wrong.",
76
- });
66
+ onError: (err) => {
67
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
77
68
  setCollections(null);
78
69
  setLoading(false);
79
70
  },
@@ -10,8 +10,8 @@ const client_1 = require("@apollo/client");
10
10
  const api_1 = require("@ludo.ninja/api");
11
11
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/galleriesHost/schema");
12
12
  const schema_2 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
13
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
14
13
  const react_1 = require("react");
14
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
15
15
  const maxUserFavoritesLength = 1000;
16
16
  const useGetUserGalleriesCreations = ({ userId, pageSize, pageToken }) => {
17
17
  const [assets, setAsset] = (0, react_1.useState)(null);
@@ -33,11 +33,8 @@ const useGetUserGalleriesCreations = ({ userId, pageSize, pageToken }) => {
33
33
  setGalleries(galleries.map((gallery) => (0, builder_2.buildGallery)(gallery)));
34
34
  setLoading(false);
35
35
  },
36
- onError: () => {
37
- openAlert({
38
- type: type_1.alertVariants.error,
39
- caption: "Oops, something went wrong while fetching galleries.",
40
- });
36
+ onError: (err) => {
37
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
41
38
  setGalleries([]);
42
39
  setLoading(false);
43
40
  },
@@ -53,11 +50,8 @@ const useGetUserGalleriesCreations = ({ userId, pageSize, pageToken }) => {
53
50
  })));
54
51
  setLoading(false);
55
52
  },
56
- onError: () => {
57
- openAlert({
58
- type: type_1.alertVariants.error,
59
- caption: "Oops, something went wrong.",
60
- });
53
+ onError: (err) => {
54
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
61
55
  setAsset(null);
62
56
  setLoading(false);
63
57
  },
@@ -69,11 +63,8 @@ const useGetUserGalleriesCreations = ({ userId, pageSize, pageToken }) => {
69
63
  setCollections(data.map((collection) => (0, collectionCreationBuilder_1.buildCollectionCreation)(collection)));
70
64
  setLoading(false);
71
65
  },
72
- onError: () => {
73
- openAlert({
74
- type: type_1.alertVariants.error,
75
- caption: "Oops, something went wrong.",
76
- });
66
+ onError: (err) => {
67
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
77
68
  setCollections(null);
78
69
  setLoading(false);
79
70
  },
@@ -8,8 +8,8 @@ const ui_1 = require("../../../store/ui");
8
8
  const client_1 = require("@apollo/client");
9
9
  const api_1 = require("@ludo.ninja/api");
10
10
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
11
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
12
11
  const react_1 = require("react");
12
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
13
13
  // export const prefetchFindCollections = (
14
14
  // { term, input, pageSize, pageToken }: schema.IQueryFindCollectionsArgs,
15
15
  // apolloClient: ApolloClient<NormalizedCacheObject>
@@ -56,11 +56,8 @@ const useFindCollectionsAndLikes = ({ term, input, page }) => {
56
56
  setResults(nextPage.nextPage?.elements || 0);
57
57
  setNextPageToken(nextPage.nextPage?.token || null);
58
58
  },
59
- onError: () => {
60
- openAlert({
61
- type: type_1.alertVariants.error,
62
- caption: "Oops, something went wrong.",
63
- });
59
+ onError: (err) => {
60
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
64
61
  setCollections([]);
65
62
  setNextPageToken(null);
66
63
  },
@@ -72,11 +69,8 @@ const useFindCollectionsAndLikes = ({ term, input, page }) => {
72
69
  setLoading(false);
73
70
  },
74
71
  fetchPolicy: "no-cache",
75
- onError: () => {
76
- openAlert({
77
- type: type_1.alertVariants.error,
78
- caption: "Oops, something went wrong when fetch collections likes.",
79
- });
72
+ onError: (err) => {
73
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
80
74
  setCollectionsLikes([]);
81
75
  setLoading(false);
82
76
  },
@@ -7,8 +7,8 @@ const ui_1 = require("../../../store/ui");
7
7
  const client_1 = require("@apollo/client");
8
8
  const api_1 = require("@ludo.ninja/api");
9
9
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
10
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
11
10
  const react_1 = require("react");
11
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
12
12
  const maxCreationLength = 1000;
13
13
  const useFindCreationsAndLikes = ({ term, input, page }) => {
14
14
  const [creations, setCreations] = (0, react_1.useState)([]);
@@ -35,11 +35,8 @@ const useFindCreationsAndLikes = ({ term, input, page }) => {
35
35
  setResults(nextPage.nextPage?.elements || 0);
36
36
  setNextPageToken(nextPage.nextPage?.token || null);
37
37
  },
38
- onError: () => {
39
- openAlert({
40
- type: type_1.alertVariants.error,
41
- caption: "Oops, something went wrong.",
42
- });
38
+ onError: (err) => {
39
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
43
40
  setCreations([]);
44
41
  setNextPageToken(null);
45
42
  setLoading(false);
@@ -55,11 +52,8 @@ const useFindCreationsAndLikes = ({ term, input, page }) => {
55
52
  setAssetsLikes(fetchDynamicAssetsData);
56
53
  setLoading(false);
57
54
  },
58
- onError: () => {
59
- openAlert({
60
- type: type_1.alertVariants.error,
61
- caption: "Oops, something went wrong when fetch assets likes.",
62
- });
55
+ onError: (err) => {
56
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
63
57
  setAssetsLikes([]);
64
58
  setLoading(false);
65
59
  },
@@ -7,8 +7,8 @@ const ui_1 = require("../../../store/ui");
7
7
  const client_1 = require("@apollo/client");
8
8
  const api_1 = require("@ludo.ninja/api");
9
9
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
10
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
11
10
  const react_1 = require("react");
11
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
12
12
  const maxCollectionListLength = 1000;
13
13
  const useGetCollectionInfoAndLikes = ({ input }) => {
14
14
  const { page, collectionId } = input;
@@ -35,11 +35,8 @@ const useGetCollectionInfoAndLikes = ({ input }) => {
35
35
  })));
36
36
  setLoading(false);
37
37
  },
38
- onError: () => {
39
- openAlert({
40
- type: type_1.alertVariants.error,
41
- caption: "Oops, something went wrong.",
42
- });
38
+ onError: (err) => {
39
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
43
40
  setCollectionAssetsList([]);
44
41
  setNextPageToken(null);
45
42
  setLoading(false);
@@ -8,8 +8,8 @@ const ui_1 = require("../../../store/ui");
8
8
  const client_1 = require("@apollo/client");
9
9
  const api_1 = require("@ludo.ninja/api");
10
10
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
11
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
12
11
  const react_1 = require("react");
12
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
13
13
  const maxCreationLength = 1000;
14
14
  const useGetCreationsAndLikes = ({ page }) => {
15
15
  const [allCreations, setCreations] = (0, react_1.useState)([]);
@@ -43,11 +43,8 @@ const useGetCreationsAndLikes = ({ page }) => {
43
43
  setAssetsLikes(fetchDynamicAssetsData);
44
44
  setLoading(false);
45
45
  },
46
- onError: () => {
47
- openAlert({
48
- type: type_1.alertVariants.error,
49
- caption: "Oops, something went wrong when fetch assets likes.",
50
- });
46
+ onError: (err) => {
47
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
51
48
  setAssetsLikes([]);
52
49
  setLoading(false);
53
50
  },
@@ -58,11 +55,8 @@ const useGetCreationsAndLikes = ({ page }) => {
58
55
  setCollectionsLikes(fetchDynamicCollectionsData);
59
56
  setLoading(false);
60
57
  },
61
- onError: () => {
62
- openAlert({
63
- type: type_1.alertVariants.error,
64
- caption: "Oops, something went wrong when fetch collections likes.",
65
- });
58
+ onError: (err) => {
59
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
66
60
  setCollectionsLikes([]);
67
61
  setLoading(false);
68
62
  },
@@ -7,8 +7,8 @@ const ui_1 = require("../../../store/ui");
7
7
  const client_1 = require("@apollo/client");
8
8
  const api_1 = require("@ludo.ninja/api");
9
9
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/searchHost/schema");
10
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
11
10
  const react_1 = require("react");
11
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
12
12
  const maxCreationLength = 1000;
13
13
  const useGetCreationsAndLikesByType = ({ itemType, page }) => {
14
14
  const [allCreations, setAllCreations] = (0, react_1.useState)([]);
@@ -32,11 +32,8 @@ const useGetCreationsAndLikesByType = ({ itemType, page }) => {
32
32
  setNextPageToken(data.nextPage?.token || null);
33
33
  setLoading(false);
34
34
  },
35
- onError: () => {
36
- openAlert({
37
- type: type_1.alertVariants.error,
38
- caption: "Oops, something went wrong.",
39
- });
35
+ onError: (err) => {
36
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
40
37
  setAllCreations([]);
41
38
  setNextPageToken(null);
42
39
  setLoading(false);
@@ -51,11 +48,8 @@ const useGetCreationsAndLikesByType = ({ itemType, page }) => {
51
48
  setAssetsLikes(fetchDynamicAssetsData);
52
49
  setLoading(false);
53
50
  },
54
- onError: () => {
55
- openAlert({
56
- type: type_1.alertVariants.error,
57
- caption: "Oops, something went wrong when fetch assets likes.",
58
- });
51
+ onError: (err) => {
52
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
59
53
  setAssetsLikes([]);
60
54
  setLoading(false);
61
55
  },
@@ -67,11 +61,8 @@ const useGetCreationsAndLikesByType = ({ itemType, page }) => {
67
61
  setLoading(false);
68
62
  },
69
63
  fetchPolicy: "no-cache",
70
- onError: () => {
71
- openAlert({
72
- type: type_1.alertVariants.error,
73
- caption: "Oops, something wrong with collections likes.",
74
- });
64
+ onError: (err) => {
65
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
75
66
  setCollectionsLikes([]);
76
67
  setLoading(false);
77
68
  },
@@ -5,8 +5,8 @@ const types_1 = require("../../../entities/labelCreationType/types");
5
5
  const ui_1 = require("../../../store/ui");
6
6
  const client_1 = require("@apollo/client");
7
7
  const api_1 = require("@ludo.ninja/api");
8
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
9
8
  const react_1 = require("react");
9
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
10
10
  const useGetTableLikes = ({ allItems }) => {
11
11
  const [assetsLikes, setAssetsLikes] = (0, react_1.useState)([]);
12
12
  const [collectionsLikes, setCollectionsLikes] = (0, react_1.useState)([]);
@@ -27,11 +27,8 @@ const useGetTableLikes = ({ allItems }) => {
27
27
  activeRequestsCount.current -= 1;
28
28
  checkAllRequestsCompleted();
29
29
  },
30
- onError: () => {
31
- openAlert({
32
- type: type_1.alertVariants.error,
33
- caption: "Oops, something went wrong.",
34
- });
30
+ onError: (err) => {
31
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
35
32
  setAssetsLikes([]);
36
33
  activeRequestsCount.current -= 1;
37
34
  checkAllRequestsCompleted();
@@ -47,11 +44,8 @@ const useGetTableLikes = ({ allItems }) => {
47
44
  activeRequestsCount.current -= 1;
48
45
  checkAllRequestsCompleted();
49
46
  },
50
- onError: () => {
51
- openAlert({
52
- type: type_1.alertVariants.error,
53
- caption: "Oops, something went wrong.",
54
- });
47
+ onError: (err) => {
48
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
55
49
  setCollectionsLikes([]);
56
50
  activeRequestsCount.current -= 1;
57
51
  checkAllRequestsCompleted();
@@ -5,8 +5,8 @@ const react_1 = require("react");
5
5
  const client_1 = require("@apollo/client");
6
6
  const api_1 = require("@ludo.ninja/api");
7
7
  const api_2 = require("@ludo.ninja/api");
8
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
9
8
  const ui_1 = require("../../store/ui");
9
+ const getErrorAlertProps_1 = require("../../utils/getErrorAlertProps");
10
10
  const useGetLikesAsset = () => {
11
11
  const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
12
12
  const [activeRequestsCountLikes, setActiveRequestsCountLikes] = (0, react_1.useState)(0);
@@ -22,11 +22,8 @@ const useGetLikesAsset = () => {
22
22
  setAssetsLikes(fetchDynamicAssetsData);
23
23
  setActiveRequestsCountLikes((prev) => prev - 1);
24
24
  },
25
- onError: () => {
26
- openAlert({
27
- type: type_1.alertVariants.error,
28
- caption: 'Oops, something went wrong with assets likes.',
29
- });
25
+ onError: (err) => {
26
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
30
27
  setAssetsLikes([]);
31
28
  setActiveRequestsCountLikes((prev) => prev - 1);
32
29
  },
@@ -38,11 +35,8 @@ const useGetLikesAsset = () => {
38
35
  setActiveRequestsCountLikes((prev) => prev - 1);
39
36
  },
40
37
  fetchPolicy: 'no-cache',
41
- onError: () => {
42
- openAlert({
43
- type: type_1.alertVariants.error,
44
- caption: 'Oops, something went wrong with collections likes.',
45
- });
38
+ onError: (err) => {
39
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
46
40
  setCollectionsLikes([]);
47
41
  setActiveRequestsCountLikes((prev) => prev - 1);
48
42
  },
@@ -3,4 +3,4 @@ import { ReactNode } from "react";
3
3
  export declare const AppLayout: ({ children, pageProps }: {
4
4
  children: ReactNode;
5
5
  pageProps: AppProps["pageProps"];
6
- }) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<import("react").AwaitedReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
6
+ }) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<import("react").AwaitedReactNode> | null | undefined;
@@ -10,8 +10,8 @@ const extractItemIds_1 = require("../../../utils/extractItemIds");
10
10
  const getPageSizeAssets_1 = require("../../../utils/getPageSizeAssets");
11
11
  const client_1 = require("@apollo/client");
12
12
  const api_1 = require("@ludo.ninja/api");
13
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
14
13
  const react_1 = require("react");
14
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
15
15
  const limit = 40;
16
16
  const useGetAssetsAndCollectionForFavorite = ({ gallery, activeTab, fetchLikes, }) => {
17
17
  const [assets, setAssets] = (0, react_1.useState)([]);
@@ -94,11 +94,8 @@ const useGetAssetsAndCollectionForFavorite = ({ gallery, activeTab, fetchLikes,
94
94
  return results;
95
95
  });
96
96
  },
97
- onError: () => {
98
- openAlert({
99
- type: type_1.alertVariants.error,
100
- caption: "Oops, something went wrong.",
101
- });
97
+ onError: (err) => {
98
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
102
99
  setAssets([]);
103
100
  },
104
101
  });
@@ -118,11 +115,8 @@ const useGetAssetsAndCollectionForFavorite = ({ gallery, activeTab, fetchLikes,
118
115
  return results;
119
116
  });
120
117
  },
121
- onError: () => {
122
- openAlert({
123
- type: type_1.alertVariants.error,
124
- caption: "Oops, something went wrong.",
125
- });
118
+ onError: (err) => {
119
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
126
120
  setCollections([]);
127
121
  },
128
122
  });
@@ -135,11 +129,8 @@ const useGetAssetsAndCollectionForFavorite = ({ gallery, activeTab, fetchLikes,
135
129
  ...data.map((opportunity) => [opportunity.opportunityId, opportunity]),
136
130
  ]);
137
131
  },
138
- onError: () => {
139
- openAlert({
140
- type: type_1.alertVariants.error,
141
- caption: "Oops, something went wrong.",
142
- });
132
+ onError: (err) => {
133
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
143
134
  setOpportunities([]);
144
135
  },
145
136
  });
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGetFavoriteGallery = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const api_1 = require("@ludo.ninja/api");
6
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
7
6
  const store_1 = require("../store");
8
7
  const ui_1 = require("../../../store/ui");
8
+ const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
9
9
  const useGetFavoriteGallery = ({ galleryId }) => {
10
10
  const { setGallery, setAllResults } = (0, store_1.useGalleryStore)((state) => ({
11
11
  setGallery: state.setGallery,
@@ -23,11 +23,8 @@ const useGetFavoriteGallery = ({ galleryId }) => {
23
23
  setGallery(fetchGalleryV2);
24
24
  setAllResults(fetchGalleryV2?.creationIds?.length || 0);
25
25
  },
26
- onError: () => {
27
- openAlert({
28
- type: type_1.alertVariants.error,
29
- caption: 'Oops, something went wrong.',
30
- });
26
+ onError: (err) => {
27
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
31
28
  setGallery(null);
32
29
  setAllResults(0);
33
30
  },
@@ -19,6 +19,7 @@ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
19
19
  const react_1 = require("react");
20
20
  const react_virtuoso_1 = require("react-virtuoso");
21
21
  const styled_components_1 = __importDefault(require("styled-components"));
22
+ const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
22
23
  // Styles
23
24
  const StyledChooseGalleryItems = styled_components_1.default.div `
24
25
  min-height: calc(460px - 24px);
@@ -119,11 +120,7 @@ const GalleryItems = ({ galleryItems, loadMore, isNextLoading, isAdded, titleBtn
119
120
  (0, react_1.useEffect)(() => {
120
121
  if (error) {
121
122
  setSelectedItem(null);
122
- openAlert({
123
- type: type_1.alertVariants.error,
124
- caption: error.message,
125
- text: "",
126
- });
123
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(error));
127
124
  }
128
125
  }, [error]);
129
126
  const handleIsSelected = (newGallery) => {
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_hook_form_1 = require("react-hook-form");
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
10
9
  const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
11
10
  const ui_1 = require("../../../../store/ui");
12
11
  const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
@@ -15,6 +14,7 @@ const typography_1 = require("../../../../styles/typography");
15
14
  const MainButton_1 = __importDefault(require("../../../../system/Buttons/MainButton"));
16
15
  const Forms_1 = require("../../../../system/Forms");
17
16
  const Messages_1 = __importDefault(require("../../../../system/Forms/Messages"));
17
+ const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
18
18
  // Styles
19
19
  const StyledCreateForm = styled_components_1.default.div `
20
20
  min-width: 344px;
@@ -122,10 +122,7 @@ createMethod, error, refetchFavoritesList, }) => {
122
122
  });
123
123
  refetchFavoritesList && (await refetchFavoritesList());
124
124
  if (error) {
125
- openAlert({
126
- type: type_1.alertVariants.error,
127
- caption: error?.message,
128
- });
125
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(error));
129
126
  return;
130
127
  }
131
128
  setAddGallery(false);
@@ -7,7 +7,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const react_hook_form_1 = require("react-hook-form");
9
9
  const styled_components_1 = __importDefault(require("styled-components"));
10
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
11
10
  const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
12
11
  const store_1 = require("../../store");
13
12
  const ui_1 = require("../../../../store/ui");
@@ -18,6 +17,7 @@ const typography_1 = require("../../../../styles/typography");
18
17
  const MainButton_1 = __importDefault(require("../../../../system/Buttons/MainButton"));
19
18
  const Forms_1 = require("../../../../system/Forms");
20
19
  const Messages_1 = __importDefault(require("../../../../system/Forms/Messages"));
20
+ const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
21
21
  // Styles
22
22
  const StyledCreateForm = styled_components_1.default.div `
23
23
  min-width: 344px;
@@ -178,10 +178,7 @@ const EditGalleryForm = ({ title, inputPlaceHolderText, galleryId, name, descrip
178
178
  closeModalSidebar();
179
179
  }
180
180
  catch (error) {
181
- openAlert({
182
- type: type_1.alertVariants.error,
183
- caption: error?.message,
184
- });
181
+ openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(error));
185
182
  }
186
183
  };
187
184
  return ((0, jsx_runtime_1.jsxs)(StyledCreateForm, { children: [(0, jsx_runtime_1.jsx)("div", { className: 'head', children: (0, jsx_runtime_1.jsx)("h3", { className: 'tittle', children: title }) }), (0, jsx_runtime_1.jsxs)("form", { onSubmit: handleSubmit(onSubmit), children: [(0, jsx_runtime_1.jsxs)("div", { className: 'content', children: [(0, jsx_runtime_1.jsx)("div", { className: "input_group", children: (0, jsx_runtime_1.jsx)(Forms_1.Input, { register: registergalleryName, error: errorGalleryName, data: dataForgalleryName }) }), (0, jsx_runtime_1.jsx)("div", { className: "input_group", children: (0, jsx_runtime_1.jsx)(Forms_1.BasicTextArea, { register: registergalleryDescription,