@ludo.ninja/components 2.1.54 → 2.1.60
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-opportunities/queries/useGetOpportunities.d.ts +1 -1
- package/build/api/server-preferences/queries/useSearchResultCategorySelections/index.d.ts +1 -1
- package/build/api/server-preferences/queries/useSearchResultStatusSelections/index.d.ts +1 -1
- package/build/api/server-preferences/queries/useSearchResultTypeSelections/index.d.ts +1 -1
- package/build/modules/user/auth/useVerification.js +2 -7
- package/package.json +1 -1
- package/build/api/server-assets/queries/useFetchAssetByBlockchain/index.d.ts +0 -14
- package/build/api/server-assets/queries/useFetchAssetByBlockchain/index.js +0 -48
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const useGetOpportunities: () => {
|
|
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, "views" | "createdAt" | "blockchain" | "name" | "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" | "shareLink">>[];
|
|
3
3
|
isLoadingOpportunities: boolean;
|
|
4
4
|
};
|
|
@@ -8,6 +8,6 @@ export declare const prefetchSearchResultCategorySelections: (apolloClient: Apol
|
|
|
8
8
|
declare const useSearchResultCategorySelections: () => {
|
|
9
9
|
categorySelectionsLoading: boolean;
|
|
10
10
|
error: import("@apollo/client").ApolloError | undefined;
|
|
11
|
-
searchResultCategorySelections: schema.Maybe<Pick<schema.ISelection, "
|
|
11
|
+
searchResultCategorySelections: schema.Maybe<Pick<schema.ISelection, "name" | "label">>[] | null;
|
|
12
12
|
};
|
|
13
13
|
export default useSearchResultCategorySelections;
|
|
@@ -9,6 +9,6 @@ declare const useSearchResultStatusSelections: () => {
|
|
|
9
9
|
searchResultStatusSelectionsLoading: boolean;
|
|
10
10
|
loading: boolean;
|
|
11
11
|
error: import("@apollo/client").ApolloError | undefined;
|
|
12
|
-
searchResultStatusSelections: schema.Maybe<Pick<schema.ISelection, "
|
|
12
|
+
searchResultStatusSelections: schema.Maybe<Pick<schema.ISelection, "name" | "label">>[] | null;
|
|
13
13
|
};
|
|
14
14
|
export default useSearchResultStatusSelections;
|
|
@@ -9,5 +9,5 @@ export declare const useSearchResultTypeSelections: () => {
|
|
|
9
9
|
resultTypeSelectionsLoading: boolean;
|
|
10
10
|
error: import("@apollo/client").ApolloError | undefined;
|
|
11
11
|
data: any;
|
|
12
|
-
searchResultTypeSelections: schema.Maybe<Pick<schema.ISelection, "
|
|
12
|
+
searchResultTypeSelections: schema.Maybe<Pick<schema.ISelection, "name" | "label">>[] | null;
|
|
13
13
|
};
|
|
@@ -38,7 +38,7 @@ const useVerification = () => {
|
|
|
38
38
|
authCookiesParsed.refreshToken &&
|
|
39
39
|
authCookiesParsed.newUser &&
|
|
40
40
|
authCookiesParsed.userId &&
|
|
41
|
-
authCookiesParsed.inviteCode &&
|
|
41
|
+
// authCookiesParsed.inviteCode &&
|
|
42
42
|
authCookiesParsed.role) {
|
|
43
43
|
signIn({
|
|
44
44
|
userId: authCookiesParsed.userId,
|
|
@@ -46,15 +46,10 @@ const useVerification = () => {
|
|
|
46
46
|
authToken: authCookiesParsed.authToken,
|
|
47
47
|
refreshToken: authCookiesParsed.refreshToken,
|
|
48
48
|
newUser: authCookiesParsed.newUser === "true",
|
|
49
|
-
inviteCode: authCookiesParsed.inviteCode,
|
|
49
|
+
inviteCode: authCookiesParsed.inviteCode || null,
|
|
50
50
|
role: authCookiesParsed.role,
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
else {
|
|
54
|
-
if (currentLocation !== "/forms/[formId]" && currentLocation !== "/minting") {
|
|
55
|
-
await signOut();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
53
|
}
|
|
59
54
|
catch (e) {
|
|
60
55
|
// console.error('verification', e);
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
-
import { searchSchema as schema } from '@ludo.ninja/api';
|
|
3
|
-
import AssetEntity from '../../../../dto/AssetEntity';
|
|
4
|
-
declare const prefetchAssetByBlockchain: ({ blockchain, address, elrondId, tokenId, }: schema.IQueryFetchAssetByBlockchainArgs, apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
5
|
-
data: {
|
|
6
|
-
fetchAssetByBlockchain: null;
|
|
7
|
-
};
|
|
8
|
-
}>;
|
|
9
|
-
declare const useFetchAssetByBlockchain: ({ blockchain, address, elrondId, tokenId, }: schema.IQueryFetchAssetByBlockchainArgs, prefetchedAsset: AssetEntity | null) => {
|
|
10
|
-
clientData: AssetEntity | null;
|
|
11
|
-
loading: boolean;
|
|
12
|
-
error: import("@apollo/client").ApolloError | undefined;
|
|
13
|
-
};
|
|
14
|
-
export { prefetchAssetByBlockchain, useFetchAssetByBlockchain };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useFetchAssetByBlockchain = exports.prefetchAssetByBlockchain = void 0;
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const api_1 = require("@ludo.ninja/api");
|
|
9
|
-
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
10
|
-
const ui_1 = require("../../../../store/ui");
|
|
11
|
-
const AssetEntity_1 = __importDefault(require("../../../../dto/AssetEntity"));
|
|
12
|
-
const prefetchAssetByBlockchain = async ({ blockchain, address, elrondId, tokenId, }, apolloClient) => {
|
|
13
|
-
return apolloClient
|
|
14
|
-
.query({
|
|
15
|
-
query: api_1.searchSchema.FetchAssetByBlockchainDocument,
|
|
16
|
-
variables: { blockchain, address, elrondId, tokenId },
|
|
17
|
-
context: { uri: api_1.hosts.serverSearchHost }, // faster service assets for production,
|
|
18
|
-
fetchPolicy: 'network-only',
|
|
19
|
-
})
|
|
20
|
-
.catch(() => {
|
|
21
|
-
return {
|
|
22
|
-
data: { fetchAssetByBlockchain: null },
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
exports.prefetchAssetByBlockchain = prefetchAssetByBlockchain;
|
|
27
|
-
const useFetchAssetByBlockchain = ({ blockchain, address, elrondId, tokenId, }, prefetchedAsset) => {
|
|
28
|
-
const [asset, setAsset] = (0, react_1.useState)(prefetchedAsset);
|
|
29
|
-
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
30
|
-
const { loading, error } = api_1.searchSchema.useFetchAssetByBlockchainQuery({
|
|
31
|
-
variables: { blockchain, address, elrondId, tokenId },
|
|
32
|
-
context: {
|
|
33
|
-
uri: api_1.hosts.searchHost,
|
|
34
|
-
},
|
|
35
|
-
onCompleted: ({ fetchAssetByBlockchain }) => {
|
|
36
|
-
setAsset(new AssetEntity_1.default(fetchAssetByBlockchain));
|
|
37
|
-
},
|
|
38
|
-
onError: () => {
|
|
39
|
-
openAlert({
|
|
40
|
-
type: type_1.alertVariants.error,
|
|
41
|
-
caption: 'Oops, something went wrong.',
|
|
42
|
-
});
|
|
43
|
-
setAsset(null);
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
return { clientData: asset, loading, error };
|
|
47
|
-
};
|
|
48
|
-
exports.useFetchAssetByBlockchain = useFetchAssetByBlockchain;
|