@@ -31,14 +28,14 @@ export function MyPageContent({ roleplay, memorization, history }: MyPageContent
녹음 관리
-
-
+
+
+
+
+ 저장한 어법 노트를 살펴보고 연습을 시작해보세요.
+
-
-
- {history}
+
+
+ 연습 통계
+
+ {statistics}
);
@@ -58,7 +67,7 @@ export function MyPageContent({ roleplay, memorization, history }: MyPageContent
function SectionHeading({ id, title, href }: MyPageSectionHeadingProps) {
return (
-
+
아직 학습 기록이 없어요. 첫 연습을 시작해보세요.;
+export function MyPageStatistics({ stats }: { stats: PracticeStats | null }) {
+ if (!stats)
+ return (
+
+
+
+
통계를 불러오지 못했어요
+
잠시 후 다시 시도해 주세요.
+
+
+ );
+ if (stats.total === 0)
+ return (
+
+
+
+
+ 최근 30일 동안 완료한 연습이 없어요
+
+
+ 연습 시작하기
+
+
+
+ );
+
return (
-
- {sessions.map((session) => {
- const content = (
- <>
-
-
- {session.title}
-
-
- {session.sessionType === "role-playing" ? "롤플레잉" : "문단 암기"}
-
-
- {states[session.sessionState]}
-
- {session.href && !session.disabled && }
- >
- );
- return (
- -
- {session.href && !session.disabled ? (
-
- {content}
-
- ) : (
-
- {content}
-
- )}
-
- );
- })}
-
+
+
+ 최근 30일 완료 {stats.total}회
+
+
+
+ 최근 30일 주별 연습 완료 횟수
+
+
+ |
+ 시작 주
+ |
+
+ 롤플레잉
+ |
+
+ 문장 암기
+ |
+
+ 어법 연습
+ |
+
+
+
+ {stats.weeks.map((week) => (
+
+ |
+ {week.startsOn}
+ |
+ {week.roleplay} |
+ {week.memorization} |
+ {week.grammar} |
+
+ ))}
+
+
+
+
);
}
diff --git a/src/views/my-page/ui/MyPageView.tsx b/src/views/my-page/ui/MyPageView.tsx
index 12ac01a5..30d50256 100644
--- a/src/views/my-page/ui/MyPageView.tsx
+++ b/src/views/my-page/ui/MyPageView.tsx
@@ -1,11 +1,11 @@
import type { MaterialKind } from "../models/interface";
import { Suspense } from "react";
import { getMyPageMaterials } from "@/views/my-page/services/server/getMyPageMaterials";
-import { getLatestStudySessions } from "@/widgets/latest-sessions/services/server/getLatestStudySessions";
+import { getPracticeStats } from "@/views/my-page/services/server/getPracticeStats";
import {
MyPageContent,
MyPageMaterialRows,
- MyPageHistoryRows,
+ MyPageStatistics,
MyPageRowsLoading,
} from "./MyPageContent";
@@ -22,9 +22,9 @@ export function MyPageView() {
}
- history={
+ statistics={
}>
-
+
}
/>
@@ -33,6 +33,6 @@ export function MyPageView() {
async function RecentMaterials({ type }: { type: MaterialKind }) {
return ;
}
-async function RecentHistory() {
- return ;
+async function PracticeStatistics() {
+ return ;
}
diff --git a/src/widgets/app-shell/ui/EditorialShell.tsx b/src/widgets/app-shell/ui/EditorialShell.tsx
index 942a4a07..f85ff963 100644
--- a/src/widgets/app-shell/ui/EditorialShell.tsx
+++ b/src/widgets/app-shell/ui/EditorialShell.tsx
@@ -11,10 +11,14 @@ import { PracticeMobileMenu } from "./PracticeMobileMenu";
export function EditorialShell({ children, initials, pathname }: EditorialShellProps) {
const { inPractice, base, mode, page } = getShellRoute(pathname);
+ const isMyPage = pathname === "/my-page";
+ const showSidebar = inPractice || isMyPage;
+ const navigationBase = isMyPage ? "/grammar" : base;
+ const navigationMode = isMyPage ? "어법 연습" : mode;
return (
본문으로 이동
- {inPractice && (
+ {showSidebar && (
)}