@cuemath/leap 3.5.32-as5 → 3.5.32-as7
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/timeline/monthly-timeline/api/use-monthly-timeline-get.js +5 -5
- package/dist/features/timeline/monthly-timeline/api/use-monthly-timeline-get.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js +33 -33
- package/dist/features/timeline/monthly-timeline/comps/monthly-card/monthly-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/constants.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/api/{use-monthly-report-get.js → use-monthly-report-api.js} +4 -4
- package/dist/features/timeline/monthly-timeline/monthly-report/api/use-monthly-report-api.js.map +1 -0
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.js +40 -40
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card/activities-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activity-puzzle-card.js +38 -36
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities-card-puzzles/activity-puzzle-card.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.js +13 -13
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/utils.js +6 -12
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/utils.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback.js +12 -12
- package/dist/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js +69 -59
- package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report.js.map +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js +49 -46
- package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -1
- package/dist/features/timeline/timeline-tabs/constants.js +17 -0
- package/dist/features/timeline/timeline-tabs/constants.js.map +1 -0
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js +23 -37
- package/dist/features/timeline/timeline-tabs/timeline-tabs.js.map +1 -1
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js +2 -2
- package/dist/features/timeline/timeline-tabs/timeline-tabs.styled.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/timeline/monthly-timeline/monthly-report/api/use-monthly-report-get.js.map +0 -1
package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as t } from "react";
|
|
3
|
+
import d from "./activities-card/activities-card.js";
|
|
4
4
|
import l from "../../../../../ui/layout/flex-view.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
/* @__PURE__ */ e(
|
|
9
|
-
/* @__PURE__ */ e(
|
|
10
|
-
/* @__PURE__ */ e(l, { $flexRowGapX: 1.5, children: Object.entries(o).map(([n, r]
|
|
5
|
+
import h from "../../../../../ui/text/text.js";
|
|
6
|
+
import u from "../../../../../ui/separator/separator.js";
|
|
7
|
+
const x = ({ activities: o, onPuzzleClick: p }) => !o || Object.keys(o).length === 0 ? null : /* @__PURE__ */ f(l, { children: [
|
|
8
|
+
/* @__PURE__ */ e(h, { $renderAs: "ab1-bold", $color: "BLACK_1", children: "Activities" }),
|
|
9
|
+
/* @__PURE__ */ e(u, { heightX: 1 }),
|
|
10
|
+
/* @__PURE__ */ e(l, { $flexRowGapX: 1.5, children: Object.entries(o).map(([n, r]) => {
|
|
11
11
|
var m;
|
|
12
12
|
return r != null && r.length ? /* @__PURE__ */ e(
|
|
13
|
-
|
|
13
|
+
d,
|
|
14
14
|
{
|
|
15
15
|
nodeType: (m = r[0]) == null ? void 0 : m.node_type,
|
|
16
16
|
cardType: n,
|
|
17
17
|
activitiesList: r,
|
|
18
18
|
onPuzzleClick: p
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
n
|
|
21
21
|
) : null;
|
|
22
22
|
}) })
|
|
23
|
-
] }),
|
|
23
|
+
] }), w = t(x);
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
w as default
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=activities.js.map
|
package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activities.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { type IActivitiesProps } from './activities-types';\nimport { type TNodeTypes } from '../../../../../chapters-v2/comps/node-card/node-card-types';\nimport ActivitiesCard from './activities-card/activities-card';\nimport { type CARD_TYPE } from '../../monthly-report-types';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Text from '../../../../../ui/text/text';\nimport Separator from '../../../../../ui/separator/separator';\n\nconst Activities: FC<IActivitiesProps> = ({ activities, onPuzzleClick }) => {\n if (!activities || Object.keys(activities).length === 0) return null;\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Activities\n </Text>\n <Separator heightX={1} />\n <FlexView $flexRowGapX={1.5}>\n {Object.entries(activities).map(([cardType, activitiesList]
|
|
1
|
+
{"version":3,"file":"activities.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/activities.tsx"],"sourcesContent":["import { memo, type FC } from 'react';\n\nimport { type IActivitiesProps } from './activities-types';\nimport { type TNodeTypes } from '../../../../../chapters-v2/comps/node-card/node-card-types';\nimport ActivitiesCard from './activities-card/activities-card';\nimport { type CARD_TYPE } from '../../monthly-report-types';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport Text from '../../../../../ui/text/text';\nimport Separator from '../../../../../ui/separator/separator';\n\nconst Activities: FC<IActivitiesProps> = ({ activities, onPuzzleClick }) => {\n if (!activities || Object.keys(activities).length === 0) return null;\n\n return (\n <FlexView>\n <Text $renderAs=\"ab1-bold\" $color=\"BLACK_1\">\n Activities\n </Text>\n <Separator heightX={1} />\n <FlexView $flexRowGapX={1.5}>\n {Object.entries(activities).map(([cardType, activitiesList]) => {\n if (!activitiesList?.length) return null;\n\n return (\n <ActivitiesCard\n key={cardType}\n nodeType={activitiesList[0]?.node_type as TNodeTypes}\n cardType={cardType as CARD_TYPE}\n activitiesList={activitiesList}\n onPuzzleClick={onPuzzleClick}\n />\n );\n })}\n </FlexView>\n </FlexView>\n );\n};\n\nexport default memo(Activities);\n"],"names":["Activities","activities","onPuzzleClick","FlexView","jsx","Text","Separator","cardType","activitiesList","ActivitiesCard","_a","Activities$1","memo"],"mappings":";;;;;;AAUA,MAAMA,IAAmC,CAAC,EAAE,YAAAC,GAAY,eAAAC,QAClD,CAACD,KAAc,OAAO,KAAKA,CAAU,EAAE,WAAW,IAAU,yBAG7DE,GACC,EAAA,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAK,EAAA,WAAU,YAAW,QAAO,WAAU,UAE5C,cAAA;AAAA,EACA,gBAAAD,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,EACtB,gBAAAF,EAAAD,GAAA,EAAS,cAAc,KACrB,UAAO,OAAA,QAAQF,CAAU,EAAE,IAAI,CAAC,CAACM,GAAUC,CAAc,MAAM;;AAC1D,WAACA,KAAA,QAAAA,EAAgB,SAGnB,gBAAAJ;AAAA,MAACK;AAAA,MAAA;AAAA,QAEC,WAAUC,IAAAF,EAAe,CAAC,MAAhB,gBAAAE,EAAmB;AAAA,QAC7B,UAAAH;AAAA,QACA,gBAAAC;AAAA,QACA,eAAAN;AAAA,MAAA;AAAA,MAJKK;AAAA,IAAA,IAJ2B;AAAA,EAWrC,CAAA,GACH;AACF,EAAA,CAAA,GAIWI,IAAAC,EAAKZ,CAAU;"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { NODE_STATE as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
(t) => t.state === e.IN_PROGRESS
|
|
7
|
-
).length, r = n.filter(
|
|
8
|
-
(t) => t.state === e.PENDING || t.state === e.NOT_STARTED
|
|
9
|
-
).length;
|
|
10
|
-
return { totalDone: o, totalPending: l, totalOverdue: r };
|
|
11
|
-
};
|
|
1
|
+
import { NODE_STATE as o } from "../../../../daily-timeline/daily-timeline-types.js";
|
|
2
|
+
const E = (i) => i.reduce(
|
|
3
|
+
(t, { state: e }) => (e === o.COMPLETED || e === o.WAIT_FOR_REVIEW ? t.totalDone++ : e === o.IN_PROGRESS ? t.totalPending++ : (e === o.PENDING || e === o.NOT_STARTED) && t.totalOverdue++, t),
|
|
4
|
+
{ totalDone: 0, totalPending: 0, totalOverdue: 0 }
|
|
5
|
+
);
|
|
12
6
|
export {
|
|
13
|
-
|
|
7
|
+
E as countActivitiesByState
|
|
14
8
|
};
|
|
15
9
|
//# sourceMappingURL=utils.js.map
|
package/dist/features/timeline/monthly-timeline/monthly-report/comps/activities/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/utils.ts"],"sourcesContent":["import { type IMonthlyActivity } from '../../monthly-report-types';\nimport { NODE_STATE } from '../../../../daily-timeline/daily-timeline-types';\n\nexport const countActivitiesByState = (activitiesList: IMonthlyActivity[])
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/activities/utils.ts"],"sourcesContent":["import { type IMonthlyActivity } from '../../monthly-report-types';\nimport { NODE_STATE } from '../../../../daily-timeline/daily-timeline-types';\n\nexport const countActivitiesByState = (activitiesList: IMonthlyActivity[]) =>\n activitiesList.reduce(\n (acc, { state }) => {\n if (state === NODE_STATE.COMPLETED || state === NODE_STATE.WAIT_FOR_REVIEW) {\n acc.totalDone++;\n } else if (state === NODE_STATE.IN_PROGRESS) {\n acc.totalPending++;\n } else if (state === NODE_STATE.PENDING || state === NODE_STATE.NOT_STARTED) {\n acc.totalOverdue++;\n }\n\n return acc;\n },\n { totalDone: 0, totalPending: 0, totalOverdue: 0 },\n );\n"],"names":["countActivitiesByState","activitiesList","acc","state","NODE_STATE"],"mappings":";AAGa,MAAAA,IAAyB,CAACC,MACrCA,EAAe;AAAA,EACb,CAACC,GAAK,EAAE,OAAAC,SACFA,MAAUC,EAAW,aAAaD,MAAUC,EAAW,kBACrDF,EAAA,cACKC,MAAUC,EAAW,cAC1BF,EAAA,kBACKC,MAAUC,EAAW,WAAWD,MAAUC,EAAW,gBAC1DF,EAAA,gBAGCA;AAAA,EAET,EAAE,WAAW,GAAG,cAAc,GAAG,cAAc,EAAE;AACnD;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { memo as R, useCallback as l } from "react";
|
|
3
3
|
import c from "../../../../../ui/layout/flex-view.js";
|
|
4
4
|
import { ILLUSTRATIONS as g } from "../../../../../../assets/illustrations/illustrations.js";
|
|
5
5
|
import $ from "../../../../../ui/image/image.js";
|
|
6
|
-
import { invalidateMonthlyReport as P,
|
|
6
|
+
import { invalidateMonthlyReport as P, monthlyReportPatch as k } from "../../api/use-monthly-report-api.js";
|
|
7
7
|
import f from "../../../../../ui/separator/separator.js";
|
|
8
8
|
import A from "../../../../../ui/text/text.js";
|
|
9
9
|
import C from "../../../../../ui/buttons/clickable/clickable.js";
|
|
@@ -13,19 +13,19 @@ import { MONTHLY_REPORT_ANALYTICS_EVENTS as b } from "../../monthly-report-event
|
|
|
13
13
|
const L = ({
|
|
14
14
|
reportId: t,
|
|
15
15
|
studentName: E,
|
|
16
|
-
onFeedback:
|
|
16
|
+
onFeedback: m,
|
|
17
17
|
studentCourseId: a,
|
|
18
|
-
showSnackbar:
|
|
18
|
+
showSnackbar: s
|
|
19
19
|
}) => {
|
|
20
20
|
const _ = l(
|
|
21
21
|
(r, n) => {
|
|
22
|
-
r &&
|
|
22
|
+
r && s && s({
|
|
23
23
|
type: "error",
|
|
24
24
|
message: "Something went wrong. Please try again.",
|
|
25
25
|
bgColor: "red"
|
|
26
|
-
}), !r &&
|
|
26
|
+
}), !r && m && (n != null && n.feedback) && (P(t), m(n.feedback, a));
|
|
27
27
|
},
|
|
28
|
-
[
|
|
28
|
+
[m, t, s, a]
|
|
29
29
|
), { onEvent: i } = y(), { patch: d, isProcessing: p } = k({
|
|
30
30
|
onComplete: _
|
|
31
31
|
}), o = l(
|
|
@@ -42,14 +42,14 @@ const L = ({
|
|
|
42
42
|
report_id: t
|
|
43
43
|
}), o("negative");
|
|
44
44
|
}, [o, t, i]);
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */ e(c, { $gutterX: 1, children: /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ h(X, { $gapX: 1.25, $background: "WHITE_3", children: [
|
|
46
|
+
/* @__PURE__ */ e(c, { $gutterX: 1, children: /* @__PURE__ */ h(A, { $renderAs: "ab2-black", $color: "BLACK_1", $align: "center", children: [
|
|
47
47
|
"Are you happy with ",
|
|
48
48
|
E ?? "her",
|
|
49
49
|
" progress?"
|
|
50
50
|
] }) }),
|
|
51
51
|
/* @__PURE__ */ e(f, { heightX: 1.5 }),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ h(c, { $flexDirection: "row", $flexGapX: 3, $alignItems: "center", $justifyContent: "center", children: [
|
|
53
53
|
/* @__PURE__ */ e(
|
|
54
54
|
C,
|
|
55
55
|
{
|
|
@@ -93,8 +93,8 @@ const L = ({
|
|
|
93
93
|
] }),
|
|
94
94
|
/* @__PURE__ */ e(f, { heightX: 1.5 })
|
|
95
95
|
] });
|
|
96
|
-
},
|
|
96
|
+
}, B = R(L);
|
|
97
97
|
export {
|
|
98
|
-
|
|
98
|
+
B as default
|
|
99
99
|
};
|
|
100
100
|
//# sourceMappingURL=feedback.js.map
|
package/dist/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport type { IMonthlyReportResponse, TFeedback } from '../../monthly-report-types';\nimport type { IFeedbackTypesProps } from './feedback-types';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport { ILLUSTRATIONS } from '../../../../../../assets/illustrations/illustrations';\nimport Image from '../../../../../ui/image/image';\nimport { invalidateMonthlyReport,
|
|
1
|
+
{"version":3,"file":"feedback.js","sources":["../../../../../../../src/features/timeline/monthly-timeline/monthly-report/comps/feedback/feedback.tsx"],"sourcesContent":["import { memo, useCallback } from 'react';\n\nimport type { IMonthlyReportResponse, TFeedback } from '../../monthly-report-types';\nimport type { IFeedbackTypesProps } from './feedback-types';\nimport FlexView from '../../../../../ui/layout/flex-view';\nimport { ILLUSTRATIONS } from '../../../../../../assets/illustrations/illustrations';\nimport Image from '../../../../../ui/image/image';\nimport { invalidateMonthlyReport, monthlyReportPatch } from '../../api/use-monthly-report-api';\nimport Separator from '../../../../../ui/separator/separator';\nimport Text from '../../../../../ui/text/text';\nimport Clickable from '../../../../../ui/buttons/clickable/clickable';\nimport * as Styled from './feedback-styled';\nimport { useUIContext } from '../../../../../ui/context/context';\nimport { MONTHLY_REPORT_ANALYTICS_EVENTS } from '../../monthly-report-events';\n\nconst Feedback = ({\n reportId,\n studentName,\n onFeedback,\n studentCourseId,\n showSnackbar,\n}: IFeedbackTypesProps) => {\n const onComplete = useCallback(\n (err: string | null, data?: IMonthlyReportResponse) => {\n if (err && showSnackbar) {\n showSnackbar({\n type: 'error',\n message: 'Something went wrong. Please try again.',\n bgColor: 'red',\n });\n }\n\n if (!err && onFeedback && data?.feedback) {\n invalidateMonthlyReport(reportId);\n onFeedback(data.feedback, studentCourseId);\n }\n },\n [onFeedback, reportId, showSnackbar, studentCourseId],\n );\n const { onEvent: trackEvent } = useUIContext();\n\n const { patch: updateMilestone, isProcessing } = monthlyReportPatch({\n onComplete,\n });\n\n const handleFeedback = useCallback(\n (feedback: TFeedback) => {\n updateMilestone(reportId, { feedback });\n },\n [reportId, updateMilestone],\n );\n\n const handlePositiveFeedback = useCallback(() => {\n trackEvent(MONTHLY_REPORT_ANALYTICS_EVENTS.REPORT_POSITIVE_FEEDBACK_CLICKED, {\n report_id: reportId,\n });\n handleFeedback('positive');\n }, [handleFeedback, reportId, trackEvent]);\n\n const handleNegativeFeedback = useCallback(() => {\n trackEvent(MONTHLY_REPORT_ANALYTICS_EVENTS.REPORT_NEGATIVE_FEEDBACK_CLICKED, {\n report_id: reportId,\n });\n handleFeedback('negative');\n }, [handleFeedback, reportId, trackEvent]);\n\n return (\n <Styled.FeedbackContainer $gapX={1.25} $background=\"WHITE_3\">\n <FlexView $gutterX={1}>\n <Text $renderAs=\"ab2-black\" $color=\"BLACK_1\" $align=\"center\">\n Are you happy with {studentName ?? 'her'} progress?\n </Text>\n </FlexView>\n <Separator heightX={1.5} />\n <FlexView $flexDirection=\"row\" $flexGapX={3} $alignItems=\"center\" $justifyContent=\"center\">\n <Clickable\n label=\"Report thumps up\"\n disabled={isProcessing}\n onClick={handlePositiveFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderRadiusX={2.5}\n $borderColor=\"BLACK_5\"\n >\n <Image src={ILLUSTRATIONS.THUMPS_UP} alt=\"UP\" width={32} height={32} />\n </FlexView>\n </Clickable>\n <Clickable\n label=\"Report thumps down\"\n disabled={isProcessing}\n onClick={handleNegativeFeedback}\n >\n <FlexView\n $widthX={5}\n $heightX={5}\n $alignItems=\"center\"\n $justifyContent=\"center\"\n $borderColor=\"BLACK_5\"\n $borderRadiusX={2.5}\n >\n <Image src={ILLUSTRATIONS.THUMPS_DOWN} alt=\"DOWN\" width={32} height={32} />\n </FlexView>\n </Clickable>\n </FlexView>\n <Separator heightX={1.5} />\n </Styled.FeedbackContainer>\n );\n};\n\nexport default memo(Feedback);\n"],"names":["Feedback","reportId","studentName","onFeedback","studentCourseId","showSnackbar","onComplete","useCallback","err","data","invalidateMonthlyReport","trackEvent","useUIContext","updateMilestone","isProcessing","monthlyReportPatch","handleFeedback","feedback","handlePositiveFeedback","MONTHLY_REPORT_ANALYTICS_EVENTS","handleNegativeFeedback","Styled.FeedbackContainer","jsx","FlexView","jsxs","Text","Separator","Clickable","Image","ILLUSTRATIONS","Feedback$1","memo"],"mappings":";;;;;;;;;;;;AAeA,MAAMA,IAAW,CAAC;AAAA,EAChB,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,cAAAC;AACF,MAA2B;AACzB,QAAMC,IAAaC;AAAA,IACjB,CAACC,GAAoBC,MAAkC;AACrD,MAAID,KAAOH,KACIA,EAAA;AAAA,QACX,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,MAAA,CACV,GAGC,CAACG,KAAOL,MAAcM,KAAA,QAAAA,EAAM,cAC9BC,EAAwBT,CAAQ,GACrBE,EAAAM,EAAK,UAAUL,CAAe;AAAA,IAE7C;AAAA,IACA,CAACD,GAAYF,GAAUI,GAAcD,CAAe;AAAA,EAAA,GAEhD,EAAE,SAASO,EAAW,IAAIC,EAAa,GAEvC,EAAE,OAAOC,GAAiB,cAAAC,EAAA,IAAiBC,EAAmB;AAAA,IAClE,YAAAT;AAAA,EAAA,CACD,GAEKU,IAAiBT;AAAA,IACrB,CAACU,MAAwB;AACP,MAAAJ,EAAAZ,GAAU,EAAE,UAAAgB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;AAAA,MACF;AAAA,MACA,gBAAAP;AAAA,QAACK;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,UAAUb;AAAA,UACV,SAASM;AAAA,UAET,UAAA,gBAAAE;AAAA,YAACC;AAAA,YAAA;AAAA,cACC,SAAS;AAAA,cACT,UAAU;AAAA,cACV,aAAY;AAAA,cACZ,iBAAgB;AAAA,cAChB,cAAa;AAAA,cACb,gBAAgB;AAAA,cAEhB,UAAA,gBAAAD,EAACM,GAAM,EAAA,KAAKC,EAAc,aAAa,KAAI,QAAO,OAAO,IAAI,QAAQ,GAAI,CAAA;AAAA,YAAA;AAAA,UAC3E;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GACF;AAAA,IACA,gBAAAP,EAACI,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,EAC3B,EAAA,CAAA;AAEJ,GAEeI,IAAAC,EAAK/B,CAAQ;"}
|
|
@@ -1,69 +1,79 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { MonthlyReportContainer as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { IS_APP_RUNNING_IN_RN as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
studentName:
|
|
17
|
-
reportId:
|
|
18
|
-
onPuzzleClick:
|
|
19
|
-
showSnackbar:
|
|
20
|
-
onFeedback:
|
|
1
|
+
import { jsx as e, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import { memo as $, useCallback as k, useEffect as g } from "react";
|
|
3
|
+
import { monthlyReportGet as F } from "./api/use-monthly-report-api.js";
|
|
4
|
+
import S from "../../../ui/loader/app-loader/app-loader.js";
|
|
5
|
+
import b from "../../../ui/error/error.js";
|
|
6
|
+
import { MonthlyReportContainer as j } from "./monthly-report-styled.js";
|
|
7
|
+
import M from "./comps/goals/goals.js";
|
|
8
|
+
import N from "./comps/activities/activities.js";
|
|
9
|
+
import y from "../../../ui/layout/flex-view.js";
|
|
10
|
+
import P from "./comps/attendance/attendance.js";
|
|
11
|
+
import E from "./comps/feedback/feedback.js";
|
|
12
|
+
import G from "./comps/achievements/achievements.js";
|
|
13
|
+
import { IS_APP_RUNNING_IN_RN as I } from "../../../../constants/app-config.js";
|
|
14
|
+
import w from "../../../ui/separator/separator.js";
|
|
15
|
+
const L = ({
|
|
16
|
+
studentName: i,
|
|
17
|
+
reportId: r,
|
|
18
|
+
onPuzzleClick: C,
|
|
19
|
+
showSnackbar: a,
|
|
20
|
+
onFeedback: v
|
|
21
21
|
}) => {
|
|
22
22
|
const {
|
|
23
|
-
get:
|
|
24
|
-
data:
|
|
25
|
-
isProcessing:
|
|
26
|
-
isProcessingFailed:
|
|
27
|
-
isStale:
|
|
28
|
-
} =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
get: m,
|
|
24
|
+
data: c,
|
|
25
|
+
isProcessing: o,
|
|
26
|
+
isProcessingFailed: x,
|
|
27
|
+
isStale: l
|
|
28
|
+
} = F(r), {
|
|
29
|
+
progress_data: A,
|
|
30
|
+
calendar_data: p,
|
|
31
|
+
report_month: f,
|
|
32
|
+
report_year: h,
|
|
33
|
+
feedback: D,
|
|
34
|
+
student_course_ids: s
|
|
35
|
+
} = c || {}, {
|
|
36
|
+
user_milestones: d,
|
|
37
|
+
activities: u,
|
|
38
|
+
user_achievements: _
|
|
39
|
+
} = A || {}, t = k(() => {
|
|
40
|
+
m(r);
|
|
41
|
+
}, [m, r]);
|
|
42
|
+
if (g(() => {
|
|
43
|
+
t();
|
|
44
|
+
}, [t]), g(() => {
|
|
45
|
+
l && !o && t();
|
|
46
|
+
}, [l, o, t]), o && !c)
|
|
47
|
+
return /* @__PURE__ */ e(y, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(S, { height: "100dvh" }) });
|
|
48
|
+
if (x)
|
|
49
|
+
return /* @__PURE__ */ e(y, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(b, { onTryAgain: t }) });
|
|
50
|
+
const n = s == null ? void 0 : s[0];
|
|
51
|
+
return /* @__PURE__ */ R(j, { children: [
|
|
52
|
+
d && /* @__PURE__ */ e(M, { milestones: d, isExpended: !0 }),
|
|
53
|
+
u && /* @__PURE__ */ e(N, { activities: u, onPuzzleClick: C }),
|
|
54
|
+
_ && /* @__PURE__ */ e(G, { achievements: _, studentName: i }),
|
|
55
|
+
p && f && h && /* @__PURE__ */ e(
|
|
56
|
+
P,
|
|
40
57
|
{
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
calendarData: p,
|
|
59
|
+
reportMonth: f,
|
|
60
|
+
reportYear: h,
|
|
61
|
+
onDateClick: a
|
|
43
62
|
}
|
|
44
63
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
64
|
+
I && !D && n && n ? /* @__PURE__ */ e(
|
|
65
|
+
E,
|
|
47
66
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
67
|
+
reportId: r,
|
|
68
|
+
studentName: i,
|
|
69
|
+
onFeedback: v,
|
|
70
|
+
studentCourseId: n,
|
|
71
|
+
showSnackbar: a
|
|
52
72
|
}
|
|
53
|
-
),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
reportId: o,
|
|
58
|
-
studentName: s,
|
|
59
|
-
onFeedback: l,
|
|
60
|
-
studentCourseId: e.student_course_ids[0],
|
|
61
|
-
showSnackbar: n
|
|
62
|
-
}
|
|
63
|
-
) : /* @__PURE__ */ t(I, { heightX: 1 })
|
|
64
|
-
] }) : null;
|
|
65
|
-
}, q = h(M);
|
|
73
|
+
) : /* @__PURE__ */ e(w, { heightX: 1 })
|
|
74
|
+
] });
|
|
75
|
+
}, te = $(L);
|
|
66
76
|
export {
|
|
67
|
-
|
|
77
|
+
te as default
|
|
68
78
|
};
|
|
69
79
|
//# sourceMappingURL=monthly-report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport {
|
|
1
|
+
{"version":3,"file":"monthly-report.js","sources":["../../../../../src/features/timeline/monthly-timeline/monthly-report/monthly-report.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyReportProps } from './monthly-report-types';\nimport { monthlyReportGet } from './api/use-monthly-report-api';\nimport AppLoader from '../../../ui/loader/app-loader/app-loader';\nimport Error from '../../../ui/error/error';\nimport * as Styled from './monthly-report-styled';\nimport Goals from './comps/goals/goals';\nimport Activities from './comps/activities/activities';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Attendance from './comps/attendance/attendance';\nimport Feedback from './comps/feedback/feedback';\nimport Achievements from './comps/achievements/achievements';\nimport { IS_APP_RUNNING_IN_RN } from '../../../../constants/app-config';\nimport Separator from '../../../ui/separator/separator';\n\nconst MonthlyReport: FC<IMonthlyReportProps> = ({\n studentName,\n reportId,\n onPuzzleClick,\n showSnackbar,\n onFeedback,\n}) => {\n const {\n get: getReport,\n data: reportData,\n isProcessing,\n isProcessingFailed,\n isStale,\n } = monthlyReportGet(reportId);\n\n const {\n progress_data: progressData,\n calendar_data: calendarData,\n report_month: month,\n report_year: year,\n feedback,\n student_course_ids: studentCourseIds,\n } = reportData || {};\n\n const {\n user_milestones: userMilestones,\n activities,\n user_achievements: userAchievements,\n } = progressData || {};\n\n const fetchData = useCallback(() => {\n getReport(reportId);\n }, [getReport, reportId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale && !isProcessing) {\n fetchData();\n }\n }, [isStale, isProcessing, fetchData]);\n\n if (isProcessing && !reportData) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <AppLoader height=\"100dvh\" />\n </FlexView>\n );\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n const firstStudentCourseId = studentCourseIds?.[0];\n const shouldShowFeedback = IS_APP_RUNNING_IN_RN && !feedback && firstStudentCourseId;\n const hasCalendarData = calendarData && month && year;\n\n return (\n <Styled.MonthlyReportContainer>\n {userMilestones && <Goals milestones={userMilestones} isExpended={true} />}\n\n {activities && <Activities activities={activities} onPuzzleClick={onPuzzleClick} />}\n\n {userAchievements && (\n <Achievements achievements={userAchievements} studentName={studentName} />\n )}\n\n {hasCalendarData && (\n <Attendance\n calendarData={calendarData}\n reportMonth={month}\n reportYear={year}\n onDateClick={showSnackbar}\n />\n )}\n\n {shouldShowFeedback && firstStudentCourseId ? (\n <Feedback\n reportId={reportId}\n studentName={studentName}\n onFeedback={onFeedback}\n studentCourseId={firstStudentCourseId}\n showSnackbar={showSnackbar}\n />\n ) : (\n <Separator heightX={1} />\n )}\n </Styled.MonthlyReportContainer>\n );\n};\n\nexport default memo(MonthlyReport);\n"],"names":["MonthlyReport","studentName","reportId","onPuzzleClick","showSnackbar","onFeedback","getReport","reportData","isProcessing","isProcessingFailed","isStale","monthlyReportGet","progressData","calendarData","month","year","feedback","studentCourseIds","userMilestones","activities","userAchievements","fetchData","useCallback","useEffect","jsx","FlexView","AppLoader","Error","firstStudentCourseId","jsxs","Styled.MonthlyReportContainer","Goals","Activities","Achievements","Attendance","IS_APP_RUNNING_IN_RN","Feedback","Separator","monthlyReport","memo"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMA,IAAyC,CAAC;AAAA,EAC9C,aAAAC;AAAA,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c,gBAAAK,EAACQ,GAAW,EAAA,YAAAb,GAAwB,eAAAhB,EAA8B,CAAA;AAAA,IAEhFiB,KACC,gBAAAI,EAACS,GAAa,EAAA,cAAcb,GAAkB,aAAAnB,GAA0B;AAAA,IATtDY,KAAgBC,KAASC,KAa3C,gBAAAS;AAAA,MAACU;AAAA,MAAA;AAAA,QACC,cAAArB;AAAA,QACA,aAAaC;AAAA,QACb,YAAYC;AAAA,QACZ,aAAaX;AAAA,MAAA;AAAA,IACf;AAAA,IAnBqB+B,KAAwB,CAACnB,KAAYY,KAsBrCA,IACrB,gBAAAJ;AAAA,MAACY;AAAA,MAAA;AAAA,QACC,UAAAlC;AAAA,QACA,aAAAD;AAAA,QACA,YAAAI;AAAA,QACA,iBAAiBuB;AAAA,QACjB,cAAAxB;AAAA,MAAA;AAAA,IAGF,IAAA,gBAAAoB,EAACa,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,EAE3B,EAAA,CAAA;AAEJ,GAEeC,KAAAC,EAAKvC,CAAa;"}
|
|
@@ -1,62 +1,65 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { memo as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsx as e, Fragment as A, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { memo as I, useMemo as C, useCallback as E, useEffect as _ } from "react";
|
|
3
|
+
import { monthlyTimelineGet as b } from "./api/use-monthly-timeline-get.js";
|
|
4
|
+
import w from "./monthly-timeline-view.js";
|
|
5
|
+
import L from "../../ui/loader/app-loader/app-loader.js";
|
|
6
6
|
import t from "../../ui/layout/flex-view.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { yearImages as
|
|
11
|
-
import
|
|
12
|
-
import { ImageContainer as
|
|
13
|
-
import { getTimezone as
|
|
14
|
-
import { ILLUSTRATIONS as
|
|
15
|
-
const
|
|
16
|
-
userType:
|
|
17
|
-
studentId:
|
|
18
|
-
courseStreams:
|
|
19
|
-
onReportClick:
|
|
7
|
+
import P from "../../ui/text/text.js";
|
|
8
|
+
import T from "../../ui/image/image.js";
|
|
9
|
+
import s from "../../ui/separator/separator.js";
|
|
10
|
+
import { yearImages as R, monthNames as X } from "./constants.js";
|
|
11
|
+
import j from "../../ui/error/error.js";
|
|
12
|
+
import { ImageContainer as F, DateText as M } from "./monthly-timeline-styled.js";
|
|
13
|
+
import { getTimezone as S } from "../../../helpers/date-time.js";
|
|
14
|
+
import { ILLUSTRATIONS as B } from "../../../assets/illustrations/illustrations.js";
|
|
15
|
+
const v = ({
|
|
16
|
+
userType: h,
|
|
17
|
+
studentId: n,
|
|
18
|
+
courseStreams: l,
|
|
19
|
+
onReportClick: $
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const i = C(
|
|
22
|
+
() => ({
|
|
23
|
+
course_streams: h === "TEACHER" ? l : [],
|
|
24
|
+
timezone: S()
|
|
25
|
+
}),
|
|
26
|
+
[l, h]
|
|
27
|
+
), {
|
|
28
|
+
get: c,
|
|
23
29
|
data: o = [],
|
|
24
|
-
isProcessing:
|
|
25
|
-
isProcessingFailed:
|
|
26
|
-
} =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/* @__PURE__ */ i(t, { $gutterX: 1, children: [
|
|
40
|
-
/* @__PURE__ */ e(F, { $renderAs: "ac4", $color: "BLACK_T_60", children: R[r.month - 1] }),
|
|
41
|
-
/* @__PURE__ */ e(m, { heightX: 1 }),
|
|
30
|
+
isProcessing: y,
|
|
31
|
+
isProcessingFailed: d
|
|
32
|
+
} = b(n, i), m = E(() => {
|
|
33
|
+
c(n, i);
|
|
34
|
+
}, [c, i, n]);
|
|
35
|
+
return _(() => {
|
|
36
|
+
m();
|
|
37
|
+
}, [m]), y ? /* @__PURE__ */ e(L, { height: "100dvh" }) : d ? /* @__PURE__ */ e(t, { $flex: 1, $alignItems: "center", $justifyContent: "center", children: /* @__PURE__ */ e(j, { onTryAgain: m }) }) : /* @__PURE__ */ e(A, { children: (o == null ? void 0 : o.length) > 0 ? /* @__PURE__ */ e(t, { $gapX: 2, children: o.map((r, u) => {
|
|
38
|
+
const g = u === 0, x = r.month === 12, f = !g && x, p = R[r.year];
|
|
39
|
+
return /* @__PURE__ */ a(t, { $width: "100%", children: [
|
|
40
|
+
!g && !f && /* @__PURE__ */ e(s, { heightX: 2 }),
|
|
41
|
+
f && p && /* @__PURE__ */ e(F, { $marginBottom: -122, children: /* @__PURE__ */ e(T, { src: p, alt: r.year.toString() }) }),
|
|
42
|
+
/* @__PURE__ */ a(t, { $gutterX: 1, children: [
|
|
43
|
+
/* @__PURE__ */ e(M, { $renderAs: "ac4", $color: "BLACK_T_60", children: X[r.month - 1] }),
|
|
44
|
+
/* @__PURE__ */ e(s, { heightX: 1 }),
|
|
42
45
|
/* @__PURE__ */ e(
|
|
43
|
-
|
|
46
|
+
w,
|
|
44
47
|
{
|
|
45
48
|
reports: r.reports,
|
|
46
49
|
month: r.month,
|
|
47
50
|
year: r.year,
|
|
48
|
-
onReportClick:
|
|
51
|
+
onReportClick: $
|
|
49
52
|
}
|
|
50
53
|
)
|
|
51
54
|
] })
|
|
52
55
|
] }, `${r.month}-${r.year}`);
|
|
53
|
-
}) }) : /* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */ e(
|
|
55
|
-
/* @__PURE__ */ e(
|
|
56
|
-
/* @__PURE__ */ e(
|
|
56
|
+
}) }) : /* @__PURE__ */ a(t, { $justifyContent: "center", $alignItems: "center", $height: "100%", children: [
|
|
57
|
+
/* @__PURE__ */ e(T, { src: B.EMPTY_REPORTS }),
|
|
58
|
+
/* @__PURE__ */ e(s, { heightX: 1.5 }),
|
|
59
|
+
/* @__PURE__ */ e(P, { $renderAs: "ab2", color: "BLACK_T_60", children: "Report will be available next month." })
|
|
57
60
|
] }) });
|
|
58
|
-
},
|
|
61
|
+
}, W = I(v);
|
|
59
62
|
export {
|
|
60
|
-
|
|
63
|
+
W as default
|
|
61
64
|
};
|
|
62
65
|
//# sourceMappingURL=monthly-timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport {
|
|
1
|
+
{"version":3,"file":"monthly-timeline.js","sources":["../../../../src/features/timeline/monthly-timeline/monthly-timeline.tsx"],"sourcesContent":["import { type FC, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport { type IMonthlyTimelineProps } from './monthly-timeline-types';\nimport { monthlyTimelineGet } from './api/use-monthly-timeline-get';\nimport MonthlyTimelineView from './monthly-timeline-view';\nimport AppLoader from '../../ui/loader/app-loader/app-loader';\nimport FlexView from '../../ui/layout/flex-view';\nimport Text from '../../ui/text/text';\nimport Image from '../../ui/image/image';\nimport Separator from '../../ui/separator/separator';\nimport { monthNames, yearImages } from './constants';\nimport Error from '../../ui/error/error';\nimport * as Styled from './monthly-timeline-styled';\nimport { getTimezone } from '../../../helpers/date-time';\nimport { ILLUSTRATIONS } from '../../../assets/illustrations/illustrations';\n\nconst MonthlyTimeline: FC<IMonthlyTimelineProps> = ({\n userType,\n studentId,\n courseStreams,\n onReportClick,\n}) => {\n const initialQueryParams = useMemo(\n () => ({\n course_streams: userType === 'TEACHER' ? courseStreams : [],\n timezone: getTimezone(),\n }),\n [courseStreams, userType],\n );\n\n const {\n get: getTimeline,\n data: timelineData = [],\n isProcessing,\n isProcessingFailed,\n } = monthlyTimelineGet(studentId, initialQueryParams);\n\n const fetchData = useCallback(() => {\n getTimeline(studentId, initialQueryParams);\n }, [getTimeline, initialQueryParams, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n if (isProcessing) {\n return <AppLoader height=\"100dvh\" />;\n }\n\n if (isProcessingFailed) {\n return (\n <FlexView $flex={1} $alignItems=\"center\" $justifyContent=\"center\">\n <Error onTryAgain={fetchData} />\n </FlexView>\n );\n }\n\n return (\n <>\n {timelineData?.length > 0 ? (\n <FlexView $gapX={2}>\n {timelineData.map((item, index) => {\n const isFirstItem = index === 0;\n const isDecember = item.month === 12;\n const showYearImage = !isFirstItem && isDecember;\n const yearImage = yearImages[item.year];\n\n return (\n <FlexView key={`${item.month}-${item.year}`} $width=\"100%\">\n {!isFirstItem && !showYearImage && <Separator heightX={2} />}\n {showYearImage && yearImage && (\n <Styled.ImageContainer $marginBottom={-122}>\n <Image src={yearImage} alt={item.year.toString()} />\n </Styled.ImageContainer>\n )}\n <FlexView $gutterX={1}>\n <Styled.DateText $renderAs=\"ac4\" $color=\"BLACK_T_60\">\n {monthNames[item.month - 1]}\n </Styled.DateText>\n <Separator heightX={1} />\n <MonthlyTimelineView\n reports={item.reports}\n month={item.month}\n year={item.year}\n onReportClick={onReportClick}\n />\n </FlexView>\n </FlexView>\n );\n })}\n </FlexView>\n ) : (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100%\">\n <Image src={ILLUSTRATIONS.EMPTY_REPORTS} />\n <Separator heightX={1.5} />\n <Text $renderAs=\"ab2\" color=\"BLACK_T_60\">\n Report will be available next month.\n </Text>\n </FlexView>\n )}\n </>\n );\n};\n\nexport default memo(MonthlyTimeline);\n"],"names":["MonthlyTimeline","userType","studentId","courseStreams","onReportClick","initialQueryParams","useMemo","getTimezone","getTimeline","timelineData","isProcessing","isProcessingFailed","monthlyTimelineGet","fetchData","useCallback","useEffect","jsx","AppLoader","FlexView","Error","Fragment","item","index","isFirstItem","isDecember","showYearImage","yearImage","yearImages","jsxs","Separator","Styled.ImageContainer","Image","Styled.DateText","monthNames","MonthlyTimelineView","ILLUSTRATIONS","Text","monthlyTimeline","memo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
+
label: "Monthly",
|
|
11
|
+
path: "monthly"
|
|
12
|
+
}
|
|
13
|
+
];
|
|
14
|
+
export {
|
|
15
|
+
a as TABS
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/features/timeline/timeline-tabs/constants.ts"],"sourcesContent":["import { ETAB_IDS, type ITab } from './timeline-tabs-types';\n\nexport const TABS: ITab[] = [\n {\n id: ETAB_IDS.DAILY,\n label: 'Daily',\n path: 'daily',\n },\n {\n id: ETAB_IDS.MONTHLY,\n label: 'Monthly',\n path: 'monthly',\n },\n];\n"],"names":["TABS","ETAB_IDS"],"mappings":";AAEO,MAAMA,IAAe;AAAA,EAC1B;AAAA,IACE,IAAIC,EAAS;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAIA,EAAS;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;"}
|
|
@@ -1,42 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { TabContainer as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
const
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { memo as m } from "react";
|
|
3
|
+
import { TabContainer as c, TabItem as d } from "./timeline-tabs.styled.js";
|
|
4
|
+
import $ from "../../ui/text/text.js";
|
|
5
|
+
import { TABS as l } from "./constants.js";
|
|
6
|
+
const s = ({ onTabClick: t, activeTab: o, headerHeight: n }) => /* @__PURE__ */ i(c, { $heightX: 4, $headerHeight: n, children: l.map((e) => {
|
|
7
|
+
const r = e.id === o;
|
|
8
|
+
return /* @__PURE__ */ i(
|
|
9
|
+
d,
|
|
8
10
|
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
$isActive: r,
|
|
12
|
+
$justifyContent: "center",
|
|
13
|
+
$borderColor: "BLACK_T_38",
|
|
14
|
+
$background: r ? "BLACK_1" : "WHITE",
|
|
15
|
+
$gapX: 0.46875,
|
|
16
|
+
$gutterX: 1,
|
|
17
|
+
$widthX: 6.5,
|
|
18
|
+
$width: "100%",
|
|
19
|
+
onClick: () => t(e.id),
|
|
20
|
+
children: /* @__PURE__ */ i($, { $renderAs: "ac4", $color: r ? "WHITE" : "BLACK_T_38", children: e.label })
|
|
12
21
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
path: "monthly"
|
|
17
|
-
}
|
|
18
|
-
];
|
|
19
|
-
return /* @__PURE__ */ t(d, { $heightX: 4, $headerHeight: l, children: m.map((e) => {
|
|
20
|
-
const i = e.id === n;
|
|
21
|
-
return /* @__PURE__ */ t(
|
|
22
|
-
c,
|
|
23
|
-
{
|
|
24
|
-
$isActive: i,
|
|
25
|
-
$justifyContent: "center",
|
|
26
|
-
$borderColor: "BLACK_T_38",
|
|
27
|
-
$background: i ? "BLACK_1" : "WHITE",
|
|
28
|
-
$gapX: 0.46875,
|
|
29
|
-
$gutterX: 1,
|
|
30
|
-
$widthX: 6.5,
|
|
31
|
-
$width: "100%",
|
|
32
|
-
onClick: () => o(e.id),
|
|
33
|
-
children: /* @__PURE__ */ t(h, { $renderAs: "ac4", $color: i ? "WHITE" : "BLACK_T_38", children: e.label })
|
|
34
|
-
},
|
|
35
|
-
e.id
|
|
36
|
-
);
|
|
37
|
-
}) });
|
|
38
|
-
}, C = a(T);
|
|
22
|
+
e.id
|
|
23
|
+
);
|
|
24
|
+
}) }), A = m(s);
|
|
39
25
|
export {
|
|
40
|
-
|
|
26
|
+
A as default
|
|
41
27
|
};
|
|
42
28
|
//# sourceMappingURL=timeline-tabs.js.map
|