@ludo.ninja/components 2.4.22 → 2.4.24
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/useSetShootingStarBoost/index.js +2 -2
- package/build/api/server-identities/queries/useCheckDiscordFollow/index.d.ts +8 -0
- package/build/api/server-identities/queries/useCheckDiscordFollow/index.js +27 -0
- package/build/components/ludoEducatorModal/index.js +6 -6
- package/build/components/markerButton/index.d.ts +7 -0
- package/build/components/markerButton/index.js +83 -0
- package/build/layouts/AppLayout.js +0 -8
- package/build/layouts/GlobalLayout.d.ts +1 -1
- package/build/layouts/GlobalLayout.js +9 -8
- package/package.json +1 -1
- package/build/api/discord/useCheckDiscordFollow.d.ts +0 -8
- package/build/api/discord/useCheckDiscordFollow.js +0 -43
|
@@ -7,14 +7,14 @@ const react_1 = require("react");
|
|
|
7
7
|
const useSetShootingStarBoost = () => {
|
|
8
8
|
const [isSetShootingStarBoost, setSetShootingStarBoost] = (0, react_1.useState)(false);
|
|
9
9
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
10
|
-
const [mutate, { error, loading }] = api_1.identitySchema.
|
|
10
|
+
const [mutate, { error, loading }] = api_1.identitySchema.useSetShootingStarBoostMutation({
|
|
11
11
|
context: {
|
|
12
12
|
uri: api_1.hosts.identityHost,
|
|
13
13
|
},
|
|
14
14
|
fetchPolicy: "no-cache",
|
|
15
15
|
refetchQueries: [api_1.identitySchema.FetchProfileDocument],
|
|
16
16
|
onCompleted: (data) => {
|
|
17
|
-
setSetShootingStarBoost(data.
|
|
17
|
+
setSetShootingStarBoost(data.setShootingStarBoost);
|
|
18
18
|
},
|
|
19
19
|
onError: (err) => {
|
|
20
20
|
setSetShootingStarBoost(false);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCheckDiscordFollow = useCheckDiscordFollow;
|
|
4
|
+
const ui_1 = require("../../../../store/ui");
|
|
5
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
6
|
+
const api_1 = require("@ludo.ninja/api");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
function useCheckDiscordFollow() {
|
|
9
|
+
const [status, setStatus] = (0, react_1.useState)(null);
|
|
10
|
+
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
11
|
+
const { error, loading, refetch } = api_1.identitySchema.useCheckDiscordSubscriptionQuery({
|
|
12
|
+
context: {
|
|
13
|
+
uri: api_1.hosts.identityHost,
|
|
14
|
+
},
|
|
15
|
+
onCompleted: ({ checkDiscordSubscription }) => {
|
|
16
|
+
setStatus({ following: checkDiscordSubscription });
|
|
17
|
+
},
|
|
18
|
+
onError: (err) => {
|
|
19
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
followDiscordStatus: status,
|
|
24
|
+
followDiscordStatusLoading: loading,
|
|
25
|
+
followDiscordStatusError: error?.message,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -7,7 +7,7 @@ exports.Wrapper = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const CheckListItem_1 = __importDefault(require("./CheckListItem"));
|
|
9
9
|
const Congratulations_1 = __importDefault(require("./Congratulations"));
|
|
10
|
-
const useCheckDiscordFollow_1 = require("../../api/
|
|
10
|
+
const useCheckDiscordFollow_1 = require("../../api/server-identities/queries/useCheckDiscordFollow");
|
|
11
11
|
const useSetEducatorBoost_1 = __importDefault(require("../../api/server-identities/mutations/useSetEducatorBoost"));
|
|
12
12
|
const useSetShootingStarBoost_1 = __importDefault(require("../../api/server-identities/mutations/useSetShootingStarBoost"));
|
|
13
13
|
const useFetchProfile_1 = require("../../api/server-identities/queries/useFetchProfile");
|
|
@@ -112,7 +112,7 @@ const LudoEducatorModal = ({ userId, onBoostAdded, boostType, className, style }
|
|
|
112
112
|
const social = clientProfileData?.getSocial();
|
|
113
113
|
const twitterUserName = social?.twitter?.split("https://x.com/")?.[1] || "";
|
|
114
114
|
const { followStatus, followStatusLoading } = (0, useCheckFollow_1.useCheckFollow)(twitterUserName);
|
|
115
|
-
const { followDiscordStatus, followDiscordStatusLoading } = (0, useCheckDiscordFollow_1.useCheckDiscordFollow)(
|
|
115
|
+
const { followDiscordStatus, followDiscordStatusLoading } = (0, useCheckDiscordFollow_1.useCheckDiscordFollow)();
|
|
116
116
|
const { setEducatorBoost, loadingSetEducatorBoost } = (0, useSetEducatorBoost_1.default)();
|
|
117
117
|
const { setShootingStarBoost, loadingSetShootingStarBoost } = (0, useSetShootingStarBoost_1.default)();
|
|
118
118
|
const isSocialsConnected = social?.twitter && social?.telegramLink;
|
|
@@ -142,7 +142,7 @@ const LudoEducatorModal = ({ userId, onBoostAdded, boostType, className, style }
|
|
|
142
142
|
case schema_1.IBoostType.Educator:
|
|
143
143
|
handleBecomeLudoEducator();
|
|
144
144
|
return;
|
|
145
|
-
case schema_1.IBoostType.
|
|
145
|
+
case schema_1.IBoostType.ShootingStar:
|
|
146
146
|
handleBecomeLudoShootingStar();
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
@@ -151,7 +151,7 @@ const LudoEducatorModal = ({ userId, onBoostAdded, boostType, className, style }
|
|
|
151
151
|
switch (boostType) {
|
|
152
152
|
case schema_1.IBoostType.Educator:
|
|
153
153
|
return "Become Ludo Educator";
|
|
154
|
-
case schema_1.IBoostType.
|
|
154
|
+
case schema_1.IBoostType.ShootingStar:
|
|
155
155
|
return "Become Shooting Star";
|
|
156
156
|
}
|
|
157
157
|
};
|
|
@@ -159,7 +159,7 @@ const LudoEducatorModal = ({ userId, onBoostAdded, boostType, className, style }
|
|
|
159
159
|
switch (boostType) {
|
|
160
160
|
case schema_1.IBoostType.Educator:
|
|
161
161
|
return !isCheckListDone || loadingSetEducatorBoost || clientProfileLoading;
|
|
162
|
-
case schema_1.IBoostType.
|
|
162
|
+
case schema_1.IBoostType.ShootingStar:
|
|
163
163
|
return !isShootingStarCheckListDone || loadingSetShootingStarBoost || clientProfileLoading;
|
|
164
164
|
}
|
|
165
165
|
};
|
|
@@ -177,6 +177,6 @@ const LudoEducatorModal = ({ userId, onBoostAdded, boostType, className, style }
|
|
|
177
177
|
borderRadius: "12px",
|
|
178
178
|
border: "none",
|
|
179
179
|
},
|
|
180
|
-
}, overlay: (0, jsx_runtime_1.jsx)(index_1.H6, { style: { fontWeight: 500 }, children: "You have to connect the same X account to proceed" }), children: (0, jsx_runtime_1.jsxs)(FollowLink, { onClick: () => closeModalSidebarPortal(), target: "_blank", href: (0, utils_1.appendUtmParam)("https://x.com/LudoHQ"), children: [(0, jsx_runtime_1.jsx)(index_1.H6, { children: "Follow @LudoHQ" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] }) }) })), clientProfileLoading ? ((0, jsx_runtime_1.jsx)(StyledSkeleton, {})) : ((0, jsx_runtime_1.jsx)(CheckListItem_1.default, { isDone: Boolean(social?.telegramId), title: (0, jsx_runtime_1.jsxs)(FollowLink, { onClick: () => closeModalSidebarPortal(), target: "_blank", href: (0, utils_1.appendUtmParam)(`https://t.me/LudoAppBot?start=${userId}`), children: [(0, jsx_runtime_1.jsx)(index_1.H6, { children: "Register to LudoAppBot" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] }) })), boostType === schema_1.IBoostType.
|
|
180
|
+
}, overlay: (0, jsx_runtime_1.jsx)(index_1.H6, { style: { fontWeight: 500 }, children: "You have to connect the same X account to proceed" }), children: (0, jsx_runtime_1.jsxs)(FollowLink, { onClick: () => closeModalSidebarPortal(), target: "_blank", href: (0, utils_1.appendUtmParam)("https://x.com/LudoHQ"), children: [(0, jsx_runtime_1.jsx)(index_1.H6, { children: "Follow @LudoHQ" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] }) }) })), clientProfileLoading ? ((0, jsx_runtime_1.jsx)(StyledSkeleton, {})) : ((0, jsx_runtime_1.jsx)(CheckListItem_1.default, { isDone: Boolean(social?.telegramId), title: (0, jsx_runtime_1.jsxs)(FollowLink, { onClick: () => closeModalSidebarPortal(), target: "_blank", href: (0, utils_1.appendUtmParam)(`https://t.me/LudoAppBot?start=${userId}`), children: [(0, jsx_runtime_1.jsx)(index_1.H6, { children: "Register to LudoAppBot" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] }) })), boostType === schema_1.IBoostType.ShootingStar && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [clientProfileLoading ? ((0, jsx_runtime_1.jsx)(StyledSkeleton, {})) : ((0, jsx_runtime_1.jsx)(CheckListItem_1.default, { isDone: !!social?.discordId, title: social?.discordId ? ("Connect Discord") : ((0, jsx_runtime_1.jsxs)(StyledLink, { href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["account"]}/settings`, children: [(0, jsx_runtime_1.jsx)(index_1.H6, { children: "Connect Discord" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] })) })), followDiscordStatusLoading ? ((0, jsx_runtime_1.jsx)(StyledSkeleton, {})) : ((0, jsx_runtime_1.jsx)(CheckListItem_1.default, { isDone: Boolean(followDiscordStatus?.following), title: (0, jsx_runtime_1.jsxs)(FollowLink, { onClick: () => closeModalSidebarPortal(), target: "_blank", href: (0, utils_1.appendUtmParam)("https://discord.gg/m2bjPqGbyj"), children: [(0, jsx_runtime_1.jsx)(index_1.H6, { children: "Join Ludo server" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] }) }))] }))] }), (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { layout: true, children: (0, jsx_runtime_1.jsx)(framer_motion_1.AnimatePresence, { children: (0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: 20 }, transition: { type: "spring", stiffness: 280, damping: 18 }, className: "w-full flex justify-center", children: (0, jsx_runtime_1.jsx)(ActionButton, { className: "modal-action-btn", variant: "primaryM", text: getSubmitButtonLabel(), disabled: getSubmitButtonDisabled(), onClick: handleSubmit }) }, "submit-btn") }) })] }));
|
|
181
181
|
};
|
|
182
182
|
exports.default = LudoEducatorModal;
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const marker_io_1 = require("../../hooks/marker-io");
|
|
8
|
+
const env_1 = require("../../store/env");
|
|
9
|
+
const ScreenWidth_1 = require("../../styles/ScreenWidth");
|
|
10
|
+
const ui_1 = require("@ludo.ninja/ui");
|
|
11
|
+
const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
|
|
12
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
15
|
+
const StyledButton = styled_components_1.default.button `
|
|
16
|
+
position: fixed;
|
|
17
|
+
inset: auto auto 48px 0;
|
|
18
|
+
|
|
19
|
+
display: flex;
|
|
20
|
+
padding: 7px 22px 7px 18px;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 0;
|
|
24
|
+
color: ${colors_1.WhiteColor};
|
|
25
|
+
|
|
26
|
+
border: none;
|
|
27
|
+
border-radius: 0 30px 30px 0;
|
|
28
|
+
background: linear-gradient(96deg, rgba(172, 184, 247, 0.7) 6.02%, rgba(189, 235, 255, 0.7) 100%),
|
|
29
|
+
rgba(165, 51, 255, 0.8);
|
|
30
|
+
|
|
31
|
+
transition: gap 0.4s ease-in-out;
|
|
32
|
+
|
|
33
|
+
.button-title {
|
|
34
|
+
width: 0;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
white-space: nowrap;
|
|
37
|
+
transition: width 0.4s ease-in-out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
svg {
|
|
41
|
+
width: 24px;
|
|
42
|
+
height: 24px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:hover {
|
|
46
|
+
gap: 8px;
|
|
47
|
+
|
|
48
|
+
.button-title {
|
|
49
|
+
width: 98px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
54
|
+
inset: auto auto ${(0, _4k_1.adaptiveValueCalc)(48)} 0;
|
|
55
|
+
padding: ${(0, _4k_1.adaptiveValueCalc)(7)} ${(0, _4k_1.adaptiveValueCalc)(22)} ${(0, _4k_1.adaptiveValueCalc)(7)} ${(0, _4k_1.adaptiveValueCalc)(18)};
|
|
56
|
+
border-radius: 0 ${(0, _4k_1.adaptiveValueCalc)(30)} ${(0, _4k_1.adaptiveValueCalc)(30)} 0;
|
|
57
|
+
|
|
58
|
+
svg {
|
|
59
|
+
width: ${(0, _4k_1.adaptiveValueCalc)(24)};
|
|
60
|
+
height: ${(0, _4k_1.adaptiveValueCalc)(24)};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:hover {
|
|
64
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(8)};
|
|
65
|
+
|
|
66
|
+
.button-title {
|
|
67
|
+
width: ${(0, _4k_1.adaptiveValueCalc)(98)};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
const MarkerButton = ({ className, style }) => {
|
|
73
|
+
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
74
|
+
const { loadMarkerSDK, widget } = (0, marker_io_1.useMarkerIo)(isProd() ? "prod" : "dev");
|
|
75
|
+
const handleClick = () => {
|
|
76
|
+
widget?.capture("fullscreen");
|
|
77
|
+
};
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
loadMarkerSDK();
|
|
80
|
+
}, []);
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(StyledButton, { className: className, style: style, onClick: handleClick, children: [(0, jsx_runtime_1.jsx)(ui_1.H5, { className: "button-title", children: "Report a bug" }), (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M21.6905 14.6536C22.1286 14.0051 22.39 13.1796 22.3901 12.1587C22.3901 11.1376 22.1287 10.3113 21.6905 9.6626C21.2564 9.02016 20.6846 8.60471 20.1424 8.33721C19.6691 8.10369 19.2042 7.97765 18.8369 7.90713L18.8368 7.90569C18.8245 7.80726 18.8114 7.70141 18.7936 7.58955C18.6909 6.94386 18.4842 6.06828 18.0612 5.18135C17.6369 4.29187 16.9846 3.36853 15.9834 2.66885C14.9744 1.96374 13.6654 1.52394 11.999 1.52393C10.3326 1.52393 9.02367 1.96374 8.01467 2.66885C7.01345 3.36853 6.36122 4.29185 5.93694 5.18135C5.51387 6.0683 5.30601 6.94384 5.20334 7.58955C5.18556 7.70143 5.17239 7.80733 5.16015 7.90577L5.15999 7.90713C4.79295 7.97768 4.32854 8.10393 3.85569 8.33721C3.31353 8.6047 2.74167 9.0202 2.30764 9.6626C1.8694 10.3113 1.60803 11.1375 1.60803 12.1587C1.60813 13.1796 1.86948 14.0051 2.30764 14.6536C2.74167 15.296 3.31353 15.7115 3.85569 15.979C4.39455 16.2448 4.92229 16.3738 5.30764 16.4372C5.50241 16.4692 5.66674 16.4851 5.78577 16.4935C5.84528 16.4977 5.8939 16.5005 5.92991 16.5017C5.94784 16.5022 5.96294 16.5026 5.97444 16.5028H5.99905H6.89905V8.70869C6.89916 8.70146 6.89966 8.68873 6.90022 8.67119C6.90136 8.63532 6.90338 8.57885 6.90842 8.50478C6.91859 8.35565 6.93902 8.13651 6.98108 7.87197C7.06592 7.33841 7.23423 6.64136 7.56116 5.95596C7.88688 5.27312 8.35968 4.62381 9.04592 4.14424C9.72441 3.67014 10.6656 3.32393 11.999 3.32393C13.3325 3.32394 14.2737 3.67011 14.9522 4.14424C15.6384 4.62382 16.1112 5.27309 16.4369 5.95596C16.7638 6.64133 16.931 7.33842 17.0158 7.87197C17.0579 8.13654 17.0795 8.35564 17.0897 8.50478C17.0947 8.57885 17.0967 8.63532 17.0979 8.67119C17.0984 8.68874 17.0989 8.70147 17.099 8.70869V15.6028C17.099 16.7996 16.2859 17.5538 15.1948 18.0567C14.6631 18.3018 14.1209 18.4568 13.7053 18.5501C13.4997 18.5962 13.3293 18.6268 13.2131 18.645C13.1569 18.6538 13.1136 18.6589 13.0854 18.6626C13.0716 18.6629 13.0553 18.6643 13.0373 18.6649C12.9779 18.667 12.8958 18.671 12.7983 18.679C12.6066 18.6948 12.337 18.727 12.0565 18.7962C11.7887 18.8622 11.4384 18.9795 11.1365 19.2028C10.8099 19.4446 10.499 19.8498 10.499 20.4239C10.499 21.2513 11.0222 21.9006 11.6182 22.211C12.2293 22.5291 13.1138 22.5804 13.7768 21.9263C14.3168 21.3934 14.3625 20.73 14.3041 20.2563C14.7716 20.1413 15.3563 19.9644 15.9483 19.6915C17.1147 19.1539 18.4916 18.1518 18.8229 16.4103C19.1922 16.3403 19.6632 16.2155 20.1424 15.979C20.6846 15.7115 21.2564 15.2961 21.6905 14.6536Z", fill: "white" }) })] }));
|
|
82
|
+
};
|
|
83
|
+
exports.default = MarkerButton;
|
|
@@ -3,26 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AppLayout = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const apollo_1 = require("../hooks/apollo");
|
|
6
|
-
const marker_io_1 = require("../hooks/marker-io");
|
|
7
6
|
const useGlobalRefCode_1 = require("../hooks/refCode/useGlobalRefCode");
|
|
8
7
|
const GlobalLayout_1 = require("./GlobalLayout");
|
|
9
8
|
const HOCAuthSearchParamsLocalhostInterceptor_1 = require("../modules/user/auth/HOCAuthSearchParamsLocalhostInterceptor");
|
|
10
9
|
const store_1 = require("../modules/user/store");
|
|
11
|
-
const env_1 = require("../store/env");
|
|
12
10
|
const index_1 = require("../store/index");
|
|
13
11
|
const ui_1 = require("../store/ui");
|
|
14
12
|
const client_1 = require("@apollo/client");
|
|
15
|
-
const react_1 = require("react");
|
|
16
13
|
const styled_components_1 = require("styled-components");
|
|
17
14
|
const AppLayoutProviders = ({ children, pageProps }) => {
|
|
18
15
|
const apolloClient = (0, apollo_1.useApollo)(pageProps);
|
|
19
16
|
const theme = (0, ui_1.useUiStore)((state) => state.theme);
|
|
20
17
|
(0, useGlobalRefCode_1.useGlobalRefCode)();
|
|
21
|
-
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
22
|
-
const { loadMarkerSDK } = (0, marker_io_1.useMarkerIo)(isProd() ? "prod" : "dev");
|
|
23
|
-
(0, react_1.useEffect)(() => {
|
|
24
|
-
loadMarkerSDK();
|
|
25
|
-
}, []);
|
|
26
18
|
return ((0, jsx_runtime_1.jsx)(index_1.SSRProvider, { initialState: {
|
|
27
19
|
isMobile: pageProps.isMobile,
|
|
28
20
|
}, children: (0, jsx_runtime_1.jsx)(client_1.ApolloProvider, { client: apolloClient, children: (0, jsx_runtime_1.jsx)(styled_components_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(store_1.UserProvider, { initialState: {
|
|
@@ -5,8 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GlobalLayout = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const
|
|
8
|
+
const SubscriberNotifications_1 = require("../api/subscriptions/SubscriberNotifications");
|
|
9
|
+
const markerButton_1 = __importDefault(require("../components/markerButton"));
|
|
9
10
|
const initializer_1 = require("../components/sidebar/initializer");
|
|
11
|
+
const useMultiAudio_1 = __importDefault(require("../hooks/audio/useMultiAudio"));
|
|
12
|
+
const CreatorNotifications_1 = require("../modules/notifications/CreatorNotifications");
|
|
13
|
+
// import useFetchMyExperience from '@/api/server-experiences/queries/useFetchMyExperience';
|
|
14
|
+
const sessionScroll_1 = require("../modules/sessionScroll");
|
|
10
15
|
const useAuthVerification_1 = require("../modules/user/auth/useAuthVerification");
|
|
11
16
|
const profileDataInitialization_1 = require("../modules/user/profileData/profileDataInitialization");
|
|
12
17
|
const env_1 = require("../store/env");
|
|
@@ -17,17 +22,13 @@ const ModalSidebar_1 = __importDefault(require("../system/Modals/ModalSidebar"))
|
|
|
17
22
|
const CreatorModalSidebarPortal_1 = require("../system/Modals/ModalSidebar/CreatorModalSidebarPortal");
|
|
18
23
|
const Overlay_1 = __importDefault(require("../system/Overlay"));
|
|
19
24
|
const screen_1 = require("../utils/screen");
|
|
20
|
-
const
|
|
21
|
-
const CreatorNotifications_1 = require("../modules/notifications/CreatorNotifications");
|
|
22
|
-
// import useFetchMyExperience from '@/api/server-experiences/queries/useFetchMyExperience';
|
|
23
|
-
const sessionScroll_1 = require("../modules/sessionScroll");
|
|
24
|
-
const SubscriberNotifications_1 = require("../api/subscriptions/SubscriberNotifications");
|
|
25
|
+
const envLine_1 = __importDefault(require("@ludo.ninja/ui/build/components/envLine"));
|
|
25
26
|
const GlobalLayout = ({ children }) => {
|
|
26
27
|
// useFetchMyExperience();
|
|
27
28
|
(0, useMultiAudio_1.default)();
|
|
28
29
|
(0, useAuthVerification_1.useAuthVerification)();
|
|
29
30
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
30
|
-
const envValue = NEXT_PUBLIC_ENV_VALUE !==
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(profileDataInitialization_1.ProfileDataInitialization, {}), (0, jsx_runtime_1.jsx)(envLine_1.default, { isNeedToShow: envValue }), (0, jsx_runtime_1.jsx)(globalStyles_1.default, {}), children, (0, jsx_runtime_1.jsx)(CreatorNotifications_1.CreatorNotifications, {}), (0, jsx_runtime_1.jsx)(screen_1.InitializeAppHeight, {}), (0, jsx_runtime_1.jsx)(SubscriberNotifications_1.SubscriberNotification, {}), (0, jsx_runtime_1.jsx)(Overlay_1.default, {}), (0, jsx_runtime_1.jsx)(initializer_1.SidebarInitializer, {}), (0, jsx_runtime_1.jsx)(Alert_1.default, {}), (0, jsx_runtime_1.jsx)(Modal_1.default, {}), (0, jsx_runtime_1.jsx)(ModalSidebar_1.default, {}), (0, jsx_runtime_1.jsx)(CreatorModalSidebarPortal_1.CreatorModalSidebarPortal, {}), (0, jsx_runtime_1.jsx)(sessionScroll_1.DeleteScrollStateInterceptor, {})] }));
|
|
31
|
+
const envValue = NEXT_PUBLIC_ENV_VALUE !== "prod" ? NEXT_PUBLIC_ENV_VALUE : "";
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(profileDataInitialization_1.ProfileDataInitialization, {}), (0, jsx_runtime_1.jsx)(markerButton_1.default, {}), (0, jsx_runtime_1.jsx)(envLine_1.default, { isNeedToShow: envValue }), (0, jsx_runtime_1.jsx)(globalStyles_1.default, {}), children, (0, jsx_runtime_1.jsx)(CreatorNotifications_1.CreatorNotifications, {}), (0, jsx_runtime_1.jsx)(screen_1.InitializeAppHeight, {}), (0, jsx_runtime_1.jsx)(SubscriberNotifications_1.SubscriberNotification, {}), (0, jsx_runtime_1.jsx)(Overlay_1.default, {}), (0, jsx_runtime_1.jsx)(initializer_1.SidebarInitializer, {}), (0, jsx_runtime_1.jsx)(Alert_1.default, {}), (0, jsx_runtime_1.jsx)(Modal_1.default, {}), (0, jsx_runtime_1.jsx)(ModalSidebar_1.default, {}), (0, jsx_runtime_1.jsx)(CreatorModalSidebarPortal_1.CreatorModalSidebarPortal, {}), (0, jsx_runtime_1.jsx)(sessionScroll_1.DeleteScrollStateInterceptor, {})] }));
|
|
32
33
|
};
|
|
33
34
|
exports.GlobalLayout = GlobalLayout;
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type FollowStatus = {
|
|
2
|
-
following: boolean;
|
|
3
|
-
};
|
|
4
|
-
export declare function useCheckDiscordFollow(discordUserId: string | undefined | null, guildId?: string): {
|
|
5
|
-
followDiscordStatus: FollowStatus | null;
|
|
6
|
-
followDiscordStatusLoading: boolean;
|
|
7
|
-
followDiscordStatusError: string | null;
|
|
8
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useCheckDiscordFollow = useCheckDiscordFollow;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const PUBLIC_BOT_TOKEN = 'MTQyNTUxNzk0NzkyNDkwNTk5Ng.GxKVUP.DlgMRxCmLVlCzmCnIm6dBgEw5g8CtciSCCpnNI';
|
|
6
|
-
function useCheckDiscordFollow(discordUserId, guildId = '854266585862504459') {
|
|
7
|
-
const [status, setStatus] = (0, react_1.useState)(null);
|
|
8
|
-
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
9
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
10
|
-
(0, react_1.useEffect)(() => {
|
|
11
|
-
if (!discordUserId)
|
|
12
|
-
return;
|
|
13
|
-
async function checkFollow() {
|
|
14
|
-
setLoading(true);
|
|
15
|
-
setError(null);
|
|
16
|
-
try {
|
|
17
|
-
const urlGetUserDiscordId = `https://discord.com/api/guilds/${guildId}/members/${discordUserId}`;
|
|
18
|
-
const followRes = await fetch(urlGetUserDiscordId, {
|
|
19
|
-
headers: {
|
|
20
|
-
Authorization: `Bot ${PUBLIC_BOT_TOKEN}`,
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
const followData = await followRes.json();
|
|
24
|
-
setStatus({
|
|
25
|
-
following: followData?.user?.id || false,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
setError(err.message || 'Error discord check follow');
|
|
30
|
-
setStatus({ following: false });
|
|
31
|
-
}
|
|
32
|
-
finally {
|
|
33
|
-
setLoading(false);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// checkFollow();
|
|
37
|
-
}, [discordUserId, guildId]);
|
|
38
|
-
return {
|
|
39
|
-
followDiscordStatus: status,
|
|
40
|
-
followDiscordStatusLoading: loading,
|
|
41
|
-
followDiscordStatusError: error,
|
|
42
|
-
};
|
|
43
|
-
}
|