@ludo.ninja/components 2.4.49 → 2.4.50
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.
|
@@ -7,9 +7,9 @@ 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/server-identities/queries/useCheckDiscordFollow");
|
|
11
10
|
const useSetEducatorBoost_1 = __importDefault(require("../../api/server-identities/mutations/useSetEducatorBoost"));
|
|
12
11
|
const useSetShootingStarBoost_1 = __importDefault(require("../../api/server-identities/mutations/useSetShootingStarBoost"));
|
|
12
|
+
const useCheckDiscordFollow_1 = require("../../api/server-identities/queries/useCheckDiscordFollow");
|
|
13
13
|
const useFetchProfile_1 = require("../../api/server-identities/queries/useFetchProfile");
|
|
14
14
|
const useCheckFollow_1 = require("../../api/twitter/useCheckFollow");
|
|
15
15
|
const ArrowIcon_1 = __importDefault(require("./icons/ArrowIcon"));
|
|
@@ -122,22 +122,10 @@ const LudoEducatorModal = ({ userId, onBoostAdded, boostType, className, style }
|
|
|
122
122
|
const openModalSidebarPortal = (0, ui_1.useUiStore)((state) => state.openModalSidebarPortal);
|
|
123
123
|
const closeModalSidebarPortal = (0, ui_1.useUiStore)((state) => state.closeModalSidebarPortal);
|
|
124
124
|
const handleBecomeLudoEducator = () => {
|
|
125
|
-
setEducatorBoost()
|
|
126
|
-
if (!isSetEducatorBoost)
|
|
127
|
-
return;
|
|
128
|
-
onBoostAdded && onBoostAdded();
|
|
129
|
-
closeModalSidebarPortal();
|
|
130
|
-
openModalSidebarPortal((0, jsx_runtime_1.jsx)(Congratulations_1.default, {}));
|
|
131
|
-
});
|
|
125
|
+
setEducatorBoost();
|
|
132
126
|
};
|
|
133
127
|
const handleBecomeLudoShootingStar = () => {
|
|
134
|
-
setShootingStarBoost()
|
|
135
|
-
if (!isSetShootingStarBoost)
|
|
136
|
-
return;
|
|
137
|
-
onBoostAdded && onBoostAdded();
|
|
138
|
-
closeModalSidebarPortal();
|
|
139
|
-
openModalSidebarPortal((0, jsx_runtime_1.jsx)(Congratulations_1.default, { message: "You are now a Ludo Shooting Star! Check how you can take advantage of it." }));
|
|
140
|
-
});
|
|
128
|
+
setShootingStarBoost();
|
|
141
129
|
};
|
|
142
130
|
const handleSubmit = () => {
|
|
143
131
|
if (getSubmitButtonDisabled())
|
|
@@ -170,6 +158,20 @@ const LudoEducatorModal = ({ userId, onBoostAdded, boostType, className, style }
|
|
|
170
158
|
(0, react_1.useEffect)(() => {
|
|
171
159
|
refetch();
|
|
172
160
|
}, []);
|
|
161
|
+
(0, react_1.useEffect)(() => {
|
|
162
|
+
if (isSetEducatorBoost && !loadingSetEducatorBoost) {
|
|
163
|
+
onBoostAdded && onBoostAdded();
|
|
164
|
+
closeModalSidebarPortal();
|
|
165
|
+
openModalSidebarPortal((0, jsx_runtime_1.jsx)(Congratulations_1.default, {}));
|
|
166
|
+
}
|
|
167
|
+
}, [isSetEducatorBoost, loadingSetEducatorBoost]);
|
|
168
|
+
(0, react_1.useEffect)(() => {
|
|
169
|
+
if (isSetShootingStarBoost && !loadingSetShootingStarBoost) {
|
|
170
|
+
onBoostAdded && onBoostAdded();
|
|
171
|
+
closeModalSidebarPortal();
|
|
172
|
+
openModalSidebarPortal((0, jsx_runtime_1.jsx)(Congratulations_1.default, { message: "You are now a Ludo Shooting Star! Check how you can take advantage of it." }));
|
|
173
|
+
}
|
|
174
|
+
}, [isSetShootingStarBoost, loadingSetShootingStarBoost]);
|
|
173
175
|
return ((0, jsx_runtime_1.jsxs)(exports.Wrapper, { className: className, style: style, children: [(0, jsx_runtime_1.jsx)(ui_2.H3, { children: "Join Ludo Educators" }), (0, jsx_runtime_1.jsxs)(CheckList, { children: [clientProfileLoading ? ((0, jsx_runtime_1.jsx)(StyledSkeleton, {})) : ((0, jsx_runtime_1.jsx)(CheckListItem_1.default, { isDone: !!social?.twitter, title: social?.twitter ? ("Connect Twitter") : ((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 Twitter" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] })) })), clientProfileLoading ? ((0, jsx_runtime_1.jsx)(StyledSkeleton, {})) : ((0, jsx_runtime_1.jsx)(CheckListItem_1.default, { isDone: !!social?.telegramLink, title: social?.telegramLink ? ("Connect Telegram") : ((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 Telegram" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] })) })), followStatusLoading || clientProfileLoading ? ((0, jsx_runtime_1.jsx)(StyledSkeleton, {})) : ((0, jsx_runtime_1.jsx)(CheckListItem_1.default, { isDone: Boolean(followStatus?.following), title: (0, jsx_runtime_1.jsx)(rc_tooltip_1.default, { placement: "top", trigger: ["hover", "click", "focus"], showArrow: false, styles: {
|
|
174
176
|
root: {
|
|
175
177
|
backgroundColor: "#ffffff",
|