diff --git a/frontend/app/dashboard/page.tsx b/frontend/app/dashboard/page.tsx index fddec7f..9423dc7 100644 --- a/frontend/app/dashboard/page.tsx +++ b/frontend/app/dashboard/page.tsx @@ -46,10 +46,10 @@ function DashboardContent() {

今天有 {stats.todayReview} 個單字等待複習,繼續加油!

- 開始今日學習 + 開始今日複習 { - setMounted(true) - initializeSession() - }, []) - - // 初始化學習會話 - const initializeSession = async () => { - try { - await loadDueCards() - - if (dueCards.length > 0) { - const cardIds = dueCards.map(c => c.id) - const completedTests = await ReviewService.loadCompletedTests(cardIds) - initializeTestQueue(completedTests) - } - } catch (error) { - console.error('初始化複習會話失敗:', error) - } - } - - // 重新開始 - const handleRestart = async () => { - resetSession() - await initializeSession() - } - - // 載入狀態 - if (!mounted || isLoading) { - return ( - - ) - } - - if (showNoDueCards) { - return ( - - ) - } - - if (!currentCard) { - return - } - - return ( -
- - -
- {/* 進度追蹤 */} - setShowTaskListModal(true)} - /> - - {/* 測驗執行器 */} - - - {/* 任務清單Modal */} - setShowTaskListModal(false)} - testItems={testItems} - completedTests={completedTests} - totalTests={totalTests} - /> - - {/* 學習完成 */} - {showComplete && ( - router.push('/dashboard')} - /> - )} - - {/* 圖片Modal */} - {modalImage && ( -
-
- 放大圖片 - -
-
- )} - - {/* 錯誤回報Modal */} - -
-
-

- 單字:{reportingCard?.word} -

-
- -
- - -
- -
- - -
-
-
-
-
- ) -} \ No newline at end of file diff --git a/frontend/components/Navigation.tsx b/frontend/components/Navigation.tsx index a8fd633..101fa03 100644 --- a/frontend/components/Navigation.tsx +++ b/frontend/components/Navigation.tsx @@ -5,8 +5,12 @@ import Link from 'next/link' import { usePathname } from 'next/navigation' import { useAuth } from '@/contexts/AuthContext' +interface NavigationProps { + showExitLearning?: boolean + onExitLearning?: () => void +} -export function Navigation() { +export function Navigation({ showExitLearning = false, onExitLearning }: NavigationProps = {}) { const { user, logout } = useAuth() const pathname = usePathname() const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false) @@ -14,7 +18,7 @@ export function Navigation() { const navItems = [ { href: '/dashboard', label: '儀表板' }, { href: '/flashcards', label: '詞卡' }, - { href: '/learn', label: '複習' }, + { href: '/review', label: '複習' }, { href: '/generate', label: 'AI 生成' }, { href: '/settings', label: '⚙️ 設定' } ] @@ -60,7 +64,17 @@ export function Navigation() {
- {/* 通知按鈕 - 桌面和手機都顯示 */} + {/* 複習模式的結束複習按鈕 */} + {showExitLearning ? ( + + ) : ( + <> + {/* 通知按鈕 - 桌面和手機都顯示 */}
+ + )}