@ludo.ninja/components 2.1.3 → 2.1.5
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-identities/mutations/useAddWalletTon/index.d.ts +6 -0
- package/build/api/server-identities/mutations/useAddWalletTon/index.js +35 -0
- package/build/api/server-preferences/mutations/useSaveUserExpectations/index.d.ts +4 -0
- package/build/api/server-preferences/mutations/useSaveUserExpectations/index.js +43 -0
- package/build/api/server-preferences/mutations/useSaveUserInterests/index.d.ts +4 -0
- package/build/api/server-preferences/mutations/useSaveUserInterests/index.js +43 -0
- package/build/api/server-preferences/queries/useFetchExpectations/index.d.ts +7 -0
- package/build/api/server-preferences/queries/useFetchExpectations/index.js +20 -0
- package/build/api/server-preferences/queries/useFetchInterests/index.d.ts +7 -0
- package/build/api/server-preferences/queries/useFetchInterests/index.js +20 -0
- package/build/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.d.ts +12 -0
- package/build/api/server-preferences/queries/useFetchSearchResultTimeSelection/index.js +40 -0
- package/build/api/server-preferences/queries/useFetchUserInterests/index.d.ts +7 -0
- package/build/api/server-preferences/queries/useFetchUserInterests/index.js +21 -0
- package/build/api/server-preferences/queries/useSearchResultBlockchainSelections/index.d.ts +13 -0
- package/build/api/server-preferences/queries/useSearchResultBlockchainSelections/index.js +41 -0
- package/build/api/server-preferences/queries/useSearchResultCategorySelections/index.d.ts +13 -0
- package/build/api/server-preferences/queries/useSearchResultCategorySelections/index.js +40 -0
- package/build/api/server-preferences/queries/useSearchResultStatusSelections/index.d.ts +14 -0
- package/build/api/server-preferences/queries/useSearchResultStatusSelections/index.js +41 -0
- package/build/api/server-preferences/queries/useSearchResultTypeSelections/index.d.ts +13 -0
- package/build/api/server-preferences/queries/useSearchResultTypeSelections/index.js +48 -0
- package/build/api/server-search/queries/useFindUserCreations/index.js +1 -1
- package/build/system/Forms/DatePicker/index.d.ts +0 -2
- package/build/system/Forms/DatePicker/index.js +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { identitySchema as schema } from '@ludo.ninja/api';
|
|
2
|
+
declare const useAddWalletTon: () => {
|
|
3
|
+
addWalletTon: ({ request }: schema.IMutationAddWalletTonArgs) => Promise<import("@apollo/client").FetchResult<any>>;
|
|
4
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
5
|
+
};
|
|
6
|
+
export default useAddWalletTon;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const client_1 = require("@apollo/client");
|
|
4
|
+
const api_1 = require("@ludo.ninja/api");
|
|
5
|
+
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
6
|
+
const ui_1 = require("../../../../store/ui");
|
|
7
|
+
const useAddWalletTon = () => {
|
|
8
|
+
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
9
|
+
const [mutate, { error }] = (0, client_1.useMutation)(api_1.identitySchema.AddWalletTonDocument, {
|
|
10
|
+
context: {
|
|
11
|
+
uri: api_1.hosts.identityHost,
|
|
12
|
+
},
|
|
13
|
+
onCompleted: () => {
|
|
14
|
+
openAlert({
|
|
15
|
+
...data_1.alertSuccess,
|
|
16
|
+
caption: 'TON wallet successfully added!',
|
|
17
|
+
text: '',
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
onError: (err) => {
|
|
21
|
+
openAlert({
|
|
22
|
+
...data_1.alertError,
|
|
23
|
+
caption: err.message,
|
|
24
|
+
text: '',
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return { addWalletTon, error };
|
|
29
|
+
function addWalletTon({ request }) {
|
|
30
|
+
return mutate({
|
|
31
|
+
variables: { request },
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = useAddWalletTon;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_1 = require("@ludo.ninja/api");
|
|
4
|
+
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
5
|
+
const ui_1 = require("../../../../store/ui");
|
|
6
|
+
const useSaveUserExpectations = () => {
|
|
7
|
+
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
|
+
const [mutate] = api_1.preferencesSchema.useSaveUserExpectationsMutation({
|
|
9
|
+
context: {
|
|
10
|
+
uri: api_1.hosts.preferencesHost,
|
|
11
|
+
},
|
|
12
|
+
onCompleted: ({ saveUserExpectations }) => {
|
|
13
|
+
if (saveUserExpectations) {
|
|
14
|
+
openAlert({
|
|
15
|
+
...data_1.alertSuccess,
|
|
16
|
+
caption: 'Expectations successfully added!',
|
|
17
|
+
text: '',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
openAlert({
|
|
22
|
+
...data_1.alertError,
|
|
23
|
+
caption: 'Sorry something went wrong :(',
|
|
24
|
+
text: '',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
onError: (err) => {
|
|
29
|
+
openAlert({
|
|
30
|
+
...data_1.alertError,
|
|
31
|
+
caption: err.message,
|
|
32
|
+
text: '',
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
async function saveUserExpectations(expectations) {
|
|
37
|
+
await mutate({
|
|
38
|
+
variables: { expectations },
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return { saveUserExpectations };
|
|
42
|
+
};
|
|
43
|
+
exports.default = useSaveUserExpectations;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_1 = require("@ludo.ninja/api");
|
|
4
|
+
const data_1 = require("@ludo.ninja/ui/build/system/Alert/data");
|
|
5
|
+
const ui_1 = require("../../../../store/ui");
|
|
6
|
+
const useSaveUserInterests = () => {
|
|
7
|
+
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
8
|
+
const [mutate] = api_1.preferencesSchema.useSaveUserInterestsMutation({
|
|
9
|
+
context: {
|
|
10
|
+
uri: api_1.hosts.preferencesHost,
|
|
11
|
+
},
|
|
12
|
+
onCompleted: ({ saveUserInterests }) => {
|
|
13
|
+
if (saveUserInterests) {
|
|
14
|
+
openAlert({
|
|
15
|
+
...data_1.alertSuccess,
|
|
16
|
+
caption: 'Interests successfully added!',
|
|
17
|
+
text: '',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
openAlert({
|
|
22
|
+
...data_1.alertError,
|
|
23
|
+
caption: 'Sorry something went wrong :(',
|
|
24
|
+
text: '',
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
onError: (err) => {
|
|
29
|
+
openAlert({
|
|
30
|
+
...data_1.alertError,
|
|
31
|
+
caption: err.message,
|
|
32
|
+
text: '',
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
async function saveUserInterests(interests) {
|
|
37
|
+
await mutate({
|
|
38
|
+
variables: { interests },
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return { saveUserInterests };
|
|
42
|
+
};
|
|
43
|
+
exports.default = useSaveUserInterests;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { preferencesSchema as schema } from '@ludo.ninja/api';
|
|
2
|
+
declare const useFetchExpectations: () => {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
5
|
+
expectations: schema.IExpectation[] | null;
|
|
6
|
+
};
|
|
7
|
+
export default useFetchExpectations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const api_1 = require("@ludo.ninja/api");
|
|
5
|
+
const useFetchExpectations = () => {
|
|
6
|
+
const [expectations, setExpectations] = (0, react_1.useState)(null);
|
|
7
|
+
const { loading, error } = api_1.preferencesSchema.useFetchExpectationsQuery({
|
|
8
|
+
context: {
|
|
9
|
+
uri: api_1.hosts.preferencesHost,
|
|
10
|
+
},
|
|
11
|
+
onCompleted: ({ fetchExpectations }) => {
|
|
12
|
+
setExpectations(fetchExpectations);
|
|
13
|
+
},
|
|
14
|
+
onError: () => {
|
|
15
|
+
setExpectations([]);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return { loading, error, expectations };
|
|
19
|
+
};
|
|
20
|
+
exports.default = useFetchExpectations;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const api_1 = require("@ludo.ninja/api");
|
|
5
|
+
const useFetchInterests = () => {
|
|
6
|
+
const [interests, setInterests] = (0, react_1.useState)(null);
|
|
7
|
+
const { loading, error } = api_1.preferencesSchema.useFetchInterestsQuery({
|
|
8
|
+
context: {
|
|
9
|
+
uri: api_1.hosts.preferencesHost,
|
|
10
|
+
},
|
|
11
|
+
onCompleted: ({ fetchInterests }) => {
|
|
12
|
+
setInterests(fetchInterests);
|
|
13
|
+
},
|
|
14
|
+
onError: () => {
|
|
15
|
+
setInterests(null);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return { loading, error, interests };
|
|
19
|
+
};
|
|
20
|
+
exports.default = useFetchInterests;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
+
import { ISelectInput } from '../../../../system/Forms/Selects/MobileSelect';
|
|
3
|
+
export declare const prefetchSearchResultTimeSelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
4
|
+
data: {
|
|
5
|
+
fetchSearchResultTimeSelections: null;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useFetchSearchResultTimeSelections: () => {
|
|
9
|
+
resultTimeSelectionsLoading: boolean;
|
|
10
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
11
|
+
searchResultTimeSelections: ISelectInput[] | null;
|
|
12
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFetchSearchResultTimeSelections = exports.prefetchSearchResultTimeSelections = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const client_1 = require("@apollo/client");
|
|
6
|
+
const api_1 = require("@ludo.ninja/api");
|
|
7
|
+
const prefetchSearchResultTimeSelections = (apolloClient) => {
|
|
8
|
+
return apolloClient
|
|
9
|
+
.query({
|
|
10
|
+
query: api_1.preferencesSchema.FetchSearchResultTimeSelectionsDocument,
|
|
11
|
+
context: { uri: api_1.hosts.preferencesHost },
|
|
12
|
+
fetchPolicy: 'network-only',
|
|
13
|
+
})
|
|
14
|
+
.catch(() => {
|
|
15
|
+
return {
|
|
16
|
+
data: { fetchSearchResultTimeSelections: null },
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.prefetchSearchResultTimeSelections = prefetchSearchResultTimeSelections;
|
|
21
|
+
const useFetchSearchResultTimeSelections = () => {
|
|
22
|
+
const [searchResultTimeSelections, setSearchResultTimeSelections] = (0, react_1.useState)(null);
|
|
23
|
+
const { error, loading } = (0, client_1.useQuery)(api_1.preferencesSchema.FetchSearchResultTimeSelectionsDocument, {
|
|
24
|
+
context: {
|
|
25
|
+
uri: api_1.hosts.preferencesHost,
|
|
26
|
+
},
|
|
27
|
+
onCompleted: ({ fetchSearchResultTimeSelections }) => {
|
|
28
|
+
setSearchResultTimeSelections(fetchSearchResultTimeSelections);
|
|
29
|
+
},
|
|
30
|
+
onError: () => {
|
|
31
|
+
setSearchResultTimeSelections(null);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
resultTimeSelectionsLoading: loading,
|
|
36
|
+
error,
|
|
37
|
+
searchResultTimeSelections,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
exports.useFetchSearchResultTimeSelections = useFetchSearchResultTimeSelections;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { preferencesSchema as schema } from '@ludo.ninja/api';
|
|
2
|
+
declare const useFetchUserInterests: () => {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
5
|
+
userInterests: schema.IUserInterest[] | null;
|
|
6
|
+
};
|
|
7
|
+
export default useFetchUserInterests;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
const api_1 = require("@ludo.ninja/api");
|
|
6
|
+
const useFetchUserInterests = () => {
|
|
7
|
+
const [userInterests, setInterests] = (0, react_1.useState)(null);
|
|
8
|
+
const { loading, error } = (0, client_1.useQuery)(api_1.preferencesSchema.FetchUserInterestsDocument, {
|
|
9
|
+
context: {
|
|
10
|
+
uri: api_1.hosts.preferencesHost,
|
|
11
|
+
},
|
|
12
|
+
onCompleted: ({ fetchUserInterests }) => {
|
|
13
|
+
setInterests(fetchUserInterests);
|
|
14
|
+
},
|
|
15
|
+
onError: () => {
|
|
16
|
+
setInterests(null);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
return { loading, error, userInterests };
|
|
20
|
+
};
|
|
21
|
+
exports.default = useFetchUserInterests;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
+
import { ISelectInput } from '../../../../system/Forms/Selects/MobileSelect';
|
|
3
|
+
export declare const prefetchSearchResultBlockchainSelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
4
|
+
data: {
|
|
5
|
+
fetchSearchResultBlockchainSelections: null;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useSearchResultBlockchainSelections: () => {
|
|
9
|
+
searchResultBlockchainSelectionsLoading: boolean;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
12
|
+
searchResultBlockchainSelections: ISelectInput[] | null;
|
|
13
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSearchResultBlockchainSelections = exports.prefetchSearchResultBlockchainSelections = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const client_1 = require("@apollo/client");
|
|
6
|
+
const api_1 = require("@ludo.ninja/api");
|
|
7
|
+
const prefetchSearchResultBlockchainSelections = (apolloClient) => {
|
|
8
|
+
return apolloClient
|
|
9
|
+
.query({
|
|
10
|
+
query: api_1.preferencesSchema.FetchSearchResultBlockchainSelectionsDocument,
|
|
11
|
+
context: { uri: api_1.hosts.preferencesHost },
|
|
12
|
+
fetchPolicy: 'network-only',
|
|
13
|
+
})
|
|
14
|
+
.catch(() => {
|
|
15
|
+
return {
|
|
16
|
+
data: { fetchSearchResultBlockchainSelections: null },
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.prefetchSearchResultBlockchainSelections = prefetchSearchResultBlockchainSelections;
|
|
21
|
+
const useSearchResultBlockchainSelections = () => {
|
|
22
|
+
const [searchResultBlockchainSelections, setSearchResultBlockchainSelections,] = (0, react_1.useState)(null);
|
|
23
|
+
const { error, loading } = (0, client_1.useQuery)(api_1.preferencesSchema.FetchSearchResultBlockchainSelectionsDocument, {
|
|
24
|
+
context: {
|
|
25
|
+
uri: api_1.hosts.preferencesHost,
|
|
26
|
+
},
|
|
27
|
+
onCompleted: ({ fetchSearchResultBlockchainSelections }) => {
|
|
28
|
+
setSearchResultBlockchainSelections(fetchSearchResultBlockchainSelections);
|
|
29
|
+
},
|
|
30
|
+
onError: () => {
|
|
31
|
+
setSearchResultBlockchainSelections(null);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
searchResultBlockchainSelectionsLoading: loading,
|
|
36
|
+
loading,
|
|
37
|
+
error,
|
|
38
|
+
searchResultBlockchainSelections,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.useSearchResultBlockchainSelections = useSearchResultBlockchainSelections;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
+
import { preferencesSchema as schema } from '@ludo.ninja/api';
|
|
3
|
+
export declare const prefetchSearchResultCategorySelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
4
|
+
data: {
|
|
5
|
+
fetchSearchResultCategorySelections: null;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
declare const useSearchResultCategorySelections: () => {
|
|
9
|
+
categorySelectionsLoading: boolean;
|
|
10
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
11
|
+
searchResultCategorySelections: schema.Maybe<Pick<schema.ISelection, "label" | "name">>[] | null;
|
|
12
|
+
};
|
|
13
|
+
export default useSearchResultCategorySelections;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prefetchSearchResultCategorySelections = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const client_1 = require("@apollo/client");
|
|
6
|
+
const api_1 = require("@ludo.ninja/api");
|
|
7
|
+
const prefetchSearchResultCategorySelections = (apolloClient) => {
|
|
8
|
+
return apolloClient
|
|
9
|
+
.query({
|
|
10
|
+
query: api_1.preferencesSchema.FetchSearchResultCategorySelectionsDocument,
|
|
11
|
+
context: { uri: api_1.hosts.preferencesHost },
|
|
12
|
+
fetchPolicy: 'network-only',
|
|
13
|
+
})
|
|
14
|
+
.catch(() => {
|
|
15
|
+
return {
|
|
16
|
+
data: { fetchSearchResultCategorySelections: null },
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.prefetchSearchResultCategorySelections = prefetchSearchResultCategorySelections;
|
|
21
|
+
const useSearchResultCategorySelections = () => {
|
|
22
|
+
const [searchResultCategorySelections, setSearchResultCategorySelections] = (0, react_1.useState)(null);
|
|
23
|
+
const { error, loading } = (0, client_1.useQuery)(api_1.preferencesSchema.FetchSearchResultCategorySelectionsDocument, {
|
|
24
|
+
context: {
|
|
25
|
+
uri: api_1.hosts.preferencesHost,
|
|
26
|
+
},
|
|
27
|
+
onCompleted: ({ fetchSearchResultCategorySelections }) => {
|
|
28
|
+
setSearchResultCategorySelections(fetchSearchResultCategorySelections);
|
|
29
|
+
},
|
|
30
|
+
onError: () => {
|
|
31
|
+
setSearchResultCategorySelections(null);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
categorySelectionsLoading: loading,
|
|
36
|
+
error,
|
|
37
|
+
searchResultCategorySelections,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
exports.default = useSearchResultCategorySelections;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
+
import { preferencesSchema as schema } from '@ludo.ninja/api';
|
|
3
|
+
export declare const prefetchSearchResultStatusSelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
4
|
+
data: {
|
|
5
|
+
fetchSearchResultStatusSelections: null;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
declare const useSearchResultStatusSelections: () => {
|
|
9
|
+
searchResultStatusSelectionsLoading: boolean;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
12
|
+
searchResultStatusSelections: schema.Maybe<Pick<schema.ISelection, "label" | "name">>[] | null;
|
|
13
|
+
};
|
|
14
|
+
export default useSearchResultStatusSelections;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prefetchSearchResultStatusSelections = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const client_1 = require("@apollo/client");
|
|
6
|
+
const api_1 = require("@ludo.ninja/api");
|
|
7
|
+
const prefetchSearchResultStatusSelections = (apolloClient) => {
|
|
8
|
+
return apolloClient
|
|
9
|
+
.query({
|
|
10
|
+
query: api_1.preferencesSchema.FetchSearchResultStatusSelectionsDocument,
|
|
11
|
+
context: { uri: api_1.hosts.preferencesHost },
|
|
12
|
+
fetchPolicy: 'network-only',
|
|
13
|
+
})
|
|
14
|
+
.catch(() => {
|
|
15
|
+
return {
|
|
16
|
+
data: { fetchSearchResultStatusSelections: null },
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
exports.prefetchSearchResultStatusSelections = prefetchSearchResultStatusSelections;
|
|
21
|
+
const useSearchResultStatusSelections = () => {
|
|
22
|
+
const [searchResultStatusSelections, setSearchResultStatusSelections] = (0, react_1.useState)(null);
|
|
23
|
+
const { error, loading } = (0, client_1.useQuery)(api_1.preferencesSchema.FetchSearchResultStatusSelectionsDocument, {
|
|
24
|
+
context: {
|
|
25
|
+
uri: api_1.hosts.preferencesHost,
|
|
26
|
+
},
|
|
27
|
+
onCompleted: ({ fetchSearchResultStatusSelections }) => {
|
|
28
|
+
setSearchResultStatusSelections(fetchSearchResultStatusSelections);
|
|
29
|
+
},
|
|
30
|
+
onError: () => {
|
|
31
|
+
setSearchResultStatusSelections(null);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return {
|
|
35
|
+
searchResultStatusSelectionsLoading: loading,
|
|
36
|
+
loading,
|
|
37
|
+
error,
|
|
38
|
+
searchResultStatusSelections,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.default = useSearchResultStatusSelections;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
+
import { preferencesSchema as schema } from '@ludo.ninja/api';
|
|
3
|
+
export declare const prefetchSearchResultTypeSelections: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
4
|
+
data: {
|
|
5
|
+
fetchSetsSearchResultTypeSelections: null;
|
|
6
|
+
};
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useSearchResultTypeSelections: () => {
|
|
9
|
+
resultTypeSelectionsLoading: boolean;
|
|
10
|
+
error: import("@apollo/client").ApolloError | undefined;
|
|
11
|
+
data: any;
|
|
12
|
+
searchResultTypeSelections: schema.Maybe<Pick<schema.ISelection, "label" | "name">>[] | null;
|
|
13
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSearchResultTypeSelections = exports.prefetchSearchResultTypeSelections = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const client_1 = require("@apollo/client");
|
|
6
|
+
const api_1 = require("@ludo.ninja/api");
|
|
7
|
+
const prefetchSearchResultTypeSelections = (apolloClient) => {
|
|
8
|
+
return apolloClient
|
|
9
|
+
.query({
|
|
10
|
+
query: (0, client_1.gql) `
|
|
11
|
+
query FetchSetsSearchResultTypeSelections {
|
|
12
|
+
fetchSearchResultTypeSelections {
|
|
13
|
+
name
|
|
14
|
+
label
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`,
|
|
18
|
+
context: { uri: api_1.hosts.preferencesHost },
|
|
19
|
+
fetchPolicy: 'network-only',
|
|
20
|
+
})
|
|
21
|
+
.catch(() => {
|
|
22
|
+
return {
|
|
23
|
+
data: { fetchSetsSearchResultTypeSelections: null },
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
exports.prefetchSearchResultTypeSelections = prefetchSearchResultTypeSelections;
|
|
28
|
+
const useSearchResultTypeSelections = () => {
|
|
29
|
+
const [searchResultTypeSelections, setSearchResultTypeSelections] = (0, react_1.useState)(null);
|
|
30
|
+
const { data, error, loading } = (0, client_1.useQuery)(api_1.preferencesSchema.FetchSetsSearchResultTypeSelectionsDocument, {
|
|
31
|
+
context: {
|
|
32
|
+
uri: api_1.hosts.preferencesHost,
|
|
33
|
+
},
|
|
34
|
+
onCompleted: ({ fetchSetsSearchResultTypeSelections }) => {
|
|
35
|
+
setSearchResultTypeSelections(fetchSetsSearchResultTypeSelections);
|
|
36
|
+
},
|
|
37
|
+
onError: () => {
|
|
38
|
+
setSearchResultTypeSelections(null);
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
resultTypeSelectionsLoading: loading,
|
|
43
|
+
error,
|
|
44
|
+
data,
|
|
45
|
+
searchResultTypeSelections,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
exports.useSearchResultTypeSelections = useSearchResultTypeSelections;
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const getPageSizeAssets_1 = require("../../../../utils/getPageSizeAssets");
|
|
8
7
|
const api_1 = require("@ludo.ninja/api");
|
|
8
|
+
const getPageSizeAssets_1 = require("../../../../utils/getPageSizeAssets");
|
|
9
9
|
const CreationEntity_1 = __importDefault(require("../../../../dto/CreationEntity"));
|
|
10
10
|
const limit = 20;
|
|
11
11
|
const useFindUserCreations = ({ ownerId, input, scrollTab, }) => {
|
|
@@ -4,9 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
|
|
7
|
+
// add imports to global css (next js - _app.tsx)
|
|
8
|
+
// import 'react-calendar/dist/Calendar.css';
|
|
9
|
+
// import 'react-date-picker/dist/DatePicker.css';
|
|
8
10
|
const react_date_picker_1 = __importDefault(require("react-date-picker"));
|
|
9
|
-
require("react-date-picker/dist/DatePicker.css");
|
|
10
11
|
const react_hook_form_1 = require("react-hook-form");
|
|
11
12
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
12
13
|
const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
|