@ludo.ninja/components 2.4.12 → 2.4.13
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/discord/useCheckDiscordFollow.js +1 -1
- package/build/system/Labels/ExperienceLabel/index.d.ts +1 -1
- package/build/system/Labels/ExperienceLabel/index.js +0 -2
- package/package.json +1 -1
- package/build/api/server-experiences/queries/useFetchMyTasks/index.d.ts +0 -31
- package/build/api/server-experiences/queries/useFetchMyTasks/index.js +0 -46
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCheckDiscordFollow = useCheckDiscordFollow;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const PUBLIC_BOT_TOKEN = 'MTQyNTUxNzk0NzkyNDkwNTk5Ng.
|
|
5
|
+
const PUBLIC_BOT_TOKEN = 'MTQyNTUxNzk0NzkyNDkwNTk5Ng.GxKVUP.DlgMRxCmLVlCzmCnIm6dBgEw5g8CtciSCCpnNI';
|
|
6
6
|
function useCheckDiscordFollow(discordUserId, guildId = '854266585862504459') {
|
|
7
7
|
const [status, setStatus] = (0, react_1.useState)(null);
|
|
8
8
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
@@ -5,5 +5,5 @@ declare const ExperienceLabel: ({ value, link, loading, className, style }: {
|
|
|
5
5
|
loading?: boolean;
|
|
6
6
|
className?: string;
|
|
7
7
|
style?: React.CSSProperties;
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default ExperienceLabel;
|
|
@@ -88,8 +88,6 @@ const StyledExpTab = styled_components_1.default.div `
|
|
|
88
88
|
const ExperienceLabel = ({ value = 0, link, loading, className, style }) => {
|
|
89
89
|
if (loading)
|
|
90
90
|
return (0, jsx_runtime_1.jsx)(SkeletonLabel_1.default, {});
|
|
91
|
-
if (!value)
|
|
92
|
-
return null;
|
|
93
91
|
return link ? ((0, jsx_runtime_1.jsx)(StyledExpLink, { href: link, className: className, style: style, children: (0, jsx_runtime_1.jsx)(LabelContent, { value: value }) })) : ((0, jsx_runtime_1.jsx)(StyledExpTab, { className: className, style: style, children: (0, jsx_runtime_1.jsx)(LabelContent, { value: value }) }));
|
|
94
92
|
};
|
|
95
93
|
const LabelContent = ({ value }) => {
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
|
|
2
|
-
import { experiencesSchema as schema } from '@ludo.ninja/api';
|
|
3
|
-
export declare const prefetchMyTasks: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
4
|
-
data: {
|
|
5
|
-
fetchMyTasks: null;
|
|
6
|
-
};
|
|
7
|
-
}>;
|
|
8
|
-
export declare const useFetchMyTasks: ({ prefetchedMyTasks, }: {
|
|
9
|
-
prefetchedMyTasks: schema.ITask[] | null;
|
|
10
|
-
}) => {
|
|
11
|
-
loadingMyTasks: boolean;
|
|
12
|
-
errorMyTasks: import("@apollo/client").ApolloError | undefined;
|
|
13
|
-
data: any;
|
|
14
|
-
clientMyTasksData: schema.ITask[] | null;
|
|
15
|
-
};
|
|
16
|
-
declare const _default: {
|
|
17
|
-
useFetchMyTasks: ({ prefetchedMyTasks, }: {
|
|
18
|
-
prefetchedMyTasks: schema.ITask[] | null;
|
|
19
|
-
}) => {
|
|
20
|
-
loadingMyTasks: boolean;
|
|
21
|
-
errorMyTasks: import("@apollo/client").ApolloError | undefined;
|
|
22
|
-
data: any;
|
|
23
|
-
clientMyTasksData: schema.ITask[] | null;
|
|
24
|
-
};
|
|
25
|
-
prefetchMyTasks: (apolloClient: ApolloClient<NormalizedCacheObject>) => Promise<import("@apollo/client").ApolloQueryResult<any> | {
|
|
26
|
-
data: {
|
|
27
|
-
fetchMyTasks: null;
|
|
28
|
-
};
|
|
29
|
-
}>;
|
|
30
|
-
};
|
|
31
|
-
export default _default;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useFetchMyTasks = exports.prefetchMyTasks = 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 ui_1 = require("../../../../store/ui");
|
|
8
|
-
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
9
|
-
const prefetchMyTasks = (apolloClient) => {
|
|
10
|
-
return apolloClient
|
|
11
|
-
.query({
|
|
12
|
-
query: api_1.experiencesSchema.FetchMyTasksDocument,
|
|
13
|
-
context: { uri: api_1.hosts.serverExperiencesHost },
|
|
14
|
-
fetchPolicy: 'network-only',
|
|
15
|
-
})
|
|
16
|
-
.catch(() => {
|
|
17
|
-
return {
|
|
18
|
-
data: { fetchMyTasks: null },
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
exports.prefetchMyTasks = prefetchMyTasks;
|
|
23
|
-
const useFetchMyTasks = ({ prefetchedMyTasks, }) => {
|
|
24
|
-
const [myTasks, setMyTasks] = (0, react_1.useState)(prefetchedMyTasks);
|
|
25
|
-
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
26
|
-
const { data, error, loading } = (0, client_1.useQuery)(api_1.experiencesSchema.FetchMyTasksDocument, {
|
|
27
|
-
context: {
|
|
28
|
-
uri: api_1.hosts.experiencesHost,
|
|
29
|
-
},
|
|
30
|
-
onCompleted: ({ fetchMyTasks }) => {
|
|
31
|
-
setMyTasks(fetchMyTasks);
|
|
32
|
-
},
|
|
33
|
-
onError: (err) => {
|
|
34
|
-
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
35
|
-
setMyTasks([]);
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
loadingMyTasks: loading,
|
|
40
|
-
errorMyTasks: error,
|
|
41
|
-
data,
|
|
42
|
-
clientMyTasksData: myTasks,
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
exports.useFetchMyTasks = useFetchMyTasks;
|
|
46
|
-
exports.default = { useFetchMyTasks: exports.useFetchMyTasks, prefetchMyTasks: exports.prefetchMyTasks };
|