@ludo.ninja/components 2.4.9 → 2.4.11
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.d.ts +8 -0
- package/build/api/discord/useCheckDiscordFollow.js +43 -0
- package/build/api/server-identities/mutations/useSetEducatorBoost/index.d.ts +7 -0
- package/build/api/server-identities/mutations/useSetEducatorBoost/index.js +39 -0
- package/build/api/server-identities/mutations/useSetShootingStarBoost/index.d.ts +7 -0
- package/build/api/server-identities/mutations/useSetShootingStarBoost/index.js +39 -0
- package/build/api/twitter/useCheckFollow.d.ts +8 -0
- package/build/api/twitter/useCheckFollow.js +56 -0
- package/build/components/ludoEducatorModal/CheckListItem.d.ts +8 -0
- package/build/components/ludoEducatorModal/CheckListItem.js +18 -0
- package/build/components/ludoEducatorModal/Congratulations.d.ts +4 -0
- package/build/components/ludoEducatorModal/Congratulations.js +87 -0
- package/build/components/ludoEducatorModal/confetti/index.d.ts +2 -0
- package/build/components/ludoEducatorModal/confetti/index.js +43 -0
- package/build/components/ludoEducatorModal/icons/ArrowIcon.d.ts +7 -0
- package/build/components/ludoEducatorModal/icons/ArrowIcon.js +7 -0
- package/build/components/ludoEducatorModal/icons/ConfettiIcon.d.ts +7 -0
- package/build/components/ludoEducatorModal/icons/ConfettiIcon.js +7 -0
- package/build/components/ludoEducatorModal/index.d.ts +13 -0
- package/build/components/ludoEducatorModal/index.js +175 -0
- package/build/system/Modals/ModalSidebar/CreatorModalSidebarPortal.js +3 -2
- package/build/system/Modals/ModalSidebar/ModalSidebarPortal.d.ts +3 -2
- package/build/system/Modals/ModalSidebar/ModalSidebarPortal.js +1 -1
- package/build/system/Modals/ModalSidebar/index.js +4 -2
- package/package.json +3 -1
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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.Gw3gFJ.RqMrnFGVC3yuyB13oCh2m0GDUYpeSRzfMnEXfc';
|
|
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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const useSetEducatorBoost: () => {
|
|
2
|
+
isSetEducatorBoost: boolean;
|
|
3
|
+
errorSetEducatorBoost: import("@apollo/client").ApolloError | undefined;
|
|
4
|
+
loadingSetEducatorBoost: boolean;
|
|
5
|
+
setEducatorBoost: () => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export default useSetEducatorBoost;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ui_1 = require("../../../../store/ui");
|
|
4
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
5
|
+
const api_1 = require("@ludo.ninja/api");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const useSetEducatorBoost = () => {
|
|
8
|
+
const [isSetEducatorBoost, setSetEducatorBoost] = (0, react_1.useState)(false);
|
|
9
|
+
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
10
|
+
const [mutate, { error, loading }] = api_1.identitySchema.useSetEducatorBoostMutation({
|
|
11
|
+
context: {
|
|
12
|
+
uri: api_1.hosts.identityHost,
|
|
13
|
+
},
|
|
14
|
+
fetchPolicy: "no-cache",
|
|
15
|
+
refetchQueries: [api_1.identitySchema.FetchProfileDocument],
|
|
16
|
+
onCompleted: (data) => {
|
|
17
|
+
setSetEducatorBoost(data.setEducatorBoost);
|
|
18
|
+
},
|
|
19
|
+
onError: (err) => {
|
|
20
|
+
setSetEducatorBoost(false);
|
|
21
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
isSetEducatorBoost,
|
|
26
|
+
errorSetEducatorBoost: error,
|
|
27
|
+
loadingSetEducatorBoost: loading,
|
|
28
|
+
setEducatorBoost,
|
|
29
|
+
};
|
|
30
|
+
async function setEducatorBoost() {
|
|
31
|
+
try {
|
|
32
|
+
await mutate();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
throw new Error(err);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.default = useSetEducatorBoost;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const useSetShootingStarBoost: () => {
|
|
2
|
+
isSetShootingStarBoost: boolean;
|
|
3
|
+
errorSetShootingStarBoost: import("@apollo/client").ApolloError | undefined;
|
|
4
|
+
loadingSetShootingStarBoost: boolean;
|
|
5
|
+
setShootingStarBoost: () => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export default useSetShootingStarBoost;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const ui_1 = require("../../../../store/ui");
|
|
4
|
+
const getErrorAlertProps_1 = require("../../../../utils/getErrorAlertProps");
|
|
5
|
+
const api_1 = require("@ludo.ninja/api");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const useSetShootingStarBoost = () => {
|
|
8
|
+
const [isSetShootingStarBoost, setSetShootingStarBoost] = (0, react_1.useState)(false);
|
|
9
|
+
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
10
|
+
const [mutate, { error, loading }] = api_1.identitySchema.useSetEducatorBoostMutation({
|
|
11
|
+
context: {
|
|
12
|
+
uri: api_1.hosts.identityHost,
|
|
13
|
+
},
|
|
14
|
+
fetchPolicy: "no-cache",
|
|
15
|
+
refetchQueries: [api_1.identitySchema.FetchProfileDocument],
|
|
16
|
+
onCompleted: (data) => {
|
|
17
|
+
setSetShootingStarBoost(data.setEducatorBoost);
|
|
18
|
+
},
|
|
19
|
+
onError: (err) => {
|
|
20
|
+
setSetShootingStarBoost(false);
|
|
21
|
+
openAlert((0, getErrorAlertProps_1.getErrorAlertProps)(err));
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
isSetShootingStarBoost,
|
|
26
|
+
errorSetShootingStarBoost: error,
|
|
27
|
+
loadingSetShootingStarBoost: loading,
|
|
28
|
+
setShootingStarBoost,
|
|
29
|
+
};
|
|
30
|
+
async function setShootingStarBoost() {
|
|
31
|
+
try {
|
|
32
|
+
await mutate();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
throw new Error(err);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.default = useSetShootingStarBoost;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCheckFollow = useCheckFollow;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const PUBLIC_RAPIDAPI_KEY = '008878bf3fmsh433e12023d252b1p1a9c62jsn174299b26b6a';
|
|
6
|
+
function useCheckFollow(twitterUserName, targetId = '1566713352138760197') {
|
|
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 (!twitterUserName)
|
|
12
|
+
return;
|
|
13
|
+
async function checkFollow() {
|
|
14
|
+
setLoading(true);
|
|
15
|
+
setError(null);
|
|
16
|
+
try {
|
|
17
|
+
const urlGetUserTwitterId = `https://twitter-api47.p.rapidapi.com/v2/user/by-username?username=${twitterUserName}`;
|
|
18
|
+
const userRes = await fetch(urlGetUserTwitterId, {
|
|
19
|
+
headers: {
|
|
20
|
+
'x-rapidapi-host': 'twitter-api47.p.rapidapi.com',
|
|
21
|
+
'x-rapidapi-key': PUBLIC_RAPIDAPI_KEY,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
const userData = await userRes.json();
|
|
25
|
+
const twitterUserId = userData?.rest_id;
|
|
26
|
+
if (!twitterUserId) {
|
|
27
|
+
throw new Error('Error loading twitter user ID');
|
|
28
|
+
}
|
|
29
|
+
const urlCheckFollow = `https://twitter-api47.p.rapidapi.com/v2/user/friendship?subjectId=${twitterUserId}&targetId=${targetId}`;
|
|
30
|
+
const followRes = await fetch(urlCheckFollow, {
|
|
31
|
+
headers: {
|
|
32
|
+
'x-rapidapi-host': 'twitter-api47.p.rapidapi.com',
|
|
33
|
+
'x-rapidapi-key': PUBLIC_RAPIDAPI_KEY
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const followData = await followRes.json();
|
|
37
|
+
setStatus({
|
|
38
|
+
following: followData?.relationship?.source?.following || false,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
setError(err.message || 'Error twitter check follow');
|
|
43
|
+
setStatus(null);
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setLoading(false);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
checkFollow();
|
|
50
|
+
}, [twitterUserName, targetId]);
|
|
51
|
+
return {
|
|
52
|
+
followStatus: status,
|
|
53
|
+
followStatusLoading: loading,
|
|
54
|
+
followStatusError: error,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const index_1 = require("../../system/index");
|
|
9
|
+
const Wrapper = styled_components_1.default.div `
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
align-items: center;
|
|
13
|
+
`;
|
|
14
|
+
const CheckListItem = ({ title, isDone, withoutIcon }) => {
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, { children: [!withoutIcon &&
|
|
16
|
+
(isDone ? ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "10", cy: "10", r: "8", fill: "#6048FF" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.7906 7.2286C14.0698 7.53339 14.0698 8.02757 13.7906 8.33236L9.72351 12.7714C9.44426 13.0762 8.99149 13.0762 8.71224 12.7714L6.20944 10.0397C5.93019 9.73489 5.93019 9.24072 6.20944 8.93592C6.4887 8.63112 6.94146 8.63112 7.22071 8.93592L9.21788 11.1158L12.7793 7.2286C13.0585 6.9238 13.5113 6.9238 13.7906 7.2286Z", fill: "white" })] })) : ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "10", cy: "10", r: "8", fill: "#F94C66" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.92584 6.92063C7.23688 6.58312 7.75169 6.57217 8.0757 6.89617L10.0035 8.82388L11.9314 6.896C12.2555 6.572 12.7703 6.58296 13.0813 6.92047C13.3923 7.25798 13.3818 7.79424 13.0578 8.11824L11.1778 9.99818L13.0578 11.8783C13.3818 12.2023 13.3923 12.7386 13.0813 13.0761C12.7702 13.4136 12.2554 13.4245 11.9314 13.1005L10.0035 11.1725L8.07574 13.1005C7.75176 13.4245 7.23695 13.4136 6.92589 13.0761C6.61483 12.7386 6.6253 12.2024 6.94928 11.8783L8.82919 9.9982L6.94933 8.11839C6.62532 7.7944 6.6148 7.25814 6.92584 6.92063Z", fill: "white" })] }))), (0, jsx_runtime_1.jsx)(index_1.H6, { children: title })] }));
|
|
17
|
+
};
|
|
18
|
+
exports.default = CheckListItem;
|
|
@@ -0,0 +1,87 @@
|
|
|
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 confetti_1 = __importDefault(require("./confetti"));
|
|
8
|
+
const index_1 = require("./index");
|
|
9
|
+
const store_1 = require("../../modules/user/store");
|
|
10
|
+
const env_1 = require("../../store/env");
|
|
11
|
+
const ScreenWidth_1 = require("../../styles/ScreenWidth");
|
|
12
|
+
const colors_1 = require("../../styles/colors");
|
|
13
|
+
const MainButton_1 = __importDefault(require("../../system/Buttons/MainButton"));
|
|
14
|
+
const index_2 = require("../../system/index");
|
|
15
|
+
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
16
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
17
|
+
const router_1 = require("next/router");
|
|
18
|
+
const react_1 = require("react");
|
|
19
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
20
|
+
const ConfettiIcon_1 = __importDefault(require("./icons/ConfettiIcon"));
|
|
21
|
+
const ArrowIcon_1 = __importDefault(require("./icons/ArrowIcon"));
|
|
22
|
+
const Title = styled_components_1.default.div `
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 8px;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
|
|
28
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
29
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(8)};
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const Description = (0, styled_components_1.default)(index_2.H6) `
|
|
33
|
+
padding: 17px 0 36px;
|
|
34
|
+
|
|
35
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
36
|
+
padding: ${(0, _4k_1.adaptiveValueCalc)(17)} 0 ${(0, _4k_1.adaptiveValueCalc)(36)};
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
const StyledButton = (0, styled_components_1.default)(MainButton_1.default) `
|
|
40
|
+
width: 100%;
|
|
41
|
+
background: rgba(234, 237, 252, 0.5);
|
|
42
|
+
border: 1px solid #eaedfc;
|
|
43
|
+
|
|
44
|
+
> div {
|
|
45
|
+
justify-content: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
background: rgba(234, 237, 252, 0.5);
|
|
50
|
+
border: 1px solid #eaedfc;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
const ButtonText = styled_components_1.default.div `
|
|
54
|
+
display: flex;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
align-items: center;
|
|
57
|
+
color: ${colors_1.AccentColor};
|
|
58
|
+
|
|
59
|
+
svg {
|
|
60
|
+
path {
|
|
61
|
+
stroke: ${colors_1.AccentColor};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
const ModalBackground = styled_components_1.default.div `
|
|
66
|
+
position: absolute;
|
|
67
|
+
inset: 0;
|
|
68
|
+
border-radius: 8px;
|
|
69
|
+
background: linear-gradient(128deg, #86f48f 10.96%, #84c1f3 89.56%);
|
|
70
|
+
z-index: -1;
|
|
71
|
+
`;
|
|
72
|
+
const Congratulations = ({ message = "You are now a Ludo Educator! Check how you can take advantage of it and start earning with our platform.", }) => {
|
|
73
|
+
(0, react_1.useEffect)(() => {
|
|
74
|
+
(0, confetti_1.default)();
|
|
75
|
+
}, []);
|
|
76
|
+
const router = (0, router_1.useRouter)();
|
|
77
|
+
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
78
|
+
const { user } = (0, store_1.useUserStore)((state) => ({
|
|
79
|
+
user: state.user,
|
|
80
|
+
}));
|
|
81
|
+
const userId = user?.userId || "";
|
|
82
|
+
const handleRedirectToRewards = () => {
|
|
83
|
+
router.push(`${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/rewards/${userId}`);
|
|
84
|
+
};
|
|
85
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(index_1.Wrapper, { children: [(0, jsx_runtime_1.jsxs)(Title, { children: [(0, jsx_runtime_1.jsx)(ConfettiIcon_1.default, {}), (0, jsx_runtime_1.jsx)(index_2.H3, { children: "Congratulations!" })] }), (0, jsx_runtime_1.jsx)(Description, { children: message }), (0, jsx_runtime_1.jsx)(StyledButton, { variant: "outline", onClick: handleRedirectToRewards, text: (0, jsx_runtime_1.jsxs)(ButtonText, { children: [(0, jsx_runtime_1.jsx)(index_2.H5, { children: "Explore Benefits" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] }) })] }), (0, jsx_runtime_1.jsx)(ModalBackground, {})] }));
|
|
86
|
+
};
|
|
87
|
+
exports.default = Congratulations;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 canvas_confetti_1 = __importDefault(require("canvas-confetti"));
|
|
7
|
+
const count = 400;
|
|
8
|
+
const defaults = {
|
|
9
|
+
origin: { y: 0.5 },
|
|
10
|
+
};
|
|
11
|
+
function fire(particleRatio, opts) {
|
|
12
|
+
(0, canvas_confetti_1.default)({
|
|
13
|
+
...defaults,
|
|
14
|
+
...opts,
|
|
15
|
+
zIndex: 9999,
|
|
16
|
+
particleCount: Math.floor(count * particleRatio),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const claimConfetti = () => {
|
|
20
|
+
fire(0.25, {
|
|
21
|
+
spread: 26,
|
|
22
|
+
startVelocity: 75,
|
|
23
|
+
});
|
|
24
|
+
fire(0.2, {
|
|
25
|
+
spread: 60,
|
|
26
|
+
});
|
|
27
|
+
fire(0.35, {
|
|
28
|
+
spread: 100,
|
|
29
|
+
decay: 0.91,
|
|
30
|
+
scalar: 0.8,
|
|
31
|
+
});
|
|
32
|
+
fire(0.1, {
|
|
33
|
+
spread: 120,
|
|
34
|
+
startVelocity: 45,
|
|
35
|
+
decay: 0.92,
|
|
36
|
+
scalar: 1.2,
|
|
37
|
+
});
|
|
38
|
+
fire(0.1, {
|
|
39
|
+
spread: 120,
|
|
40
|
+
startVelocity: 65,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.default = claimConfetti;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ArrowIcon = ({ style, className }) => {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("svg", { className: className, style: style, xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { d: "M8.33301 6.66671L11.6663 10L8.33301 13.3334", stroke: "#CFD5EA", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
6
|
+
};
|
|
7
|
+
exports.default = ArrowIcon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ConfettiIcon = ({ style, className }) => {
|
|
5
|
+
return ((0, jsx_runtime_1.jsxs)("svg", { className: className, style: style, width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.5332 17.1192L4.12262 18.7086C4.23152 18.8177 4.37712 18.8823 4.53104 18.8898C4.68497 18.8973 4.83618 18.8473 4.9552 18.7494C6.6611 17.3391 8.04472 17.0983 10.4521 17.0456L8.7697 15.3632C8.50184 15.0952 8.14328 14.9374 7.76476 14.9208C6.17273 14.8529 3.95861 16.037 2.5332 17.1192Z", fill: "#F21666" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.06194 22.6485L7.06065 21.6477C6.9396 21.5263 6.86864 21.3639 6.86186 21.1926C6.85509 21.0213 6.913 20.8537 7.02409 20.7232C8.81303 18.6146 10.0457 16.6402 8.68454 15.2791L10.6824 17.2769C11.7631 18.3576 10.2949 20.9332 9.093 22.5712C9.03503 22.6506 8.9605 22.7165 8.87458 22.7642C8.78865 22.812 8.69337 22.8406 8.59532 22.8479C8.49727 22.8553 8.3988 22.8413 8.30671 22.8068C8.21461 22.7724 8.1311 22.7183 8.06194 22.6485Z", fill: "#FF78A0" }), (0, jsx_runtime_1.jsx)("path", { d: "M4.12154 18.7074L2.12367 16.7106C0.836149 15.4231 2.43706 12.8021 3.69846 11.3307C3.75945 11.2592 3.83463 11.2011 3.91922 11.1601C4.00382 11.1192 4.096 11.0962 4.18992 11.0928C4.28384 11.0893 4.37747 11.1053 4.46487 11.1399C4.55227 11.1745 4.63154 11.2268 4.69766 11.2936L5.75379 12.3476C5.87286 12.467 5.94355 12.6262 5.95223 12.7946C5.96091 12.963 5.90697 13.1286 5.8008 13.2596C4.15602 15.3003 2.98027 17.5656 4.12154 18.7074Z", fill: "#FF78A0" }), (0, jsx_runtime_1.jsx)("path", { d: "M11.7695 8.21411V10.4601C11.769 10.6143 11.826 10.7631 11.9294 10.8776C12.0327 10.992 12.175 11.0638 12.3284 11.079C14.5316 11.288 15.6807 12.096 17.42 13.7611V11.383C17.42 11.0042 17.2779 10.6391 17.022 10.3598C15.9455 9.1851 13.5428 8.45803 11.7695 8.21411Z", fill: "#81349A" }), (0, jsx_runtime_1.jsx)("path", { d: "M11.7695 16.0315V14.6161C11.7699 14.4449 11.8345 14.2801 11.9506 14.1544C12.0667 14.0286 12.2257 13.9511 12.3963 13.937C15.1521 13.7109 17.42 13.187 17.42 11.2617V14.0875C17.42 15.6153 14.5598 16.3987 12.552 16.7069C12.4549 16.7214 12.3559 16.7148 12.2616 16.6875C12.1673 16.6602 12.0801 16.6129 12.0058 16.5488C11.9315 16.4846 11.8719 16.4052 11.8311 16.316C11.7904 16.2267 11.7694 16.1297 11.7695 16.0315Z", fill: "#BF45E5" }), (0, jsx_runtime_1.jsx)("path", { d: "M11.7695 10.4607V7.63493C11.7695 5.81413 14.7551 5.09228 16.6887 4.94342C16.7822 4.93621 16.8761 4.94843 16.9647 4.97931C17.0532 5.01019 17.1343 5.05906 17.203 5.12284C17.2717 5.18663 17.3264 5.26395 17.3638 5.34993C17.4011 5.43591 17.4203 5.52869 17.42 5.62243V7.11627C17.4199 7.285 17.3573 7.44773 17.2444 7.5731C17.1315 7.69847 16.9762 7.77761 16.8084 7.79529C14.2015 8.07734 11.7695 8.84567 11.7695 10.4607Z", fill: "#BF45E5" }), (0, jsx_runtime_1.jsx)("path", { d: "M20.3257 14.939L18.7363 16.5284C18.6273 16.6373 18.5628 16.7828 18.5554 16.9366C18.548 17.0905 18.5981 17.2416 18.696 17.3604C20.1063 19.0663 20.3471 20.45 20.3993 22.8573L22.0817 21.1749C22.3498 20.9074 22.5077 20.5489 22.5241 20.1705C22.592 18.5785 21.4079 16.3644 20.3257 14.939Z", fill: "#FF8506" }), (0, jsx_runtime_1.jsx)("path", { d: "M14.7951 20.4682L15.7959 19.4674C15.9173 19.3464 16.0799 19.2754 16.2513 19.2686C16.4226 19.2618 16.5903 19.3198 16.7209 19.4309C18.829 21.2193 20.8034 22.4525 22.1645 21.0913L20.1667 23.0892C19.086 24.1694 16.5104 22.7016 14.8724 21.4993C14.793 21.4413 14.7271 21.3668 14.6793 21.2808C14.6316 21.1949 14.603 21.0996 14.5957 21.0016C14.5883 20.9035 14.6023 20.8051 14.6368 20.713C14.6712 20.6209 14.7252 20.5374 14.7951 20.4682Z", fill: "#FFB62E" }), (0, jsx_runtime_1.jsx)("path", { d: "M18.7363 16.5273L20.7347 14.5294C22.0222 13.2419 24.6432 14.8428 26.1146 16.1042C26.1861 16.1652 26.2442 16.2404 26.2852 16.325C26.3261 16.4096 26.3491 16.5018 26.3526 16.5957C26.356 16.6896 26.34 16.7832 26.3054 16.8706C26.2708 16.958 26.2185 17.0373 26.1517 17.1034L25.0956 18.1596C24.9761 18.2787 24.8168 18.3494 24.6483 18.358C24.4799 18.3667 24.3141 18.3128 24.1831 18.2066C22.1413 16.5618 19.8781 15.3855 18.7363 16.5273Z", fill: "#FFB62E" }), (0, jsx_runtime_1.jsx)("path", { d: "M21.4626 9.72198C20.7894 9.90218 20.4943 10.1973 20.3135 10.8711C20.3014 10.9177 20.2741 10.959 20.2359 10.9885C20.1978 11.0179 20.151 11.0339 20.1028 11.0339C20.0546 11.0339 20.0077 11.0179 19.9696 10.9885C19.9315 10.959 19.9042 10.9177 19.892 10.8711C19.7118 10.1983 19.4167 9.90322 18.7429 9.72198C18.6963 9.70981 18.655 9.68252 18.6255 9.64439C18.5961 9.60625 18.5801 9.55941 18.5801 9.51122C18.5801 9.46303 18.5961 9.41619 18.6255 9.37805C18.655 9.33992 18.6963 9.31263 18.7429 9.30046C19.4157 9.12026 19.7108 8.82515 19.892 8.15136C19.9042 8.10473 19.9315 8.06344 19.9696 8.03398C20.0077 8.00451 20.0546 7.98853 20.1028 7.98853C20.151 7.98853 20.1978 8.00451 20.2359 8.03398C20.2741 8.06344 20.3014 8.10473 20.3135 8.15136C20.4937 8.82463 20.7888 9.11974 21.4626 9.30046C21.5093 9.31263 21.5505 9.33992 21.58 9.37805C21.6095 9.41619 21.6255 9.46303 21.6255 9.51122C21.6255 9.55941 21.6095 9.60625 21.58 9.64439C21.5505 9.68252 21.5093 9.70981 21.4626 9.72198Z", fill: "#3CE594" }), (0, jsx_runtime_1.jsx)("path", { d: "M9.12668 10.0061C8.45341 10.1858 8.1583 10.4809 7.97758 11.1552C7.96522 11.2018 7.93783 11.2429 7.89967 11.2723C7.8615 11.3016 7.81471 11.3175 7.76656 11.3175C7.71841 11.3175 7.67162 11.3016 7.63345 11.2723C7.59529 11.2429 7.5679 11.2018 7.55554 11.1552C7.37586 10.482 7.08075 10.1869 6.40644 10.0061C6.3599 9.99378 6.31876 9.96639 6.28941 9.92823C6.26006 9.89007 6.24414 9.84327 6.24414 9.79512C6.24414 9.74698 6.26006 9.70018 6.28941 9.66202C6.31876 9.62385 6.3599 9.59646 6.40644 9.58411C7.07971 9.40443 7.37482 9.10932 7.55554 8.435C7.5679 8.38847 7.59529 8.34732 7.63345 8.31797C7.67162 8.28862 7.71841 8.27271 7.76656 8.27271C7.81471 8.27271 7.8615 8.28862 7.89967 8.31797C7.93783 8.34732 7.96522 8.38847 7.97758 8.435C8.15726 9.10827 8.45237 9.40338 9.12668 9.58411C9.17321 9.59646 9.21436 9.62385 9.24371 9.66202C9.27306 9.70018 9.28898 9.74698 9.28898 9.79512C9.28898 9.84327 9.27306 9.89007 9.24371 9.92823C9.21436 9.96639 9.17321 9.99378 9.12668 10.0061Z", fill: "#FF8506" }), (0, jsx_runtime_1.jsx)("path", { d: "M12.9683 20.4286C13.5398 20.4286 14.003 19.9653 14.003 19.3938C14.003 18.8224 13.5398 18.3591 12.9683 18.3591C12.3969 18.3591 11.9336 18.8224 11.9336 19.3938C11.9336 19.9653 12.3969 20.4286 12.9683 20.4286Z", fill: "#F21666" })] }));
|
|
6
|
+
};
|
|
7
|
+
exports.default = ConfettiIcon;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApolloQueryResult, OperationVariables } from "@apollo/client";
|
|
2
|
+
import { identitySchema as schema } from "@ludo.ninja/api";
|
|
3
|
+
import { IBoostType } from "@ludo.ninja/api/build/graphql_tools/__generated__/identityHost/schema";
|
|
4
|
+
import React, { FC } from "react";
|
|
5
|
+
export declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
type Props = Pick<schema.IProfile, "social"> & {
|
|
7
|
+
refetchProfile: (variables?: Partial<OperationVariables> | undefined) => Promise<ApolloQueryResult<any>>;
|
|
8
|
+
boostType: IBoostType;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
};
|
|
12
|
+
declare const LudoEducatorModal: FC<Props>;
|
|
13
|
+
export default LudoEducatorModal;
|
|
@@ -0,0 +1,175 @@
|
|
|
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.Wrapper = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const CheckListItem_1 = __importDefault(require("./CheckListItem"));
|
|
9
|
+
const Congratulations_1 = __importDefault(require("./Congratulations"));
|
|
10
|
+
const useCheckDiscordFollow_1 = require("../../api/discord/useCheckDiscordFollow");
|
|
11
|
+
const useSetEducatorBoost_1 = __importDefault(require("../../api/server-identities/mutations/useSetEducatorBoost"));
|
|
12
|
+
const useSetShootingStarBoost_1 = __importDefault(require("../../api/server-identities/mutations/useSetShootingStarBoost"));
|
|
13
|
+
const useCheckFollow_1 = require("../../api/twitter/useCheckFollow");
|
|
14
|
+
const env_1 = require("../../store/env");
|
|
15
|
+
const ui_1 = require("../../store/ui");
|
|
16
|
+
const ScreenWidth_1 = require("../../styles/ScreenWidth");
|
|
17
|
+
const colors_1 = require("../../styles/colors");
|
|
18
|
+
const MainButton_1 = __importDefault(require("../../system/Buttons/MainButton"));
|
|
19
|
+
const index_1 = require("../../system/index");
|
|
20
|
+
const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/identityHost/schema");
|
|
21
|
+
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
22
|
+
const ui_2 = require("@ludo.ninja/ui");
|
|
23
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
24
|
+
const utils_1 = require("@ludo.ninja/utils");
|
|
25
|
+
const link_1 = __importDefault(require("next/link"));
|
|
26
|
+
const rc_tooltip_1 = __importDefault(require("rc-tooltip"));
|
|
27
|
+
const react_1 = require("react");
|
|
28
|
+
const react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
|
|
29
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
30
|
+
const ArrowIcon_1 = __importDefault(require("./icons/ArrowIcon"));
|
|
31
|
+
exports.Wrapper = styled_components_1.default.div `
|
|
32
|
+
width: 272px;
|
|
33
|
+
margin-top: -18px;
|
|
34
|
+
text-align: center;
|
|
35
|
+
|
|
36
|
+
${ScreenWidth_1.mediaQuery.mobile} {
|
|
37
|
+
margin: 0 auto;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
41
|
+
width: ${(0, _4k_1.adaptiveValueCalc)(272)};
|
|
42
|
+
margin-top: ${(0, _4k_1.adaptiveValueCalc)(-18)};
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
const CheckList = styled_components_1.default.div `
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
align-items: start;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 12px;
|
|
50
|
+
padding: 24px 0 10px;
|
|
51
|
+
|
|
52
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
53
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(12)};
|
|
54
|
+
padding: ${(0, _4k_1.adaptiveValueCalc)(24)} 0 ${(0, _4k_1.adaptiveValueCalc)(10)};
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
const StyledLink = (0, styled_components_1.default)(link_1.default) `
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 8px;
|
|
60
|
+
align-items: center;
|
|
61
|
+
color: ${colors_1.BlackColor};
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
|
|
64
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
65
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(8)};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
svg {
|
|
69
|
+
path {
|
|
70
|
+
stroke: #6048ff;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
const FollowLink = styled_components_1.default.a `
|
|
75
|
+
display: flex;
|
|
76
|
+
gap: 8px;
|
|
77
|
+
align-items: center;
|
|
78
|
+
color: ${colors_1.BlackColor};
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
|
|
81
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
82
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(8)};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
svg {
|
|
86
|
+
path {
|
|
87
|
+
stroke: #6048ff;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
const StyledSkeleton = (0, styled_components_1.default)(react_loading_skeleton_1.default) `
|
|
92
|
+
height: 20px;
|
|
93
|
+
width: 154px;
|
|
94
|
+
|
|
95
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
96
|
+
height: ${(0, _4k_1.adaptiveValueCalc)(20)};
|
|
97
|
+
width: ${(0, _4k_1.adaptiveValueCalc)(154)};
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
const ActionButton = (0, styled_components_1.default)(MainButton_1.default) `
|
|
101
|
+
margin-top: 26px;
|
|
102
|
+
|
|
103
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
104
|
+
margin-top: ${(0, _4k_1.adaptiveValueCalc)(26)};
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
const LudoEducatorModal = ({ social, refetchProfile, boostType, className, style }) => {
|
|
108
|
+
const twitterUserName = social?.twitter?.split("https://x.com/")?.[1] || "";
|
|
109
|
+
const { followStatus, followStatusLoading } = (0, useCheckFollow_1.useCheckFollow)(twitterUserName);
|
|
110
|
+
const { followDiscordStatus, followDiscordStatusLoading } = (0, useCheckDiscordFollow_1.useCheckDiscordFollow)(social?.discordId);
|
|
111
|
+
const { setEducatorBoost, loadingSetEducatorBoost } = (0, useSetEducatorBoost_1.default)();
|
|
112
|
+
const { setShootingStarBoost, loadingSetShootingStarBoost } = (0, useSetShootingStarBoost_1.default)();
|
|
113
|
+
const isSocialsConnected = social?.twitter && social?.telegramLink;
|
|
114
|
+
const isCheckListDone = followStatus?.following && isSocialsConnected && social?.telegramId;
|
|
115
|
+
const isShootingStarCheckListDone = isCheckListDone && followDiscordStatus?.following && social?.discordId;
|
|
116
|
+
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
117
|
+
const openModalSidebarPortal = (0, ui_1.useUiStore)((state) => state.openModalSidebarPortal);
|
|
118
|
+
const closeModalSidebarPortal = (0, ui_1.useUiStore)((state) => state.closeModalSidebarPortal);
|
|
119
|
+
const handleBecomeLudoEducator = () => {
|
|
120
|
+
setEducatorBoost().then(() => {
|
|
121
|
+
refetchProfile && refetchProfile();
|
|
122
|
+
closeModalSidebarPortal();
|
|
123
|
+
openModalSidebarPortal((0, jsx_runtime_1.jsx)(Congratulations_1.default, {}));
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
const handleBecomeLudoShootingStar = () => {
|
|
127
|
+
setShootingStarBoost().then(() => {
|
|
128
|
+
refetchProfile && refetchProfile();
|
|
129
|
+
closeModalSidebarPortal();
|
|
130
|
+
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." }));
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const handleSubmit = () => {
|
|
134
|
+
switch (boostType) {
|
|
135
|
+
case schema_1.IBoostType.Educator:
|
|
136
|
+
handleBecomeLudoEducator();
|
|
137
|
+
return;
|
|
138
|
+
case schema_1.IBoostType.Ambassador:
|
|
139
|
+
handleBecomeLudoShootingStar();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
const getSubmitButtonLabel = () => {
|
|
144
|
+
switch (boostType) {
|
|
145
|
+
case schema_1.IBoostType.Educator:
|
|
146
|
+
return "Become Ludo Educator";
|
|
147
|
+
case schema_1.IBoostType.Ambassador:
|
|
148
|
+
return "Become Shooting Star";
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const getSubmitButtonDisabled = () => {
|
|
152
|
+
switch (boostType) {
|
|
153
|
+
case schema_1.IBoostType.Educator:
|
|
154
|
+
return !isCheckListDone || loadingSetEducatorBoost;
|
|
155
|
+
case schema_1.IBoostType.Ambassador:
|
|
156
|
+
return !isShootingStarCheckListDone || loadingSetShootingStarBoost;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
(0, react_1.useEffect)(() => {
|
|
160
|
+
refetchProfile && refetchProfile();
|
|
161
|
+
}, []);
|
|
162
|
+
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: [(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, {})] })) }), (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 ? ((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: {
|
|
163
|
+
root: {
|
|
164
|
+
backgroundColor: "#ffffff",
|
|
165
|
+
opacity: 1,
|
|
166
|
+
boxShadow: " 0px 4px 16px -2px rgba(0, 0, 0, 0.14)",
|
|
167
|
+
borderRadius: "12px",
|
|
168
|
+
},
|
|
169
|
+
body: {
|
|
170
|
+
borderRadius: "12px",
|
|
171
|
+
border: "none",
|
|
172
|
+
},
|
|
173
|
+
}, 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, {})] }) }) })), (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"), children: [(0, jsx_runtime_1.jsx)(index_1.H6, { children: "Subscribe to @LudoAppBot" }), (0, jsx_runtime_1.jsx)(ArrowIcon_1.default, {})] }) }), boostType === schema_1.IBoostType.Ambassador && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(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, {})] }) }))] }))] }), isSocialsConnected && ((0, jsx_runtime_1.jsx)(ActionButton, { className: "modal-action-btn", variant: "primaryM", text: getSubmitButtonLabel(), disabled: getSubmitButtonDisabled(), onClick: handleSubmit }))] }));
|
|
174
|
+
};
|
|
175
|
+
exports.default = LudoEducatorModal;
|
|
@@ -34,15 +34,16 @@ const ui_1 = require("../../../store/ui");
|
|
|
34
34
|
const ModalSidebarPortal = (0, dynamic_1.default)(() => Promise.resolve().then(() => __importStar(require('./ModalSidebarPortal'))).then((_) => _.ModalSidebarPortal));
|
|
35
35
|
// minimize dom tree for optimize virtualization
|
|
36
36
|
const CreatorModalSidebarPortal = () => {
|
|
37
|
-
const { isOpenModalSidebarPortal, closeModalSidebarPortal, contentModals, withoutCloseIcon } = (0, ui_1.useUiStore)((state) => ({
|
|
37
|
+
const { isOpenModalSidebarPortal, closeModalSidebarPortal, contentModals, withoutCloseIcon, stylesModals } = (0, ui_1.useUiStore)((state) => ({
|
|
38
38
|
isOpenModalSidebarPortal: state.isOpenModalSidebarPortal,
|
|
39
39
|
closeModalSidebarPortal: state.closeModalSidebarPortal,
|
|
40
40
|
contentModals: state.contentModals,
|
|
41
41
|
withoutCloseIcon: state.modalWithoutCloseIcon,
|
|
42
|
+
stylesModals: state.stylesModals,
|
|
42
43
|
}));
|
|
43
44
|
if (!isOpenModalSidebarPortal) {
|
|
44
45
|
return null;
|
|
45
46
|
}
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(ModalSidebarPortal, { closeModal: closeModalSidebarPortal, component: contentModals, withoutCloseIcon: withoutCloseIcon }));
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(ModalSidebarPortal, { closeModal: closeModalSidebarPortal, component: contentModals, withoutCloseIcon: withoutCloseIcon, style: stylesModals ?? undefined }));
|
|
47
48
|
};
|
|
48
49
|
exports.CreatorModalSidebarPortal = CreatorModalSidebarPortal;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
export declare const ModalSidebarPortal: ({ component, closeModal, withoutCloseIcon, }: {
|
|
1
|
+
import { CSSProperties, ReactNode } from "react";
|
|
2
|
+
export declare const ModalSidebarPortal: ({ component, closeModal, withoutCloseIcon, style }: {
|
|
3
3
|
component: ReactNode;
|
|
4
4
|
closeModal: () => void;
|
|
5
5
|
withoutCloseIcon?: boolean;
|
|
6
|
+
style?: CSSProperties;
|
|
6
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,5 +6,5 @@ const index_1 = require("./index");
|
|
|
6
6
|
const constants_1 = require("@ludo.ninja/core/build/constants");
|
|
7
7
|
const utils_1 = require("@ludo.ninja/utils");
|
|
8
8
|
// minimize dom tree for optimize virtualization
|
|
9
|
-
const ModalSidebarPortal = ({ component, closeModal, withoutCloseIcon, }) => ((0, jsx_runtime_1.jsx)(utils_1.PortalCreator, { children: (0, jsx_runtime_1.jsxs)(index_1.StyledModalSidebar, { withoutCloseIcon: withoutCloseIcon, children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModal }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: component })] }) }));
|
|
9
|
+
const ModalSidebarPortal = ({ component, closeModal, withoutCloseIcon, style }) => ((0, jsx_runtime_1.jsx)(utils_1.PortalCreator, { children: (0, jsx_runtime_1.jsxs)(index_1.StyledModalSidebar, { withoutCloseIcon: withoutCloseIcon, style: style, children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModal }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: component })] }) }));
|
|
10
10
|
exports.ModalSidebarPortal = ModalSidebarPortal;
|
|
@@ -70,14 +70,16 @@ exports.StyledModalSidebar = styled_components_1.default.div `
|
|
|
70
70
|
}
|
|
71
71
|
`;
|
|
72
72
|
const ModalSidebar = () => {
|
|
73
|
-
const { contentModals, isModalSidebarOpen, closeModalSidebar, withoutCloseIcon } = (0, ui_1.useUiStore)((state) => ({
|
|
73
|
+
const { contentModals, isModalSidebarOpen, closeModalSidebar, withoutCloseIcon, stylesModals } = (0, ui_1.useUiStore)((state) => ({
|
|
74
74
|
contentModals: state.contentModals,
|
|
75
75
|
isModalSidebarOpen: state.isModalSidebarOpen,
|
|
76
76
|
closeModalSidebar: state.closeModalSidebar,
|
|
77
77
|
withoutCloseIcon: state.modalWithoutCloseIcon,
|
|
78
|
+
stylesModals: state.stylesModals,
|
|
78
79
|
}));
|
|
79
80
|
if (!isModalSidebarOpen)
|
|
80
81
|
return null;
|
|
81
|
-
|
|
82
|
+
console.log({ stylesModals });
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)(exports.StyledModalSidebar, { withoutCloseIcon: withoutCloseIcon, style: stylesModals ? stylesModals : undefined, children: [(0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/modal/close.svg`, alt: "close", width: 24, height: 24, className: "modalCloseIcon", onClick: closeModalSidebar }), (0, jsx_runtime_1.jsx)("div", { className: "modalContent", children: contentModals })] }));
|
|
82
84
|
};
|
|
83
85
|
exports.default = ModalSidebar;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ludo.ninja/components",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@next/third-parties": "^15.3.4",
|
|
28
28
|
"@react-three/drei": "^9.68.3",
|
|
29
29
|
"@react-three/fiber": "^8.13.0",
|
|
30
|
+
"canvas-confetti": "^1.9.3",
|
|
30
31
|
"chart.js": "^4.4.3",
|
|
31
32
|
"framer-motion": "^10.16.16",
|
|
32
33
|
"glob": "^11.0.0",
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"@testing-library/jest-dom": "^5.16.5",
|
|
77
78
|
"@testing-library/react": "^15.0.6",
|
|
78
79
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
80
|
+
"@types/canvas-confetti": "^1.6.4",
|
|
79
81
|
"@types/chrome": "^0.0.260",
|
|
80
82
|
"@types/lodash.debounce": "^4.0.7",
|
|
81
83
|
"@types/lodash.remove": "^4.7.7",
|