@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.
- package/build/api/server-assets/queries/useFetchAssets/index.js +3 -6
- package/build/api/server-assets/queries/useFetchDynamicAssetLikes/index.js +3 -6
- package/build/api/server-assets/queries/useFetchDynamicAssetsLikes/index.js +3 -6
- package/build/api/server-experiences/queries/useFetchMyActivityStreak/index.js +2 -5
- package/build/api/server-experiences/queries/useFetchMyExperienceWithLevel/index.js +2 -5
- package/build/api/server-experiences/queries/useFetchMyTasks/index.js +2 -5
- package/build/api/server-galleries/mutations/useDeleteGallery/index.js +3 -5
- package/build/api/server-galleries/mutations/useRemoveAssetFromGallery/index.js +3 -5
- package/build/api/server-identities/mutations/useAddWalletElrond/index.js +3 -6
- package/build/api/server-identities/mutations/useAddWalletFlow/index.js +3 -6
- package/build/api/server-identities/mutations/useAddWalletMetamask/index.js +3 -6
- package/build/api/server-identities/mutations/useAddWalletSolana/index.js +3 -6
- package/build/api/server-identities/mutations/useAddWalletTezos/index.js +3 -6
- package/build/api/server-identities/mutations/useAddWalletTon/index.js +3 -6
- package/build/api/server-identities/mutations/useFollowProfile/index.js +2 -4
- package/build/api/server-identities/mutations/useInviteCode/index.js +2 -5
- package/build/api/server-identities/mutations/useRemoveWallet/index.js +2 -6
- package/build/api/server-identities/mutations/useSaveEmailOfJoiner/index.js +2 -5
- package/build/api/server-identities/mutations/useUnfollowProfile/index.js +2 -4
- package/build/api/server-identities/queries/useFetchProfile/index.js +2 -5
- package/build/api/server-opportunities/mutations/useCopyOpportunityShareLink/index.js +2 -5
- package/build/api/server-opportunities/mutations/useDislikeOpportunity.js +2 -5
- package/build/api/server-opportunities/mutations/useLikeOpportunity.js +2 -5
- package/build/api/server-opportunities/mutations/useOpenOpportunity/index.js +2 -5
- package/build/api/server-opportunities/queries/useGetOpportunities.d.ts +1 -1
- package/build/api/server-opportunities/queries/useGetOpportunities.js +3 -6
- package/build/api/server-preferences/mutations/useSaveUserExpectations/index.js +2 -5
- package/build/api/server-preferences/mutations/useSaveUserInterests/index.js +2 -5
- package/build/api/server-search/queries/useFetchCollections/index.js +3 -6
- package/build/api/server-search/queries/useFetchDynamicCollectionData/index.js +3 -6
- package/build/api/server-search/queries/useFindCreations/index.js +3 -6
- package/build/hoc/HOCSignUpInterceptor/HOCSignUpInterceptor.d.ts +1 -1
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +5 -11
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +7 -16
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +7 -16
- package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.js +5 -11
- package/build/hooks/likes/dynamic/useFindCreationsAndLikes.js +5 -11
- package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.js +3 -6
- package/build/hooks/likes/dynamic/useGetCreationsAndLikes.js +5 -11
- package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.js +7 -16
- package/build/hooks/likes/dynamic/useGetTableLikes.js +5 -11
- package/build/hooks/likes/useGetLikesAsset.js +5 -11
- package/build/layouts/AppLayout.d.ts +1 -1
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +7 -16
- package/build/modules/gallery/api/useGetFavoriteGallery.js +3 -6
- package/build/modules/gallery/ui/chooseGalleryItems/index.js +2 -5
- package/build/modules/gallery/ui/createGalleryForm/index.js +2 -5
- package/build/modules/gallery/ui/editGalleryForm/index.js +2 -5
- package/build/modules/notifications/CreatorNotifications.js +2 -1
- package/build/modules/user/auth/HOCAuthSearchParamsLocalhostInterceptor.d.ts +1 -1
- package/build/modules/user/profileData/profileDataInitialization.js +2 -5
- package/build/store/ui/index.js +6 -0
- package/build/store/ui/types.d.ts +1 -0
- package/build/utils/getErrorAlertProps/index.d.ts +1 -1
- package/build/utils/getErrorAlertProps/index.js +8 -1
- package/package.json +1 -1
|
@@ -4,8 +4,8 @@ exports.useFetchAssetsByIds = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const client_1 = require("@apollo/client");
|
|
6
6
|
const api_1 = require("@ludo.ninja/api");
|
|
7
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
8
7
|
const ui_1 = require("../../../../store/ui");
|
|
8
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
9
9
|
const useFetchAssetsByIds = ({ assetIds }) => {
|
|
10
10
|
const [assets, setAsset] = (0, react_1.useState)(null);
|
|
11
11
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
@@ -18,11 +18,8 @@ const useFetchAssetsByIds = ({ assetIds }) => {
|
|
|
18
18
|
onCompleted: ({ fetchAssets: data }) => {
|
|
19
19
|
setAsset(data);
|
|
20
20
|
},
|
|
21
|
-
onError: () => {
|
|
22
|
-
openAlert(
|
|
23
|
-
type: type_1.alertVariants.error,
|
|
24
|
-
caption: 'Oops, something went wrong.',
|
|
25
|
-
});
|
|
21
|
+
onError: (err) => {
|
|
22
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
26
23
|
setAsset(null);
|
|
27
24
|
},
|
|
28
25
|
});
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const react_1 = require("react");
|
|
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 ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
8
8
|
const useFetchDynamicAssetLikes = ({ assetId, }) => {
|
|
9
9
|
const [isLikedByUser, setLikedByUser] = (0, react_1.useState)(false);
|
|
10
10
|
const [likesByUser, setLikesByUser] = (0, react_1.useState)(0);
|
|
@@ -21,11 +21,8 @@ const useFetchDynamicAssetLikes = ({ assetId, }) => {
|
|
|
21
21
|
setLikesByUser(data.likesNum);
|
|
22
22
|
setLoading(false);
|
|
23
23
|
},
|
|
24
|
-
onError: () => {
|
|
25
|
-
openAlert(
|
|
26
|
-
type: type_1.alertVariants.error,
|
|
27
|
-
caption: 'Oops, something went wrong.',
|
|
28
|
-
});
|
|
24
|
+
onError: (err) => {
|
|
25
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
29
26
|
setLikedByUser(false);
|
|
30
27
|
setLoading(false);
|
|
31
28
|
},
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const react_1 = require("react");
|
|
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 ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
8
8
|
const useFetchDynamicAssetsLikes = ({ assetIds, }) => {
|
|
9
9
|
const [infoAssetsLikes, setInfoAssetsLikes] = (0, react_1.useState)(null);
|
|
10
10
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
@@ -17,11 +17,8 @@ const useFetchDynamicAssetsLikes = ({ assetIds, }) => {
|
|
|
17
17
|
onCompleted: ({ fetchDynamicAssetsData: data }) => {
|
|
18
18
|
setInfoAssetsLikes(data);
|
|
19
19
|
},
|
|
20
|
-
onError: () => {
|
|
21
|
-
openAlert(
|
|
22
|
-
type: type_1.alertVariants.error,
|
|
23
|
-
caption: 'Oops, something went wrong.',
|
|
24
|
-
});
|
|
20
|
+
onError: (err) => {
|
|
21
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
25
22
|
setInfoAssetsLikes(null);
|
|
26
23
|
},
|
|
27
24
|
});
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const react_1 = require("react");
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
6
5
|
const store_1 = require("../../../../modules/user/store");
|
|
7
6
|
const ui_1 = require("../../../../store/ui");
|
|
8
7
|
const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/experiencesHost/schema");
|
|
8
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
9
9
|
const useFetchMyActivityStreak = () => {
|
|
10
10
|
const { isSignedIn, setUserStreak, resetUserStreak, setErrorStreak, setIsLoadingStreak, } = (0, store_1.useUserStore)((state) => ({
|
|
11
11
|
isSignedIn: state.isSignedIn,
|
|
@@ -35,10 +35,7 @@ const useFetchMyActivityStreak = () => {
|
|
|
35
35
|
},
|
|
36
36
|
onError: (err) => {
|
|
37
37
|
if (err.cause?.extensions?.classification !== 'NOT_FOUND') {
|
|
38
|
-
openAlert(
|
|
39
|
-
type: type_1.alertVariants.error,
|
|
40
|
-
caption: err.message,
|
|
41
|
-
});
|
|
38
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
42
39
|
}
|
|
43
40
|
resetUserStreak();
|
|
44
41
|
setErrorStreak(err);
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const react_1 = require("react");
|
|
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("../../../../modules/user/store");
|
|
8
7
|
const ui_1 = require("../../../../store/ui");
|
|
8
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
9
9
|
const useFetchMyExperienceWithLevel = () => {
|
|
10
10
|
const { isSignedIn, setUserExp, resetUserExp, setErrorExp, setIsLoadingExp, } = (0, store_1.useUserStore)((state) => ({
|
|
11
11
|
user: state.user,
|
|
@@ -32,10 +32,7 @@ const useFetchMyExperienceWithLevel = () => {
|
|
|
32
32
|
});
|
|
33
33
|
},
|
|
34
34
|
onError: (err) => {
|
|
35
|
-
openAlert(
|
|
36
|
-
type: type_1.alertVariants.error,
|
|
37
|
-
caption: err.message,
|
|
38
|
-
});
|
|
35
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
39
36
|
resetUserExp();
|
|
40
37
|
setErrorExp(err);
|
|
41
38
|
setIsLoadingExp(false);
|
|
@@ -4,8 +4,8 @@ exports.useFetchMyTasks = exports.prefetchMyTasks = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const client_1 = require("@apollo/client");
|
|
6
6
|
const api_1 = require("@ludo.ninja/api");
|
|
7
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
8
7
|
const ui_1 = require("../../../../store/ui");
|
|
8
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
9
9
|
const prefetchMyTasks = (apolloClient) => {
|
|
10
10
|
return apolloClient
|
|
11
11
|
.query({
|
|
@@ -31,10 +31,7 @@ const useFetchMyTasks = ({ prefetchedMyTasks, }) => {
|
|
|
31
31
|
setMyTasks(fetchMyTasks);
|
|
32
32
|
},
|
|
33
33
|
onError: (err) => {
|
|
34
|
-
openAlert(
|
|
35
|
-
type: type_1.alertVariants.error,
|
|
36
|
-
caption: err.message,
|
|
37
|
-
});
|
|
34
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
38
35
|
setMyTasks([]);
|
|
39
36
|
},
|
|
40
37
|
});
|
|
@@ -4,6 +4,7 @@ const client_1 = require("@apollo/client");
|
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
5
|
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
6
6
|
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
7
8
|
const useDeleteGallery = () => {
|
|
8
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
10
|
const [mutate, { error }] = (0, client_1.useMutation)(api_1.galleriesSchema.DeleteGalleryDocument, {
|
|
@@ -19,11 +20,8 @@ const useDeleteGallery = () => {
|
|
|
19
20
|
text: '',
|
|
20
21
|
});
|
|
21
22
|
},
|
|
22
|
-
onError: () => {
|
|
23
|
-
openAlert(
|
|
24
|
-
type: type_1.alertVariants.error,
|
|
25
|
-
caption: 'Oops, gallery deletion failed.',
|
|
26
|
-
});
|
|
23
|
+
onError: (err) => {
|
|
24
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
27
25
|
},
|
|
28
26
|
});
|
|
29
27
|
return { deleteGallery, errorDelete: error };
|
|
@@ -6,6 +6,7 @@ const client_1 = require("@apollo/client");
|
|
|
6
6
|
const api_1 = require("@ludo.ninja/api");
|
|
7
7
|
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
8
8
|
const ui_1 = require("../../../../store/ui");
|
|
9
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
9
10
|
const useRemoveAssetFromGalleryV2 = () => {
|
|
10
11
|
const [isRemoved, setRemove] = (0, react_1.useState)(false);
|
|
11
12
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
@@ -23,11 +24,8 @@ const useRemoveAssetFromGalleryV2 = () => {
|
|
|
23
24
|
});
|
|
24
25
|
},
|
|
25
26
|
refetchQueries: [api_1.galleriesSchema.FetchUserGalleriesV2Document],
|
|
26
|
-
onError: () => {
|
|
27
|
-
openAlert(
|
|
28
|
-
type: type_1.alertVariants.error,
|
|
29
|
-
caption: 'Oops, something went wrong.',
|
|
30
|
-
});
|
|
27
|
+
onError: (err) => {
|
|
28
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
31
29
|
},
|
|
32
30
|
});
|
|
33
31
|
return {
|
|
@@ -4,6 +4,7 @@ const client_1 = require("@apollo/client");
|
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
5
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
6
6
|
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
7
8
|
const useAddWalletElrond = () => {
|
|
8
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
10
|
const [mutate, { error }] = (0, client_1.useMutation)(api_1.identitySchema.AddWalletElrondDocument, {
|
|
@@ -17,12 +18,8 @@ const useAddWalletElrond = () => {
|
|
|
17
18
|
text: '',
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
|
-
onError: (
|
|
21
|
-
openAlert(
|
|
22
|
-
...data_1.alertError,
|
|
23
|
-
caption: graphQLErrors.length ? graphQLErrors[0].message : message,
|
|
24
|
-
text: '',
|
|
25
|
-
});
|
|
21
|
+
onError: (err) => {
|
|
22
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
26
23
|
},
|
|
27
24
|
});
|
|
28
25
|
return { addWalletElrond, error };
|
|
@@ -4,6 +4,7 @@ const client_1 = require("@apollo/client");
|
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
5
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
6
6
|
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
7
8
|
const useAddWalletFlow = () => {
|
|
8
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
10
|
const [mutate] = (0, client_1.useMutation)(api_1.identitySchema.AddWalletFlowDocument, {
|
|
@@ -17,12 +18,8 @@ const useAddWalletFlow = () => {
|
|
|
17
18
|
text: '',
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
|
-
onError: (
|
|
21
|
-
openAlert(
|
|
22
|
-
...data_1.alertError,
|
|
23
|
-
caption: graphQLErrors.length ? graphQLErrors[0].message : message,
|
|
24
|
-
text: '',
|
|
25
|
-
});
|
|
21
|
+
onError: (err) => {
|
|
22
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
26
23
|
},
|
|
27
24
|
});
|
|
28
25
|
return { addWalletFlow };
|
|
@@ -4,6 +4,7 @@ const client_1 = require("@apollo/client");
|
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
5
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
6
6
|
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
7
8
|
const useAddWalletMetamask = () => {
|
|
8
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
10
|
const [mutate, { error }] = (0, client_1.useMutation)(api_1.identitySchema.AddWalletMetamaskDocument, {
|
|
@@ -17,12 +18,8 @@ const useAddWalletMetamask = () => {
|
|
|
17
18
|
text: '',
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
|
-
onError: (
|
|
21
|
-
openAlert(
|
|
22
|
-
...data_1.alertError,
|
|
23
|
-
caption: graphQLErrors.length ? graphQLErrors[0].message : message,
|
|
24
|
-
text: '',
|
|
25
|
-
});
|
|
21
|
+
onError: (err) => {
|
|
22
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
26
23
|
},
|
|
27
24
|
});
|
|
28
25
|
return { addWalletMetamask, error };
|
|
@@ -4,6 +4,7 @@ const client_1 = require("@apollo/client");
|
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
5
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
6
6
|
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
7
8
|
const useAddWalletSolana = () => {
|
|
8
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
10
|
const [mutate] = (0, client_1.useMutation)(api_1.identitySchema.AddWalletSolanaDocument, {
|
|
@@ -17,12 +18,8 @@ const useAddWalletSolana = () => {
|
|
|
17
18
|
text: '',
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
|
-
onError: (
|
|
21
|
-
openAlert(
|
|
22
|
-
...data_1.alertError,
|
|
23
|
-
caption: graphQLErrors.length ? graphQLErrors[0].message : message,
|
|
24
|
-
text: '',
|
|
25
|
-
});
|
|
21
|
+
onError: (err) => {
|
|
22
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
26
23
|
},
|
|
27
24
|
});
|
|
28
25
|
return { addWalletSolana };
|
|
@@ -4,6 +4,7 @@ const client_1 = require("@apollo/client");
|
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
5
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
6
6
|
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
7
8
|
const useAddWalletTezos = () => {
|
|
8
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
10
|
const [mutate] = (0, client_1.useMutation)(api_1.identitySchema.AddWalletTezosDocument, {
|
|
@@ -17,12 +18,8 @@ const useAddWalletTezos = () => {
|
|
|
17
18
|
text: '',
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
|
-
onError: (
|
|
21
|
-
openAlert(
|
|
22
|
-
...data_1.alertError,
|
|
23
|
-
caption: graphQLErrors.length ? graphQLErrors[0].message : message,
|
|
24
|
-
text: '',
|
|
25
|
-
});
|
|
21
|
+
onError: (err) => {
|
|
22
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
26
23
|
},
|
|
27
24
|
});
|
|
28
25
|
return { addWalletTezos };
|
|
@@ -4,6 +4,7 @@ const client_1 = require("@apollo/client");
|
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
5
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
6
6
|
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
7
8
|
const useAddWalletTon = () => {
|
|
8
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
10
|
const [mutate, { error }] = (0, client_1.useMutation)(api_1.identitySchema.AddWalletTonDocument, {
|
|
@@ -17,12 +18,8 @@ const useAddWalletTon = () => {
|
|
|
17
18
|
text: '',
|
|
18
19
|
});
|
|
19
20
|
},
|
|
20
|
-
onError: (
|
|
21
|
-
openAlert(
|
|
22
|
-
...data_1.alertError,
|
|
23
|
-
caption: graphQLErrors.length ? graphQLErrors[0].message : message,
|
|
24
|
-
text: '',
|
|
25
|
-
});
|
|
21
|
+
onError: (err) => {
|
|
22
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
26
23
|
},
|
|
27
24
|
});
|
|
28
25
|
return { addWalletTon, error };
|
|
@@ -5,6 +5,7 @@ const client_1 = require("@apollo/client");
|
|
|
5
5
|
const api_1 = require("@ludo.ninja/api");
|
|
6
6
|
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
7
7
|
const ui_1 = require("../../../../store/ui");
|
|
8
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
8
9
|
const FOLLOW_PROFILE_MUTATION = (0, client_1.gql) `
|
|
9
10
|
mutation FollowProfile($followingUserId: ID!) {
|
|
10
11
|
followProfile(followingUserId: $followingUserId)
|
|
@@ -29,10 +30,7 @@ const useFollowProfile = (followingUserId) => {
|
|
|
29
30
|
},
|
|
30
31
|
onError: (err) => {
|
|
31
32
|
setIsFollowed(false);
|
|
32
|
-
openAlert(
|
|
33
|
-
type: type_1.alertVariants.error,
|
|
34
|
-
caption: err.message,
|
|
35
|
-
});
|
|
33
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
36
34
|
},
|
|
37
35
|
});
|
|
38
36
|
return { followProfile, isFollowedProfile };
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const api_1 = require("@ludo.ninja/api");
|
|
4
4
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
5
5
|
const ui_1 = require("../../../../store/ui");
|
|
6
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
7
|
const useInviteCode = () => {
|
|
7
8
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
9
|
const [mutate, { error, loading }] = api_1.identitySchema.useUseInviteCodeMutation({
|
|
@@ -17,11 +18,7 @@ const useInviteCode = () => {
|
|
|
17
18
|
});
|
|
18
19
|
},
|
|
19
20
|
onError: (err) => {
|
|
20
|
-
openAlert(
|
|
21
|
-
...data_1.alertError,
|
|
22
|
-
caption: err.message,
|
|
23
|
-
text: '',
|
|
24
|
-
});
|
|
21
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
25
22
|
},
|
|
26
23
|
});
|
|
27
24
|
return { activateInviteCode, error, loading };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const api_1 = require("@ludo.ninja/api");
|
|
4
|
-
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
5
4
|
const ui_1 = require("../../../../store/ui");
|
|
5
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
6
|
const useRemoveWallet = ({ userId }) => {
|
|
7
7
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
8
|
const [mutate, { error }] = api_1.identitySchema.useRemoveWalletMutation({
|
|
@@ -20,11 +20,7 @@ const useRemoveWallet = ({ userId }) => {
|
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
onError: (err) => {
|
|
23
|
-
openAlert(
|
|
24
|
-
...data_1.alertError,
|
|
25
|
-
caption: err.message,
|
|
26
|
-
text: '',
|
|
27
|
-
});
|
|
23
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
28
24
|
},
|
|
29
25
|
});
|
|
30
26
|
return { removeWallet, error };
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const api_1 = require("@ludo.ninja/api");
|
|
4
4
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
5
5
|
const ui_1 = require("../../../../store/ui");
|
|
6
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
7
|
const useSaveEmailOfJoiner = () => {
|
|
7
8
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
9
|
const [mutate, { error, loading }] = api_1.identitySchema.useSaveEmailOfJoinerMutation({
|
|
@@ -17,11 +18,7 @@ const useSaveEmailOfJoiner = () => {
|
|
|
17
18
|
});
|
|
18
19
|
},
|
|
19
20
|
onError: (err) => {
|
|
20
|
-
openAlert(
|
|
21
|
-
...data_1.alertError,
|
|
22
|
-
caption: err.message,
|
|
23
|
-
text: '',
|
|
24
|
-
});
|
|
21
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
25
22
|
},
|
|
26
23
|
});
|
|
27
24
|
return { saveEmailOfJoiner, error, loading };
|
|
@@ -5,6 +5,7 @@ const client_1 = require("@apollo/client");
|
|
|
5
5
|
const api_1 = require("@ludo.ninja/api");
|
|
6
6
|
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
7
7
|
const ui_1 = require("../../../../store/ui");
|
|
8
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
8
9
|
const UNFOLLOW_PROFILE_MUTATION = (0, client_1.gql) `
|
|
9
10
|
mutation UnfollowProfile($followingUserId: ID!) {
|
|
10
11
|
unfollowProfile(followingUserId: $followingUserId)
|
|
@@ -27,10 +28,7 @@ const useUnfollowProfile = (followingUserId) => {
|
|
|
27
28
|
});
|
|
28
29
|
},
|
|
29
30
|
onError: (err) => {
|
|
30
|
-
openAlert(
|
|
31
|
-
type: type_1.alertVariants.error,
|
|
32
|
-
caption: err.message,
|
|
33
|
-
});
|
|
31
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
34
32
|
setIsUnFollowed(false);
|
|
35
33
|
},
|
|
36
34
|
});
|
|
@@ -5,9 +5,9 @@ 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 core_1 = require("@ludo.ninja/core");
|
|
8
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
9
8
|
const store_1 = require("../../../../modules/user/store");
|
|
10
9
|
const ui_1 = require("../../../../store/ui");
|
|
10
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
11
11
|
const prefetchProfile = ({ userId }, apolloClient) => {
|
|
12
12
|
return apolloClient
|
|
13
13
|
.query({
|
|
@@ -45,10 +45,7 @@ const useFetchProfile = ({ userId }, prefetchedProfile) => {
|
|
|
45
45
|
setIsLoading(false);
|
|
46
46
|
},
|
|
47
47
|
onError: (err) => {
|
|
48
|
-
openAlert(
|
|
49
|
-
type: type_1.alertVariants.error,
|
|
50
|
-
caption: err.message,
|
|
51
|
-
});
|
|
48
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
52
49
|
setProfile(null);
|
|
53
50
|
setIsLoading(false);
|
|
54
51
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const api_1 = require("@ludo.ninja/api");
|
|
4
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
5
4
|
const ui_1 = require("../../../../store/ui");
|
|
5
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
6
|
const useCopyOpportunityShareLink = () => {
|
|
7
7
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
8
|
const [mutate] = api_1.opportunitiesSchema.useCopyOpportunityShareLinkMutation({
|
|
@@ -12,10 +12,7 @@ const useCopyOpportunityShareLink = () => {
|
|
|
12
12
|
// onCompleted: () => {
|
|
13
13
|
// },
|
|
14
14
|
onError: (err) => {
|
|
15
|
-
openAlert(
|
|
16
|
-
type: type_1.alertVariants.error,
|
|
17
|
-
caption: err.message,
|
|
18
|
-
});
|
|
15
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
19
16
|
},
|
|
20
17
|
});
|
|
21
18
|
async function copyOpportunityShareLinkAction({ opportunityId, }) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useDislikeOpportunity = void 0;
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
6
5
|
const ui_1 = require("../../../store/ui");
|
|
6
|
+
const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
|
|
7
7
|
const useDislikeOpportunity = () => {
|
|
8
8
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
9
|
const [mutate] = api_1.opportunitiesSchema.useDislikeOpportunityMutation({
|
|
@@ -13,10 +13,7 @@ const useDislikeOpportunity = () => {
|
|
|
13
13
|
// onCompleted: () => {
|
|
14
14
|
// },
|
|
15
15
|
onError: (err) => {
|
|
16
|
-
openAlert(
|
|
17
|
-
type: type_1.alertVariants.error,
|
|
18
|
-
caption: err.message,
|
|
19
|
-
});
|
|
16
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
20
17
|
},
|
|
21
18
|
});
|
|
22
19
|
async function dislikeOpportunityAction({ opportunityId, }) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useLikeOpportunity = void 0;
|
|
4
4
|
const api_1 = require("@ludo.ninja/api");
|
|
5
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
6
5
|
const ui_1 = require("../../../store/ui");
|
|
6
|
+
const getErrorAlertProps_1 = require("../../../utils/getErrorAlertProps");
|
|
7
7
|
const useLikeOpportunity = () => {
|
|
8
8
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
9
|
const [mutate] = api_1.opportunitiesSchema.useLikeOpportunityMutation({
|
|
@@ -13,10 +13,7 @@ const useLikeOpportunity = () => {
|
|
|
13
13
|
// onCompleted: () => {
|
|
14
14
|
// },
|
|
15
15
|
onError: (err) => {
|
|
16
|
-
openAlert(
|
|
17
|
-
type: type_1.alertVariants.error,
|
|
18
|
-
caption: err.message,
|
|
19
|
-
});
|
|
16
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
20
17
|
},
|
|
21
18
|
});
|
|
22
19
|
async function likeOpportunityAction({ opportunityId, }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const api_1 = require("@ludo.ninja/api");
|
|
4
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
5
4
|
const ui_1 = require("../../../../store/ui");
|
|
5
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
6
|
const useOpenOpportunity = () => {
|
|
7
7
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
8
|
const [mutate] = api_1.opportunitiesSchema.useOpenOpportunityMutation({
|
|
@@ -12,10 +12,7 @@ const useOpenOpportunity = () => {
|
|
|
12
12
|
// onCompleted: () => {
|
|
13
13
|
// },
|
|
14
14
|
onError: (err) => {
|
|
15
|
-
openAlert(
|
|
16
|
-
type: type_1.alertVariants.error,
|
|
17
|
-
caption: err.message,
|
|
18
|
-
});
|
|
15
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
19
16
|
},
|
|
20
17
|
});
|
|
21
18
|
async function openOpportunityAction({ opportunityId, }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const useGetOpportunities: (availableProfileId: string) => {
|
|
2
|
-
opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "
|
|
2
|
+
opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "name" | "views" | "createdAt" | "shareLink" | "blockchain" | "description" | "collection" | "liked" | "opportunityId" | "brandId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "brandName" | "brandDescription" | "brandMedia" | "brandUrl" | "brandIndustry" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "media" | "reportLink" | "clicks" | "minWalletValue" | "maxWalletValue" | "participantsLimit" | "availablePlacesForAirdrop" | "brandLudoUrl">>[];
|
|
3
3
|
isLoadingOpportunities: boolean;
|
|
4
4
|
};
|
|
@@ -5,8 +5,8 @@ const store_1 = require("../../../modules/user/store");
|
|
|
5
5
|
const ui_1 = require("../../../store/ui");
|
|
6
6
|
const api_1 = require("@ludo.ninja/api");
|
|
7
7
|
const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema");
|
|
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 useGetOpportunities = (availableProfileId) => {
|
|
11
11
|
const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
|
|
12
12
|
const user = (0, store_1.useUserStore)((state) => state.user);
|
|
@@ -16,11 +16,8 @@ const useGetOpportunities = (availableProfileId) => {
|
|
|
16
16
|
context: {
|
|
17
17
|
uri: api_1.hosts.opportunitiesHost,
|
|
18
18
|
},
|
|
19
|
-
onError: () => {
|
|
20
|
-
openAlert(
|
|
21
|
-
type: type_1.alertVariants.error,
|
|
22
|
-
caption: "Oops, something went wrong.",
|
|
23
|
-
});
|
|
19
|
+
onError: (err) => {
|
|
20
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
24
21
|
},
|
|
25
22
|
});
|
|
26
23
|
(0, react_1.useEffect)(() => {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const api_1 = require("@ludo.ninja/api");
|
|
4
4
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
5
5
|
const ui_1 = require("../../../../store/ui");
|
|
6
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
7
|
const useSaveUserExpectations = () => {
|
|
7
8
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
9
|
const [mutate] = api_1.preferencesSchema.useSaveUserExpectationsMutation({
|
|
@@ -26,11 +27,7 @@ const useSaveUserExpectations = () => {
|
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
onError: (err) => {
|
|
29
|
-
openAlert(
|
|
30
|
-
...data_1.alertError,
|
|
31
|
-
caption: err.message,
|
|
32
|
-
text: '',
|
|
33
|
-
});
|
|
30
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
34
31
|
},
|
|
35
32
|
});
|
|
36
33
|
async function saveUserExpectations(expectations) {
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const api_1 = require("@ludo.ninja/api");
|
|
4
4
|
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
5
5
|
const ui_1 = require("../../../../store/ui");
|
|
6
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
7
|
const useSaveUserInterests = () => {
|
|
7
8
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
9
|
const [mutate] = api_1.preferencesSchema.useSaveUserInterestsMutation({
|
|
@@ -26,11 +27,7 @@ const useSaveUserInterests = () => {
|
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
onError: (err) => {
|
|
29
|
-
openAlert(
|
|
30
|
-
...data_1.alertError,
|
|
31
|
-
caption: err.message,
|
|
32
|
-
text: '',
|
|
33
|
-
});
|
|
30
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
34
31
|
},
|
|
35
32
|
});
|
|
36
33
|
async function saveUserInterests(interests) {
|