@cuemath/leap 2.8.25-rj-10 → 2.8.25-rj-12
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/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js +44 -41
- package/dist/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js +6 -6
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js +7 -25
- package/dist/features/circle-games/leaderboard/comps/info-bar/info-bar.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js +6 -6
- package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js.map +1 -1
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.js +5 -0
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.js.map +1 -0
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js +41 -0
- package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.js.map +1 -0
- package/dist/features/circle-games/leaderboard/hooks/{useIntersectionObserver.js → use-intersection-observer/use-intersection-observer.tsx.js} +1 -1
- package/dist/features/circle-games/leaderboard/hooks/use-intersection-observer/use-intersection-observer.tsx.js.map +1 -0
- package/dist/features/circle-games/leaderboard/hooks/{useTimer.js → use-timer/use-timer.js} +1 -1
- package/dist/features/circle-games/leaderboard/hooks/use-timer/use-timer.js.map +1 -0
- package/dist/features/circle-games/leaderboard/leaderboard.js +77 -75
- package/dist/features/circle-games/leaderboard/leaderboard.js.map +1 -1
- package/dist/features/circle-games/utils/streak-reduction-localstorage-util.js +25 -0
- package/dist/features/circle-games/utils/streak-reduction-localstorage-util.js.map +1 -0
- package/dist/index.d.ts +19 -13
- package/dist/index.js +201 -199
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/circle-games/leaderboard/hooks/useIntersectionObserver.js.map +0 -1
- package/dist/features/circle-games/leaderboard/hooks/useTimer.js.map +0 -1
@@ -1,29 +1,32 @@
|
|
1
|
-
import { useState as d, useCallback as
|
2
|
-
import { useGetCircleHomeAPI as
|
3
|
-
import { ProjectType as
|
4
|
-
const
|
5
|
-
const [
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
1
|
+
import { useState as d, useCallback as R, useEffect as E } from "react";
|
2
|
+
import { useGetCircleHomeAPI as p } from "../../api/get-content-for-today/get-circle-home-api.js";
|
3
|
+
import { ProjectType as i } from "../../../games/web-view/enums/project-type-enum.js";
|
4
|
+
const T = (r, o) => {
|
5
|
+
const [c, m] = d(null), { data: e, get: n, isProcessed: s, ..._ } = p(), l = R(
|
6
|
+
(a) => {
|
7
|
+
n("", {
|
8
|
+
user_id: r,
|
9
|
+
country_code: a,
|
10
|
+
grade: o
|
11
|
+
});
|
12
|
+
},
|
13
|
+
[n, r, o]
|
14
|
+
);
|
15
|
+
return E(() => {
|
16
|
+
let a = null;
|
17
|
+
s && e && (a = {
|
18
|
+
points: e.points,
|
19
|
+
streakDays: e.streak_days,
|
20
|
+
streakReduction: e.streak_reduction,
|
21
|
+
streakDaysBeforeReduction: e.streak_days_before_reduction,
|
22
|
+
streakStatus: e.streak_status,
|
23
|
+
tournamentRank: e.tournament_rank,
|
21
24
|
projects: {
|
22
25
|
games: {
|
23
|
-
label:
|
24
|
-
type:
|
26
|
+
label: e.projects.games.label,
|
27
|
+
type: i.GAME,
|
25
28
|
initialProgressValue: 0,
|
26
|
-
data:
|
29
|
+
data: e.projects.games.data.map((t) => ({
|
27
30
|
id: t.id,
|
28
31
|
name: t.name,
|
29
32
|
cardLottie: t.card,
|
@@ -33,10 +36,10 @@ const O = (o, e, n) => {
|
|
33
36
|
}))
|
34
37
|
},
|
35
38
|
puzzles: {
|
36
|
-
label:
|
37
|
-
type:
|
39
|
+
label: e.projects.puzzles.label,
|
40
|
+
type: i.PUZZLE,
|
38
41
|
initialProgressValue: 0,
|
39
|
-
data:
|
42
|
+
data: e.projects.puzzles.data.map((t) => ({
|
40
43
|
id: t.id,
|
41
44
|
name: t.name,
|
42
45
|
cardLottie: t.card,
|
@@ -49,22 +52,22 @@ const O = (o, e, n) => {
|
|
49
52
|
}
|
50
53
|
},
|
51
54
|
timestamps: {
|
52
|
-
startTimestamp:
|
53
|
-
endTimestamp:
|
54
|
-
current:
|
55
|
+
startTimestamp: e.timestamps.start_timestamp,
|
56
|
+
endTimestamp: e.timestamps.end_timestamp,
|
57
|
+
current: e.timestamps.current
|
55
58
|
},
|
56
59
|
coachmarkProgress: {
|
57
|
-
CIRCLE_ACTIVITIES_INTRO_JOURNEY:
|
58
|
-
CIRCLE_LEADERBOARD_INTRO_JOURNEY:
|
59
|
-
CIRCLE_POINTS_REWARD_JOURNEY:
|
60
|
-
CIRCLE_STREAK_UPDATE_JOURNEY:
|
61
|
-
CIRCLE_TUTORIAL_JOURNEY:
|
60
|
+
CIRCLE_ACTIVITIES_INTRO_JOURNEY: e.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,
|
61
|
+
CIRCLE_LEADERBOARD_INTRO_JOURNEY: e.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,
|
62
|
+
CIRCLE_POINTS_REWARD_JOURNEY: e.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,
|
63
|
+
CIRCLE_STREAK_UPDATE_JOURNEY: e.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,
|
64
|
+
CIRCLE_TUTORIAL_JOURNEY: e.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY
|
62
65
|
}
|
63
|
-
},
|
64
|
-
label:
|
65
|
-
type:
|
66
|
+
}, e.projects.lessons && (a.projects.lessons = {
|
67
|
+
label: e.projects.lessons.label,
|
68
|
+
type: i.LESSON,
|
66
69
|
initialProgressValue: 0,
|
67
|
-
data:
|
70
|
+
data: e.projects.lessons.data.map((t) => ({
|
68
71
|
id: t.id,
|
69
72
|
name: t.name,
|
70
73
|
cardLottie: t.card,
|
@@ -75,10 +78,10 @@ const O = (o, e, n) => {
|
|
75
78
|
targetQuestions: t.target_questions,
|
76
79
|
status: t.status
|
77
80
|
}))
|
78
|
-
})),
|
79
|
-
}, [
|
81
|
+
})), m(a);
|
82
|
+
}, [e, s]), { data: c, isProcessed: s, getCircleHomeDetails: l, ..._ };
|
80
83
|
};
|
81
84
|
export {
|
82
|
-
|
85
|
+
T as useGetCircleHomeDetailsDal
|
83
86
|
};
|
84
87
|
//# sourceMappingURL=use-get-circle-home-details-dal.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails, TStreakStatus } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n
|
1
|
+
{"version":3,"file":"use-get-circle-home-details-dal.js","sources":["../../../../../../src/features/circle-games/game-launcher/dal/use-get-circle-home-details-dal/use-get-circle-home-details-dal.ts"],"sourcesContent":["import type { ICircleHomeDetails, TStreakStatus } from './use-get-circle-home-dal-types';\n\nimport { useCallback, useEffect, useState } from 'react';\n\nimport { ProjectType } from '../../../games/web-view/enums';\nimport { useGetCircleHomeAPI } from '../../api/get-content-for-today/get-circle-home-api';\n\nexport const useGetCircleHomeDetailsDal = (\n userId: string,\n grade: string,\n): Omit<ReturnType<typeof useGetCircleHomeAPI>, 'data' | 'get'> & {\n data: ICircleHomeDetails | null;\n getCircleHomeDetails: (countryCode: string) => void;\n} => {\n const [contentForToday, setContentForToday] = useState<ICircleHomeDetails | null>(null);\n const { data, get: getHomeDetails, isProcessed, ...rest } = useGetCircleHomeAPI();\n\n const getCircleHomeDetails = useCallback(\n (countryCode: string) => {\n getHomeDetails('', {\n user_id: userId,\n country_code: countryCode,\n grade: grade,\n });\n },\n [getHomeDetails, userId, grade],\n );\n\n useEffect(() => {\n let circleHomeDetails: ICircleHomeDetails | null = null;\n\n if (isProcessed && data) {\n circleHomeDetails = {\n points: data.points,\n streakDays: data.streak_days,\n streakReduction: data.streak_reduction,\n streakDaysBeforeReduction: data.streak_days_before_reduction,\n streakStatus: data.streak_status as TStreakStatus,\n tournamentRank: data.tournament_rank,\n projects: {\n games: {\n label: data.projects.games.label,\n type: ProjectType.GAME,\n initialProgressValue: 0,\n data: data.projects.games.data.map(game => ({\n id: game.id,\n name: game.name,\n cardLottie: game.card,\n tutorial: game.tutorial,\n variant: game.variant,\n isPlayed: game.played,\n })),\n },\n puzzles: {\n label: data.projects.puzzles.label,\n type: ProjectType.PUZZLE,\n initialProgressValue: 0,\n data: data.projects.puzzles.data.map(puzzle => ({\n id: puzzle.id,\n name: puzzle.name,\n cardLottie: puzzle.card,\n tutorial: puzzle.tutorial,\n variant: puzzle.variant,\n question: puzzle.question,\n isHintSeen: puzzle.is_hint_seen,\n solved: puzzle.solved,\n })),\n },\n },\n timestamps: {\n startTimestamp: data.timestamps.start_timestamp,\n endTimestamp: data.timestamps.end_timestamp,\n current: data.timestamps.current,\n },\n coachmarkProgress: {\n CIRCLE_ACTIVITIES_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_ACTIVITIES_INTRO_JOURNEY,\n CIRCLE_LEADERBOARD_INTRO_JOURNEY:\n data.coachmark_completion.CIRCLE_LEADERBOARD_INTRO_JOURNEY,\n CIRCLE_POINTS_REWARD_JOURNEY: data.coachmark_completion.CIRCLE_POINTS_REWARD_JOURNEY,\n CIRCLE_STREAK_UPDATE_JOURNEY: data.coachmark_completion.CIRCLE_STREAK_UPDATE_JOURNEY,\n CIRCLE_TUTORIAL_JOURNEY: data.coachmark_completion.CIRCLE_TUTORIAL_JOURNEY,\n },\n };\n\n if (data.projects.lessons) {\n circleHomeDetails.projects.lessons = {\n label: data.projects.lessons.label,\n type: ProjectType.LESSON,\n initialProgressValue: 0,\n data: data.projects.lessons.data.map(lesson => ({\n id: lesson.id,\n name: lesson.name,\n cardLottie: lesson.card,\n tutorial: lesson.tutorial,\n variant: lesson.variant,\n sessionId: lesson.session_id,\n miniGameIdentifier: lesson.mini_game_identifier,\n targetQuestions: lesson.target_questions,\n status: lesson.status,\n })),\n };\n }\n }\n setContentForToday(circleHomeDetails);\n }, [data, isProcessed]);\n\n return { data: contentForToday, isProcessed, getCircleHomeDetails, ...rest };\n};\n"],"names":["useGetCircleHomeDetailsDal","userId","grade","contentForToday","setContentForToday","useState","data","getHomeDetails","isProcessed","rest","useGetCircleHomeAPI","getCircleHomeDetails","useCallback","countryCode","useEffect","circleHomeDetails","ProjectType","game","puzzle","lesson"],"mappings":";;;AAOa,MAAAA,IAA6B,CACxCC,GACAC,MAIG;AACH,QAAM,CAACC,GAAiBC,CAAkB,IAAIC,EAAoC,IAAI,GAChF,EAAE,MAAAC,GAAM,KAAKC,GAAgB,aAAAC,GAAa,GAAGC,EAAA,IAASC,KAEtDC,IAAuBC;AAAA,IAC3B,CAACC,MAAwB;AACvB,MAAAN,EAAe,IAAI;AAAA,QACjB,SAASN;AAAA,QACT,cAAcY;AAAA,QACd,OAAAX;AAAA,MAAA,CACD;AAAA,IACH;AAAA,IACA,CAACK,GAAgBN,GAAQC,CAAK;AAAA,EAAA;AAGhC,SAAAY,EAAU,MAAM;AACd,QAAIC,IAA+C;AAEnD,IAAIP,KAAeF,MACGS,IAAA;AAAA,MAClB,QAAQT,EAAK;AAAA,MACb,YAAYA,EAAK;AAAA,MACjB,iBAAiBA,EAAK;AAAA,MACtB,2BAA2BA,EAAK;AAAA,MAChC,cAAcA,EAAK;AAAA,MACnB,gBAAgBA,EAAK;AAAA,MACrB,UAAU;AAAA,QACR,OAAO;AAAA,UACL,OAAOA,EAAK,SAAS,MAAM;AAAA,UAC3B,MAAMU,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMV,EAAK,SAAS,MAAM,KAAK,IAAI,CAASW,OAAA;AAAA,YAC1C,IAAIA,EAAK;AAAA,YACT,MAAMA,EAAK;AAAA,YACX,YAAYA,EAAK;AAAA,YACjB,UAAUA,EAAK;AAAA,YACf,SAASA,EAAK;AAAA,YACd,UAAUA,EAAK;AAAA,UAAA,EACf;AAAA,QACJ;AAAA,QACA,SAAS;AAAA,UACP,OAAOX,EAAK,SAAS,QAAQ;AAAA,UAC7B,MAAMU,EAAY;AAAA,UAClB,sBAAsB;AAAA,UACtB,MAAMV,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWY,OAAA;AAAA,YAC9C,IAAIA,EAAO;AAAA,YACX,MAAMA,EAAO;AAAA,YACb,YAAYA,EAAO;AAAA,YACnB,UAAUA,EAAO;AAAA,YACjB,SAASA,EAAO;AAAA,YAChB,UAAUA,EAAO;AAAA,YACjB,YAAYA,EAAO;AAAA,YACnB,QAAQA,EAAO;AAAA,UAAA,EACf;AAAA,QACJ;AAAA,MACF;AAAA,MACA,YAAY;AAAA,QACV,gBAAgBZ,EAAK,WAAW;AAAA,QAChC,cAAcA,EAAK,WAAW;AAAA,QAC9B,SAASA,EAAK,WAAW;AAAA,MAC3B;AAAA,MACA,mBAAmB;AAAA,QACjB,iCACEA,EAAK,qBAAqB;AAAA,QAC5B,kCACEA,EAAK,qBAAqB;AAAA,QAC5B,8BAA8BA,EAAK,qBAAqB;AAAA,QACxD,8BAA8BA,EAAK,qBAAqB;AAAA,QACxD,yBAAyBA,EAAK,qBAAqB;AAAA,MACrD;AAAA,IAAA,GAGEA,EAAK,SAAS,YAChBS,EAAkB,SAAS,UAAU;AAAA,MACnC,OAAOT,EAAK,SAAS,QAAQ;AAAA,MAC7B,MAAMU,EAAY;AAAA,MAClB,sBAAsB;AAAA,MACtB,MAAMV,EAAK,SAAS,QAAQ,KAAK,IAAI,CAAWa,OAAA;AAAA,QAC9C,IAAIA,EAAO;AAAA,QACX,MAAMA,EAAO;AAAA,QACb,YAAYA,EAAO;AAAA,QACnB,UAAUA,EAAO;AAAA,QACjB,SAASA,EAAO;AAAA,QAChB,WAAWA,EAAO;AAAA,QAClB,oBAAoBA,EAAO;AAAA,QAC3B,iBAAiBA,EAAO;AAAA,QACxB,QAAQA,EAAO;AAAA,MAAA,EACf;AAAA,IAAA,KAIRf,EAAmBW,CAAiB;AAAA,EAAA,GACnC,CAACT,GAAME,CAAW,CAAC,GAEf,EAAE,MAAML,GAAiB,aAAAK,GAAa,sBAAAG,GAAsB,GAAGF;AACxE;"}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
const
|
4
|
-
padding:
|
5
|
-
margin:
|
1
|
+
import r from "styled-components";
|
2
|
+
import o from "../../../../ui/layout/flex-view.js";
|
3
|
+
const d = r(o)`
|
4
|
+
padding: 16px;
|
5
|
+
margin: 16px;
|
6
6
|
border-width: 1px;
|
7
7
|
border-style: solid;
|
8
8
|
`;
|
9
9
|
export {
|
10
|
-
|
10
|
+
d as InfoBarWrapper
|
11
11
|
};
|
12
12
|
//# sourceMappingURL=info-bar-styled.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info-bar-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport
|
1
|
+
{"version":3,"file":"info-bar-styled.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../../ui/layout/flex-view';\n\nexport const InfoBarWrapper = styled(FlexView)`\n padding: 16px;\n margin: 16px;\n border-width: 1px;\n border-style: solid;\n`;\n"],"names":["InfoBarWrapper","styled","FlexView"],"mappings":";;AAIa,MAAAA,IAAiBC,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -1,29 +1,11 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { useMemo as
|
3
|
-
import { InfoBarWrapper as
|
4
|
-
const
|
5
|
-
|
6
|
-
|
7
|
-
marginX: n = 0,
|
8
|
-
marginY: t = 0,
|
9
|
-
paddingX: e = 0,
|
10
|
-
paddingY: m = 0
|
11
|
-
}) => {
|
12
|
-
const { backgroundColor: c, borderColor: p } = b(() => l(r), [r]);
|
13
|
-
return /* @__PURE__ */ a(
|
14
|
-
d,
|
15
|
-
{
|
16
|
-
$background: c,
|
17
|
-
$borderColor: p,
|
18
|
-
marginX: n,
|
19
|
-
marginY: t,
|
20
|
-
paddingX: e,
|
21
|
-
paddingY: m,
|
22
|
-
children: o
|
23
|
-
}
|
24
|
-
);
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
2
|
+
import { useMemo as m } from "react";
|
3
|
+
import { InfoBarWrapper as c } from "./info-bar-styled.js";
|
4
|
+
const p = (o) => ({ backgroundColor: `${o}_6`, borderColor: `${o}_4` }), l = ({ children: o, hue: r }) => {
|
5
|
+
const { backgroundColor: n, borderColor: t } = m(() => p(r), [r]);
|
6
|
+
return /* @__PURE__ */ e(c, { $background: n, $borderColor: t, children: o });
|
25
7
|
};
|
26
8
|
export {
|
27
|
-
|
9
|
+
l as InfoBar
|
28
10
|
};
|
29
11
|
//# sourceMappingURL=info-bar.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info-bar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({
|
1
|
+
{"version":3,"file":"info-bar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/info-bar/info-bar.tsx"],"sourcesContent":["import type { TColorNames, THueNames } from '../../../../ui/types';\nimport type { IInfoBarProps } from './info-bar-types';\n\nimport { useMemo } from 'react';\n\nimport * as Styled from './info-bar-styled';\n\nconst computeColorsFromHue = (\n hue: THueNames,\n): { backgroundColor: TColorNames; borderColor: TColorNames } => {\n return { backgroundColor: `${hue}_6`, borderColor: `${hue}_4` };\n};\n\nexport const InfoBar: React.FC<IInfoBarProps> = ({ children, hue }) => {\n const { backgroundColor, borderColor } = useMemo(() => computeColorsFromHue(hue), [hue]);\n\n return (\n <Styled.InfoBarWrapper $background={backgroundColor} $borderColor={borderColor}>\n {children}\n </Styled.InfoBarWrapper>\n );\n};\n"],"names":["computeColorsFromHue","hue","InfoBar","children","backgroundColor","borderColor","useMemo","jsx","Styled.InfoBarWrapper"],"mappings":";;;AAOA,MAAMA,IAAuB,CAC3BC,OAEO,EAAE,iBAAiB,GAAGA,CAAG,MAAM,aAAa,GAAGA,CAAG,SAG9CC,IAAmC,CAAC,EAAE,UAAAC,GAAU,KAAAF,QAAU;AAC/D,QAAA,EAAE,iBAAAG,GAAiB,aAAAC,EAAA,IAAgBC,EAAQ,MAAMN,EAAqBC,CAAG,GAAG,CAACA,CAAG,CAAC;AAGrF,SAAA,gBAAAM,EAACC,GAAA,EAAsB,aAAaJ,GAAiB,cAAcC,GAChE,UAAAF,EACH,CAAA;AAEJ;"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
2
2
|
import { memo as f } from "react";
|
3
3
|
import { ELeaderboardType as t } from "../../enums/leaderboard-type-enum.js";
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
4
|
+
import { useIntersectionObserver as u } from "../../hooks/use-intersection-observer/use-intersection-observer.tsx.js";
|
5
|
+
import { PlayerProgressListItem as E } from "../progress-list-item/progress-list-item.js";
|
6
|
+
import { AnimatedItem as I } from "./leaderboard-item-styled.js";
|
7
7
|
const h = f(
|
8
8
|
({ player: e, rank: o, maxStreakDays: m, maxPoints: i, leaderboardType: r, isActive: a }) => {
|
9
|
-
const { isVisible: n, elementRef: A } =
|
9
|
+
const { isVisible: n, elementRef: A } = u({
|
10
10
|
threshold: 0.5
|
11
11
|
}), L = r === t.ALL_TIME_STREAK ? m : i, d = r === t.ALL_TIME_STREAK ? e.streakDays : e.points;
|
12
|
-
return /* @__PURE__ */ s(
|
13
|
-
|
12
|
+
return /* @__PURE__ */ s(I, { isVisible: n, ref: A, children: /* @__PURE__ */ s(
|
13
|
+
E,
|
14
14
|
{
|
15
15
|
index: o,
|
16
16
|
maxValue: L,
|
package/dist/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"leaderboard-item.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.tsx"],"sourcesContent":["import type {\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from '../../dal/use-get-leaderboard-dal/use-get-leaderboard-dal-types';\nimport type { ILeaderboardItemProps } from './leaderboard-item-types';\n\nimport React, { memo } from 'react';\n\nimport { ELeaderboardType } from '../../enums/leaderboard-type-enum';\nimport { useIntersectionObserver } from '../../hooks';\nimport { PlayerProgressListItem } from '../progress-list-item/progress-list-item';\nimport * as Styled from './leaderboard-item-styled';\n\nexport const LeaderboardItemWithObserver: React.FC<ILeaderboardItemProps> = memo(\n ({ player, rank, maxStreakDays, maxPoints, leaderboardType, isActive }) => {\n const { isVisible, elementRef } = useIntersectionObserver<HTMLDivElement>({\n threshold: 0.5,\n });\n\n const maxValue =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? maxStreakDays : maxPoints;\n\n const value =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK\n ? (player as ILeaderboardPlayerWithStreak).streakDays\n : (player as ILeaderboardPlayerWithPoints).points;\n\n return (\n <Styled.AnimatedItem key={player.rank} isVisible={isVisible} ref={elementRef}>\n <PlayerProgressListItem\n index={rank}\n maxValue={maxValue}\n value={value}\n isActive={isActive}\n avatar={player.userAvatar}\n grade={player.grade}\n displayText={player.username}\n displayValueAs={\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? 'streak' : 'points'\n }\n />\n </Styled.AnimatedItem>\n );\n },\n);\n"],"names":["LeaderboardItemWithObserver","memo","player","rank","maxStreakDays","maxPoints","leaderboardType","isActive","isVisible","elementRef","useIntersectionObserver","maxValue","ELeaderboardType","value","Styled.AnimatedItem","jsx","PlayerProgressListItem"],"mappings":";;;;;;AAaO,MAAMA,IAA+DC;AAAA,EAC1E,CAAC,EAAE,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,GAAe,WAAAC,GAAW,iBAAAC,GAAiB,UAAAC,QAAe;AACzE,UAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAwC;AAAA,MACxE,WAAW;AAAA,IAAA,CACZ,GAEKC,IACJL,MAAoBM,EAAiB,kBAAkBR,IAAgBC,GAEnEQ,IACJP,MAAoBM,EAAiB,kBAChCV,EAAwC,aACxCA,EAAwC;AAE/C,6BACGY,GAAA,EAAsC,WAAAN,GAAsB,KAAKC,GAChE,UAAA,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAOb;AAAA,QACP,UAAAQ;AAAA,QACA,OAAAE;AAAA,QACA,UAAAN;AAAA,QACA,QAAQL,EAAO;AAAA,QACf,OAAOA,EAAO;AAAA,QACd,aAAaA,EAAO;AAAA,QACpB,gBACEI,MAAoBM,EAAiB,kBAAkB,WAAW;AAAA,MAAA;AAAA,IAAA,KAV9CV,EAAO,IAajC;AAAA,EAEJ;AACF;"}
|
1
|
+
{"version":3,"file":"leaderboard-item.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/leaderboard-item/leaderboard-item.tsx"],"sourcesContent":["import type {\n ILeaderboardPlayerWithPoints,\n ILeaderboardPlayerWithStreak,\n} from '../../dal/use-get-leaderboard-dal/use-get-leaderboard-dal-types';\nimport type { ILeaderboardItemProps } from './leaderboard-item-types';\n\nimport React, { memo } from 'react';\n\nimport { ELeaderboardType } from '../../enums/leaderboard-type-enum';\nimport { useIntersectionObserver } from '../../hooks/use-intersection-observer/use-intersection-observer.tsx';\nimport { PlayerProgressListItem } from '../progress-list-item/progress-list-item';\nimport * as Styled from './leaderboard-item-styled';\n\nexport const LeaderboardItemWithObserver: React.FC<ILeaderboardItemProps> = memo(\n ({ player, rank, maxStreakDays, maxPoints, leaderboardType, isActive }) => {\n const { isVisible, elementRef } = useIntersectionObserver<HTMLDivElement>({\n threshold: 0.5,\n });\n\n const maxValue =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? maxStreakDays : maxPoints;\n\n const value =\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK\n ? (player as ILeaderboardPlayerWithStreak).streakDays\n : (player as ILeaderboardPlayerWithPoints).points;\n\n return (\n <Styled.AnimatedItem key={player.rank} isVisible={isVisible} ref={elementRef}>\n <PlayerProgressListItem\n index={rank}\n maxValue={maxValue}\n value={value}\n isActive={isActive}\n avatar={player.userAvatar}\n grade={player.grade}\n displayText={player.username}\n displayValueAs={\n leaderboardType === ELeaderboardType.ALL_TIME_STREAK ? 'streak' : 'points'\n }\n />\n </Styled.AnimatedItem>\n );\n },\n);\n"],"names":["LeaderboardItemWithObserver","memo","player","rank","maxStreakDays","maxPoints","leaderboardType","isActive","isVisible","elementRef","useIntersectionObserver","maxValue","ELeaderboardType","value","Styled.AnimatedItem","jsx","PlayerProgressListItem"],"mappings":";;;;;;AAaO,MAAMA,IAA+DC;AAAA,EAC1E,CAAC,EAAE,QAAAC,GAAQ,MAAAC,GAAM,eAAAC,GAAe,WAAAC,GAAW,iBAAAC,GAAiB,UAAAC,QAAe;AACzE,UAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAwC;AAAA,MACxE,WAAW;AAAA,IAAA,CACZ,GAEKC,IACJL,MAAoBM,EAAiB,kBAAkBR,IAAgBC,GAEnEQ,IACJP,MAAoBM,EAAiB,kBAChCV,EAAwC,aACxCA,EAAwC;AAE/C,6BACGY,GAAA,EAAsC,WAAAN,GAAsB,KAAKC,GAChE,UAAA,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAOb;AAAA,QACP,UAAAQ;AAAA,QACA,OAAAE;AAAA,QACA,UAAAN;AAAA,QACA,QAAQL,EAAO;AAAA,QACf,OAAOA,EAAO;AAAA,QACd,aAAaA,EAAO;AAAA,QACpB,gBACEI,MAAoBM,EAAiB,kBAAkB,WAAW;AAAA,MAAA;AAAA,IAAA,KAV9CV,EAAO,IAajC;AAAA,EAEJ;AACF;"}
|
package/dist/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/constants.ts"],"sourcesContent":["export const STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP =\n 'STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP';\n"],"names":["STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP"],"mappings":"AAAO,MAAMA,IACX;"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
2
|
+
import { useState as f, useMemo as u, useCallback as h } from "react";
|
3
|
+
import I from "../../../../../assets/line-icons/icons/cross.js";
|
4
|
+
import c from "../../../../ui/layout/flex-view.js";
|
5
|
+
import o from "../../../../ui/text/text.js";
|
6
|
+
import { StreakReductionLocalStorageUtil as s } from "../../../utils/streak-reduction-localstorage-util.js";
|
7
|
+
import { InfoBar as k } from "../info-bar/info-bar.js";
|
8
|
+
import { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP as a } from "./constants.js";
|
9
|
+
const T = ({
|
10
|
+
startTimestampToday: r,
|
11
|
+
streakReduction: t
|
12
|
+
}) => {
|
13
|
+
const [l, d] = f(
|
14
|
+
s.showStreakReduction(
|
15
|
+
a,
|
16
|
+
r
|
17
|
+
)
|
18
|
+
), n = u(() => t > 0, [t]), m = h(() => {
|
19
|
+
s.markStreakReductionDismissed(
|
20
|
+
a,
|
21
|
+
r
|
22
|
+
), d(!1);
|
23
|
+
}, [r]);
|
24
|
+
return l ? /* @__PURE__ */ e(
|
25
|
+
k,
|
26
|
+
{
|
27
|
+
children: /* @__PURE__ */ i(c, { $flexDirection: "row", $alignItems: "center", $justifyContent: "space-between", children: [
|
28
|
+
n ? /* @__PURE__ */ i(c, { children: [
|
29
|
+
/* @__PURE__ */ e(o, { $renderAs: "ab2", $color: "WHITE_T_87", children: "Keep building your streak by completing an activity each day." }),
|
30
|
+
/* @__PURE__ */ e(o, { $renderAs: "ab2", $color: "WHITE_T_87", children: "For each day missed, your streak reduces by 1." })
|
31
|
+
] }) : /* @__PURE__ */ e(o, { $renderAs: "ab2", $color: "WHITE_T_87", children: "Streak saved for the day! Come back tomorrow to keep increasing it." }),
|
32
|
+
/* @__PURE__ */ e(I, { cursor: "pointer", color: "WHITE", onClick: m })
|
33
|
+
] }),
|
34
|
+
hue: n ? "YELLOW" : "GREEN"
|
35
|
+
}
|
36
|
+
) : null;
|
37
|
+
};
|
38
|
+
export {
|
39
|
+
T as StreakReductionInfoBar
|
40
|
+
};
|
41
|
+
//# sourceMappingURL=streak-reduction-infobar.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"streak-reduction-infobar.js","sources":["../../../../../../src/features/circle-games/leaderboard/comps/streak-reduction-infobar/streak-reduction-infobar.tsx"],"sourcesContent":["import type { IUseStreakReductionLeaderboard } from './streak-reduction-infobar-types';\n\nimport { useCallback, useMemo, useState } from 'react';\n\nimport CrossIcon from '../../../../../assets/line-icons/icons/cross';\nimport FlexView from '../../../../ui/layout/flex-view';\nimport Text from '../../../../ui/text/text';\nimport { StreakReductionLocalStorageUtil } from '../../../utils/streak-reduction-localstorage-util';\nimport { InfoBar } from '../info-bar/info-bar';\nimport { STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP } from './constants';\n\nexport const StreakReductionInfoBar = ({\n startTimestampToday,\n streakReduction,\n}: IUseStreakReductionLeaderboard) => {\n const [showInfoBar, setShowInfoBar] = useState(\n StreakReductionLocalStorageUtil.showStreakReduction(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n ),\n );\n\n const hasStreakReduced = useMemo(() => streakReduction > 0, [streakReduction]);\n\n const onInfoBarClose = useCallback(() => {\n StreakReductionLocalStorageUtil.markStreakReductionDismissed(\n STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP,\n startTimestampToday,\n );\n setShowInfoBar(false);\n }, [startTimestampToday]);\n\n if (!showInfoBar) {\n return null;\n }\n\n return (\n <InfoBar\n children={\n <FlexView $flexDirection=\"row\" $alignItems=\"center\" $justifyContent=\"space-between\">\n {hasStreakReduced ? (\n <FlexView>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Keep building your streak by completing an activity each day.\n </Text>\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n For each day missed, your streak reduces by 1.\n </Text>\n </FlexView>\n ) : (\n <Text $renderAs=\"ab2\" $color=\"WHITE_T_87\">\n Streak saved for the day! Come back tomorrow to keep increasing it.\n </Text>\n )}\n <CrossIcon cursor={'pointer'} color=\"WHITE\" onClick={onInfoBarClose} />\n </FlexView>\n }\n hue={hasStreakReduced ? 'YELLOW' : 'GREEN'}\n />\n );\n};\n"],"names":["StreakReductionInfoBar","startTimestampToday","streakReduction","showInfoBar","setShowInfoBar","useState","StreakReductionLocalStorageUtil","STREAK_REDUCTION_LEADERBOARD_INFOBAR_TIMESTAMP","hasStreakReduced","useMemo","onInfoBarClose","useCallback","jsx","InfoBar","FlexView","Text","CrossIcon"],"mappings":";;;;;;;;AAWO,MAAMA,IAAyB,CAAC;AAAA,EACrC,qBAAAC;AAAA,EACA,iBAAAC;AACF,MAAsC;AAC9B,QAAA,CAACC,GAAaC,CAAc,IAAIC;AAAA,IACpCC,EAAgC;AAAA,MAC9BC;AAAA,MACAN;AAAA,IACF;AAAA,EAAA,GAGIO,IAAmBC,EAAQ,MAAMP,IAAkB,GAAG,CAACA,CAAe,CAAC,GAEvEQ,IAAiBC,EAAY,MAAM;AACP,IAAAL,EAAA;AAAA,MAC9BC;AAAA,MACAN;AAAA,IAAA,GAEFG,EAAe,EAAK;AAAA,EAAA,GACnB,CAACH,CAAmB,CAAC;AAExB,SAAKE,IAKH,gBAAAS;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,4BACGC,GAAS,EAAA,gBAAe,OAAM,aAAY,UAAS,iBAAgB,iBACjE,UAAA;AAAA,QAAAN,sBACEM,GACC,EAAA,UAAA;AAAA,UAAA,gBAAAF,EAACG,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,iEAAA;AAAA,4BACCA,GAAK,EAAA,WAAU,OAAM,QAAO,cAAa,UAE1C,kDAAA;AAAA,QAAA,EAAA,CACF,IAEC,gBAAAH,EAAAG,GAAA,EAAK,WAAU,OAAM,QAAO,cAAa,UAE1C,uEAAA;AAAA,0BAEDC,GAAU,EAAA,QAAQ,WAAW,OAAM,SAAQ,SAASN,GAAgB;AAAA,MAAA,GACvE;AAAA,MAEF,KAAKF,IAAmB,WAAW;AAAA,IAAA;AAAA,EAAA,IAxB9B;AA2BX;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-intersection-observer.tsx.js","sources":["../../../../../../src/features/circle-games/leaderboard/hooks/use-intersection-observer/use-intersection-observer.tsx.tsx"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\n\ninterface IntersectionObserverOptions {\n root?: Element | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\nexport const useIntersectionObserver = <T extends HTMLElement>(\n options?: IntersectionObserverOptions,\n) => {\n const [isVisible, setIsVisible] = useState(false);\n const elementRef = useRef<T | null>(null);\n\n useEffect(() => {\n const element = elementRef.current;\n\n if (!element) return;\n\n const observer = new IntersectionObserver(\n ([entry]) => entry && setIsVisible(entry.isIntersecting),\n options,\n );\n\n observer.observe(element);\n\n return () => {\n if (element) observer.unobserve(element);\n };\n }, [options]);\n\n return { isVisible, elementRef };\n};\n"],"names":["useIntersectionObserver","options","isVisible","setIsVisible","useState","elementRef","useRef","useEffect","element","observer","entry"],"mappings":";AAQa,MAAAA,IAA0B,CACrCC,MACG;AACH,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1CC,IAAaC,EAAiB,IAAI;AAExC,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAUH,EAAW;AAE3B,QAAI,CAACG,EAAS;AAEd,UAAMC,IAAW,IAAI;AAAA,MACnB,CAAC,CAACC,CAAK,MAAMA,KAASP,EAAaO,EAAM,cAAc;AAAA,MACvDT;AAAA,IAAA;AAGF,WAAAQ,EAAS,QAAQD,CAAO,GAEjB,MAAM;AACP,MAAAA,KAAkBC,EAAA,UAAUD,CAAO;AAAA,IAAA;AAAA,EACzC,GACC,CAACP,CAAO,CAAC,GAEL,EAAE,WAAAC,GAAW,YAAAG;AACtB;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-timer.js","sources":["../../../../../../src/features/circle-games/leaderboard/hooks/use-timer/use-timer.tsx"],"sourcesContent":["import type { Dispatch, SetStateAction } from 'react';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nexport function useTimer(value: number) {\n const [timer, setTimer] = useState<number>(value);\n const timerId = useRef<ReturnType<typeof setInterval>>();\n\n const initTimer = useCallback(() => {\n timerId.current = setInterval(() => {\n setTimer(prev => prev + 1000);\n }, 1000);\n }, []);\n\n const clearTimer = useCallback(() => {\n clearInterval(timerId.current);\n }, []);\n\n useEffect(() => {\n initTimer();\n\n return () => {\n clearTimer();\n };\n }, [clearTimer, initTimer]);\n\n return [\n timer as number,\n setTimer as Dispatch<SetStateAction<number>>,\n initTimer,\n clearTimer,\n ] as const;\n}\n"],"names":["useTimer","value","timer","setTimer","useState","timerId","useRef","initTimer","useCallback","prev","clearTimer","useEffect"],"mappings":";AAIO,SAASA,EAASC,GAAe;AACtC,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAiBH,CAAK,GAC1CI,IAAUC,KAEVC,IAAYC,EAAY,MAAM;AAC1B,IAAAH,EAAA,UAAU,YAAY,MAAM;AACzB,MAAAF,EAAA,CAAAM,MAAQA,IAAO,GAAI;AAAA,OAC3B,GAAI;AAAA,EACT,GAAG,CAAE,CAAA,GAECC,IAAaF,EAAY,MAAM;AACnC,kBAAcH,EAAQ,OAAO;AAAA,EAC/B,GAAG,CAAE,CAAA;AAEL,SAAAM,EAAU,OACEJ,KAEH,MAAM;AACA,IAAAG;EAAA,IAEZ,CAACA,GAAYH,CAAS,CAAC,GAEnB;AAAA,IACLL;AAAA,IACAC;AAAA,IACAI;AAAA,IACAG;AAAA,EAAA;AAEJ;"}
|
@@ -1,151 +1,153 @@
|
|
1
|
-
import { jsx as e, jsxs as
|
2
|
-
import { useState as T, useEffect as
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
2
|
+
import { useState as T, useEffect as P } from "react";
|
3
3
|
import { ILLUSTRATIONS as v } from "../../../assets/illustrations/illustrations.js";
|
4
4
|
import { CircularLoader as w } from "../../ui/loader/circular-loader/circular-loader.js";
|
5
5
|
import H from "../../ui/text/text.js";
|
6
6
|
import { useCircleSounds as U } from "../hooks/use-circle-sounds/use-circle-sounds.js";
|
7
|
-
import { Banner as
|
7
|
+
import { Banner as d } from "./comps/banner/banner.js";
|
8
8
|
import { LeaderboardItemWithObserver as q } from "./comps/leaderboard-item/leaderboard-item.js";
|
9
9
|
import { NavigationButton as z } from "./comps/navigation-button/navigation-button.js";
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import { useTimer as
|
14
|
-
|
15
|
-
|
16
|
-
[
|
17
|
-
[
|
18
|
-
|
10
|
+
import { StreakReductionInfoBar as G } from "./comps/streak-reduction-infobar/streak-reduction-infobar.js";
|
11
|
+
import { Timer as J } from "./comps/timer/timer.js";
|
12
|
+
import { ELeaderboardType as r } from "./enums/leaderboard-type-enum.js";
|
13
|
+
import { useTimer as Q } from "./hooks/use-timer/use-timer.js";
|
14
|
+
import { Leaderboard as V, LeaderboardContainer as X, BannerWrapper as Z, TournamentBannerCustContainer as D, TrophyWrapper as ee, ItemsWrapper as re, Banner as te, ActionButtonWrapper as ne } from "./leaderboard-styled.js";
|
15
|
+
const u = {
|
16
|
+
[r.ALL_TIME_STREAK]: () => import("../../../assets/lotties/circle/elite-circle-lottie.json.js"),
|
17
|
+
[r.ALL_TIME]: () => import("../../../assets/lotties/circle/elite-circle-lottie.json.js"),
|
18
|
+
[r.BI_WEEKLY]: () => import("../../../assets/lotties/circle/tournament-ripple-lottie.json.js")
|
19
|
+
}, o = [
|
19
20
|
{
|
20
21
|
name: "TOURNAMENT",
|
21
|
-
type:
|
22
|
+
type: r.BI_WEEKLY
|
22
23
|
},
|
23
24
|
{
|
24
25
|
name: "STREAK STARS",
|
25
|
-
type:
|
26
|
+
type: r.ALL_TIME_STREAK
|
26
27
|
},
|
27
28
|
{
|
28
29
|
name: "ALL TIME",
|
29
|
-
type:
|
30
|
+
type: r.ALL_TIME
|
30
31
|
}
|
31
|
-
],
|
32
|
+
], he = ({
|
32
33
|
leaderboardData: m,
|
33
|
-
type:
|
34
|
-
userId:
|
34
|
+
type: E = r.BI_WEEKLY,
|
35
|
+
userId: K,
|
35
36
|
onClose: W,
|
36
37
|
isLoading: p,
|
37
|
-
|
38
|
-
onLeaderboardTypeChange: L
|
38
|
+
streakInfo: L
|
39
39
|
}) => {
|
40
|
-
var A, S, _,
|
41
|
-
const [
|
42
|
-
|
43
|
-
), [
|
40
|
+
var y, A, S, _, R, B, x, b;
|
41
|
+
const [i, l] = T(
|
42
|
+
o.findIndex((t) => E === t.type)
|
43
|
+
), [n, M] = T(((y = m == null ? void 0 : m[E]) == null ? void 0 : y.leaderboardPlayers) || []), [I, k] = T({
|
44
44
|
current: 0,
|
45
45
|
end: 0
|
46
|
-
}), [N,
|
47
|
-
|
46
|
+
}), [N, h] = Q(0), [c, Y] = T(!1), F = (A = n == null ? void 0 : n[0]) == null ? void 0 : A.points, O = ((S = n == null ? void 0 : n[0]) == null ? void 0 : S.streakDays) || 0, { playButtonSound: f } = U(), $ = () => {
|
47
|
+
f(), l((t) => t - 1 < 0 ? o.length - 1 : t - 1);
|
48
48
|
}, j = () => {
|
49
|
-
|
49
|
+
f(), l((t) => t + 1 === o.length ? 0 : t + 1);
|
50
50
|
};
|
51
|
-
return
|
52
|
-
|
53
|
-
}, [
|
54
|
-
var
|
55
|
-
const
|
56
|
-
if (
|
57
|
-
const
|
58
|
-
|
59
|
-
current:
|
60
|
-
end:
|
61
|
-
}),
|
51
|
+
return P(() => {
|
52
|
+
h(0);
|
53
|
+
}, [h]), P(() => {
|
54
|
+
var g;
|
55
|
+
const t = (g = o[i]) == null ? void 0 : g.type, s = t && (m == null ? void 0 : m[t]);
|
56
|
+
if (s) {
|
57
|
+
const C = s.leaderboardPlayers || [];
|
58
|
+
t === r.BI_WEEKLY && (k({
|
59
|
+
current: s.currentTimestamp,
|
60
|
+
end: s.endTimestamp
|
61
|
+
}), s.currentTimestamp > s.endTimestamp && (C.splice(10), Y(!0))), M([...C]);
|
62
62
|
}
|
63
|
-
}, [
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}, [o, L]), /* @__PURE__ */ e(J, { children: /* @__PURE__ */ c(Q, { children: [
|
68
|
-
/* @__PURE__ */ c(V, { children: [
|
69
|
-
((x = s[o]) == null ? void 0 : x.type) === t.BI_WEEKLY && /* @__PURE__ */ e(
|
70
|
-
u,
|
63
|
+
}, [i, m]), /* @__PURE__ */ e(V, { children: /* @__PURE__ */ a(X, { children: [
|
64
|
+
/* @__PURE__ */ a(Z, { children: [
|
65
|
+
((_ = o[i]) == null ? void 0 : _.type) === r.BI_WEEKLY && /* @__PURE__ */ e(
|
66
|
+
d,
|
71
67
|
{
|
72
|
-
isLoading: p ||
|
68
|
+
isLoading: p || n.length === 0,
|
73
69
|
bgFromTopPosition: -120,
|
74
70
|
bgFromRightPosition: -110,
|
75
|
-
primaryText:
|
76
|
-
secondaryText:
|
71
|
+
primaryText: c ? /* @__PURE__ */ e("span", { children: "New Tournament" }) : /* @__PURE__ */ e("span", { children: "Tournament" }),
|
72
|
+
secondaryText: c ? /* @__PURE__ */ e("span", { children: "Starts Soon" }) : /* @__PURE__ */ a("span", { children: [
|
77
73
|
" ",
|
78
74
|
/* @__PURE__ */ e(
|
79
|
-
|
75
|
+
J,
|
80
76
|
{
|
81
|
-
fromTimestamp: N +
|
82
|
-
endTimestamp:
|
77
|
+
fromTimestamp: N + I.current,
|
78
|
+
endTimestamp: I.end
|
83
79
|
}
|
84
80
|
),
|
85
81
|
" ",
|
86
82
|
"left"
|
87
83
|
] }),
|
88
|
-
lottiePromise:
|
89
|
-
custEle: /* @__PURE__ */ e(
|
84
|
+
lottiePromise: u[r.BI_WEEKLY],
|
85
|
+
custEle: /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ e("img", { src: v.TROPHY_CIRCLE }) }) })
|
90
86
|
}
|
91
87
|
),
|
92
|
-
((
|
93
|
-
|
88
|
+
((R = o[i]) == null ? void 0 : R.type) === r.ALL_TIME_STREAK && /* @__PURE__ */ e(
|
89
|
+
d,
|
94
90
|
{
|
95
91
|
isLoading: p,
|
96
92
|
bgFromTopPosition: -140,
|
97
93
|
bgFromRightPosition: -90,
|
98
94
|
primaryText: /* @__PURE__ */ e("span", { children: "Streak Stars" }),
|
99
95
|
secondaryText: /* @__PURE__ */ e("span", { children: "Top 50" }),
|
100
|
-
lottiePromise:
|
96
|
+
lottiePromise: u[r.ALL_TIME_STREAK]
|
101
97
|
}
|
102
98
|
),
|
103
|
-
((
|
104
|
-
|
99
|
+
((B = o[i]) == null ? void 0 : B.type) === r.ALL_TIME && /* @__PURE__ */ e(
|
100
|
+
d,
|
105
101
|
{
|
106
102
|
isLoading: p,
|
107
103
|
bgFromTopPosition: -140,
|
108
104
|
bgFromRightPosition: -90,
|
109
105
|
primaryText: /* @__PURE__ */ e("span", { children: "Elite Circle" }),
|
110
106
|
secondaryText: /* @__PURE__ */ e("span", { children: "Top 50" }),
|
111
|
-
lottiePromise:
|
107
|
+
lottiePromise: u[r.ALL_TIME]
|
112
108
|
}
|
113
109
|
)
|
114
110
|
] }),
|
115
111
|
p && /* @__PURE__ */ e(w, {}),
|
116
|
-
!p &&
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
112
|
+
!p && n && /* @__PURE__ */ a(re, { topInset: 0, children: [
|
113
|
+
((x = o[i]) == null ? void 0 : x.type) === r.ALL_TIME_STREAK && /* @__PURE__ */ e(
|
114
|
+
G,
|
115
|
+
{
|
116
|
+
startTimestampToday: L.startTimestampToday,
|
117
|
+
streakReduction: L.streakReduction
|
118
|
+
}
|
119
|
+
),
|
120
|
+
c && ((b = o[i]) == null ? void 0 : b.type) === r.BI_WEEKLY && /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(H, { $renderAs: "ab3", $color: "WHITE", children: "Congratulating winners of the last tournament!" }) }),
|
121
|
+
n.map((t) => {
|
122
|
+
var s;
|
121
123
|
return /* @__PURE__ */ e(
|
122
124
|
q,
|
123
125
|
{
|
124
|
-
player:
|
125
|
-
rank:
|
126
|
+
player: t,
|
127
|
+
rank: t.rank,
|
126
128
|
maxStreakDays: O,
|
127
129
|
maxPoints: F,
|
128
|
-
leaderboardType: (
|
129
|
-
isActive:
|
130
|
+
leaderboardType: (s = o[i]) == null ? void 0 : s.type,
|
131
|
+
isActive: t.userId === K
|
130
132
|
},
|
131
|
-
|
133
|
+
t.rank
|
132
134
|
);
|
133
135
|
})
|
134
136
|
] }),
|
135
|
-
/* @__PURE__ */ e(
|
137
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
136
138
|
z,
|
137
139
|
{
|
138
|
-
labels: Object.values(
|
140
|
+
labels: Object.values(r),
|
139
141
|
onLeftClick: $,
|
140
142
|
onRightClick: j,
|
141
|
-
currIndex:
|
143
|
+
currIndex: i,
|
142
144
|
onClose: W,
|
143
|
-
disableSwipe: p ||
|
145
|
+
disableSwipe: p || n.length === 0
|
144
146
|
}
|
145
147
|
) })
|
146
148
|
] }) });
|
147
149
|
};
|
148
150
|
export {
|
149
|
-
|
151
|
+
he as Leaderboard
|
150
152
|
};
|
151
153
|
//# sourceMappingURL=leaderboard.js.map
|