From 406d7039d6d240972e275a71b7530a3fe0c03698 Mon Sep 17 00:00:00 2001 From: renolation Date: Sun, 12 Apr 2026 23:36:14 +0700 Subject: [PATCH] refactor files --- src/components/{ => layout}/AppHeader.tsx | 0 src/components/{ => layout}/MobileNav.tsx | 0 src/components/{ => layout}/Sidebar.tsx | 0 src/data/mock-data.ts | 157 ------------------ .../auth/components}/AuthModal.tsx | 0 .../auth/components}/LoginForm.tsx | 0 .../auth/components/LoginPage.tsx} | 2 +- .../auth/components}/RegisterForm.tsx | 0 .../auth/components/RegisterPage.tsx} | 2 +- .../dashboard/components}/Dashboard.tsx | 10 +- .../dashboard/components}/LeaderboardCard.tsx | 0 .../dashboard/components}/StatsRow.tsx | 2 +- .../dashboard/components}/WeeklySection.tsx | 0 .../dashboard/components}/XpProgressCard.tsx | 2 +- .../dashboard/components}/XuEconomyCard.tsx | 0 .../home/components}/Home.tsx | 0 .../settings/components}/AccountCard.tsx | 0 .../settings/components}/DailyGoalCard.tsx | 0 .../settings/components}/ExamDateCard.tsx | 0 .../components}/NotificationsCard.tsx | 0 .../settings/components}/ProfileCard.tsx | 0 .../settings/components}/Settings.tsx | 12 +- .../settings/components}/XuWalletCard.tsx | 0 .../toeic}/components/QuestionCard.tsx | 0 .../toeic/components}/TestResult.tsx | 0 .../toeic/components}/TestSession.tsx | 0 src/{ => features/toeic}/components/Timer.tsx | 0 .../toeic/components}/ToeicPractice.tsx | 2 +- .../vocab}/components/FlashCard.tsx | 0 .../vocab/components}/Vocabulary.tsx | 5 +- .../writing/components}/WritingChecker.tsx | 0 .../writing}/components/WritingFeedback.tsx | 0 src/pages/dashboard/gamification-store.ts | 64 ------- src/routes/__root.tsx | 8 +- src/routes/auth.login.tsx | 2 +- src/routes/auth.register.tsx | 2 +- src/routes/dashboard.tsx | 2 +- src/routes/index.tsx | 2 +- src/routes/settings.tsx | 2 +- src/routes/toeic.index.tsx | 2 +- src/routes/toeic.result.tsx | 2 +- src/routes/toeic.session.tsx | 2 +- src/routes/vocab.tsx | 2 +- src/routes/writing.tsx | 2 +- src/temp/local-data.ts | 131 +++++++++++++++ 45 files changed, 162 insertions(+), 255 deletions(-) rename src/components/{ => layout}/AppHeader.tsx (100%) rename src/components/{ => layout}/MobileNav.tsx (100%) rename src/components/{ => layout}/Sidebar.tsx (100%) delete mode 100644 src/data/mock-data.ts rename src/{components/auth => features/auth/components}/AuthModal.tsx (100%) rename src/{components/auth => features/auth/components}/LoginForm.tsx (100%) rename src/{pages/Login.tsx => features/auth/components/LoginPage.tsx} (95%) rename src/{components/auth => features/auth/components}/RegisterForm.tsx (100%) rename src/{pages/Register.tsx => features/auth/components/RegisterPage.tsx} (95%) rename src/{pages => features/dashboard/components}/Dashboard.tsx (92%) rename src/{pages/dashboard => features/dashboard/components}/LeaderboardCard.tsx (100%) rename src/{pages/dashboard => features/dashboard/components}/StatsRow.tsx (98%) rename src/{pages/dashboard => features/dashboard/components}/WeeklySection.tsx (100%) rename src/{pages/dashboard => features/dashboard/components}/XpProgressCard.tsx (96%) rename src/{pages/dashboard => features/dashboard/components}/XuEconomyCard.tsx (100%) rename src/{pages => features/home/components}/Home.tsx (100%) rename src/{pages/settings => features/settings/components}/AccountCard.tsx (100%) rename src/{pages/settings => features/settings/components}/DailyGoalCard.tsx (100%) rename src/{pages/settings => features/settings/components}/ExamDateCard.tsx (100%) rename src/{pages/settings => features/settings/components}/NotificationsCard.tsx (100%) rename src/{pages/settings => features/settings/components}/ProfileCard.tsx (100%) rename src/{pages => features/settings/components}/Settings.tsx (82%) rename src/{pages/settings => features/settings/components}/XuWalletCard.tsx (100%) rename src/{ => features/toeic}/components/QuestionCard.tsx (100%) rename src/{pages => features/toeic/components}/TestResult.tsx (100%) rename src/{pages => features/toeic/components}/TestSession.tsx (100%) rename src/{ => features/toeic}/components/Timer.tsx (100%) rename src/{pages => features/toeic/components}/ToeicPractice.tsx (99%) rename src/{ => features/vocab}/components/FlashCard.tsx (100%) rename src/{pages => features/vocab/components}/Vocabulary.tsx (98%) rename src/{pages => features/writing/components}/WritingChecker.tsx (100%) rename src/{ => features/writing}/components/WritingFeedback.tsx (100%) delete mode 100644 src/pages/dashboard/gamification-store.ts create mode 100644 src/temp/local-data.ts diff --git a/src/components/AppHeader.tsx b/src/components/layout/AppHeader.tsx similarity index 100% rename from src/components/AppHeader.tsx rename to src/components/layout/AppHeader.tsx diff --git a/src/components/MobileNav.tsx b/src/components/layout/MobileNav.tsx similarity index 100% rename from src/components/MobileNav.tsx rename to src/components/layout/MobileNav.tsx diff --git a/src/components/Sidebar.tsx b/src/components/layout/Sidebar.tsx similarity index 100% rename from src/components/Sidebar.tsx rename to src/components/layout/Sidebar.tsx diff --git a/src/data/mock-data.ts b/src/data/mock-data.ts deleted file mode 100644 index 8231db4..0000000 --- a/src/data/mock-data.ts +++ /dev/null @@ -1,157 +0,0 @@ -import type { Question, VocabWord, WritingFeedback, ToeicPart } from '@/types' - -export const TOEIC_PARTS: ToeicPart[] = [ - { id: 1, name: 'Part 1', nameVi: 'Mô tả hình ảnh', questionCount: 45, icon: 'image', progressPercent: 60 }, - { id: 2, name: 'Part 2', nameVi: 'Hỏi-đáp', questionCount: 30, icon: 'question_answer', progressPercent: 40 }, - { id: 3, name: 'Part 3', nameVi: 'Đoạn hội thoại', questionCount: 39, icon: 'forum', progressPercent: 25 }, - { id: 4, name: 'Part 4', nameVi: 'Bài nói', questionCount: 30, icon: 'record_voice_over', progressPercent: 10 }, - { id: 5, name: 'Part 5', nameVi: 'Điền từ', questionCount: 40, icon: 'history_edu', progressPercent: 80 }, - { id: 6, name: 'Part 6', nameVi: 'Điền đoạn', questionCount: 16, icon: 'article', progressPercent: 50 }, - { id: 7, name: 'Part 7', nameVi: 'Đọc hiểu', questionCount: 54, icon: 'chrome_reader_mode', progressPercent: 30 }, -] - -export const MOCK_QUESTIONS: Question[] = [ - { - id: 'q1', part: 2, - text: 'What does the man suggest the woman do about the budget report?', - options: ['A. Submit it immediately', 'B. Review it again carefully', 'C. Postpone the deadline', 'D. Ask a colleague for help'], - correctAnswer: 1, - explanation: 'Người đàn ông nói "You should review it carefully before submitting" — gợi ý xem xét lại báo cáo trước khi nộp.', - }, - { - id: 'q2', part: 2, - text: 'Where most likely are the speakers?', - options: ['A. In a restaurant', 'B. At a conference', 'C. In an office', 'D. At an airport'], - correctAnswer: 2, - explanation: 'Các từ như "meeting room", "printer", "desk" cho biết cuộc trò chuyện diễn ra trong văn phòng.', - }, - { - id: 'q3', part: 2, - text: 'Why is the man calling?', - options: ['A. To confirm a reservation', 'B. To cancel an appointment', 'C. To reschedule a meeting', 'D. To order supplies'], - correctAnswer: 0, - explanation: 'Từ "confirm" và "booking number" trong hội thoại chỉ rõ mục đích của cuộc gọi là xác nhận đặt chỗ.', - }, - { - id: 'q4', part: 2, - text: 'What will the woman do next?', - options: ['A. Call the manager', 'B. Send an email', 'C. Check the inventory', 'D. Update the schedule'], - correctAnswer: 3, - explanation: 'Người phụ nữ nói "I\'ll update the schedule right away" — cho biết hành động tiếp theo là cập nhật lịch trình.', - }, - { - id: 'q5', part: 2, - text: 'What problem does the man mention?', - options: ['A. A delayed shipment', 'B. A broken device', 'C. A missing document', 'D. A scheduling conflict'], - correctAnswer: 0, - explanation: '"The delivery has been delayed by two days" — vấn đề được đề cập là lô hàng bị trễ.', - }, - { - id: 'q6', part: 2, - text: 'How does the woman respond to the proposal?', - options: ['A. She accepts it', 'B. She rejects it', 'C. She needs more time', 'D. She suggests modifications'], - correctAnswer: 3, - explanation: '"That sounds good, but maybe we could adjust the timeline a bit" — đề xuất điều chỉnh, không chấp nhận hoàn toàn.', - }, - { - id: 'q7', part: 2, - text: 'What is the purpose of the announcement?', - options: ['A. To introduce new products', 'B. To notify schedule changes', 'C. To welcome new employees', 'D. To announce a promotion'], - correctAnswer: 1, - explanation: 'Thông báo nói về việc thay đổi giờ làm việc từ tuần tới — mục đích là thông báo thay đổi lịch.', - }, - { - id: 'q8', part: 2, - text: 'What does the woman ask the man to do?', - options: ['A. Prepare a presentation', 'B. Contact the client', 'C. Review the contract', 'D. Attend a training session'], - correctAnswer: 2, - explanation: '"Could you go over the contract before we sign?" — người phụ nữ yêu cầu xem lại hợp đồng.', - }, - { - id: 'q9', part: 2, - text: 'When will the project be completed?', - options: ['A. By the end of this week', 'B. Next Monday', 'C. In two weeks', 'D. Next month'], - correctAnswer: 0, - explanation: '"We should be finished by Friday" — dự án sẽ hoàn thành vào cuối tuần này.', - }, - { - id: 'q10', part: 2, - text: 'What is being discussed at the meeting?', - options: ['A. Budget allocations', 'B. Marketing strategies', 'C. Product launches', 'D. Staff promotions'], - correctAnswer: 1, - explanation: 'Cuộc họp tập trung vào "the new advertising campaign and social media approach" — chiến lược marketing.', - }, -] - -export const VOCAB_DATA: Record = { - 'Tất cả': [ - { id: 'v1', word: 'negotiate', phonetic: '/nɪˈɡoʊʃieɪt/', meaningVi: 'đàm phán', topic: 'Business', example: 'We need to negotiate the contract terms before signing.' }, - { id: 'v2', word: 'collaborate', phonetic: '/kəˈlæbəreɪt/', meaningVi: 'hợp tác', topic: 'Business', example: 'Teams need to collaborate effectively to meet the deadline.' }, - { id: 'v3', word: 'agenda', phonetic: '/əˈdʒendə/', meaningVi: 'chương trình nghị sự', topic: 'Office', example: 'The agenda has been sent to all meeting participants.' }, - { id: 'v4', word: 'itinerary', phonetic: '/aɪˈtɪnəreri/', meaningVi: 'lịch trình chuyến đi', topic: 'Travel', example: 'Here is your travel itinerary for the business conference.' }, - { id: 'v5', word: 'reimburse', phonetic: '/ˌriːɪmˈbɜːrs/', meaningVi: 'hoàn tiền', topic: 'Finance', example: 'The company will reimburse your travel expenses.' }, - { id: 'v6', word: 'recruit', phonetic: '/rɪˈkruːt/', meaningVi: 'tuyển dụng', topic: 'HR', example: 'We are actively recruiting experienced engineers.' }, - { id: 'v7', word: 'campaign', phonetic: '/kæmˈpeɪn/', meaningVi: 'chiến dịch', topic: 'Marketing', example: 'The marketing campaign was very successful this quarter.' }, - { id: 'v8', word: 'implement', phonetic: '/ˈɪmplɪment/', meaningVi: 'triển khai, thực hiện', topic: 'Business', example: 'We plan to implement the new strategy next quarter.' }, - ], - 'Business': [ - { id: 'b1', word: 'negotiate', phonetic: '/nɪˈɡoʊʃieɪt/', meaningVi: 'đàm phán', topic: 'Business', example: 'We need to negotiate the contract terms.' }, - { id: 'b2', word: 'collaborate', phonetic: '/kəˈlæbəreɪt/', meaningVi: 'hợp tác', topic: 'Business', example: 'Teams collaborate to achieve shared goals.' }, - { id: 'b3', word: 'delegate', phonetic: '/ˈdelɪɡeɪt/', meaningVi: 'uỷ quyền, phân công', topic: 'Business', example: 'A good manager knows how to delegate tasks.' }, - { id: 'b4', word: 'implement', phonetic: '/ˈɪmplɪment/', meaningVi: 'triển khai, thực hiện', topic: 'Business', example: 'We will implement the new policy next month.' }, - { id: 'b5', word: 'merger', phonetic: '/ˈmɜːrdʒər/', meaningVi: 'sáp nhập công ty', topic: 'Business', example: 'The merger will create a stronger combined company.' }, - { id: 'b6', word: 'acquisition', phonetic: '/ˌækwɪˈzɪʃən/', meaningVi: 'mua lại, thâu tóm', topic: 'Business', example: 'The acquisition was completed ahead of schedule.' }, - ], - 'Office': [ - { id: 'o1', word: 'agenda', phonetic: '/əˈdʒendə/', meaningVi: 'chương trình nghị sự', topic: 'Office', example: 'Please review the agenda before the meeting.' }, - { id: 'o2', word: 'minutes', phonetic: '/ˈmɪnɪts/', meaningVi: 'biên bản họp', topic: 'Office', example: 'Could you take the meeting minutes today?' }, - { id: 'o3', word: 'submit', phonetic: '/səbˈmɪt/', meaningVi: 'nộp, gửi đi', topic: 'Office', example: 'Please submit your report by Friday afternoon.' }, - { id: 'o4', word: 'deadline', phonetic: '/ˈdedlaɪn/', meaningVi: 'hạn chót', topic: 'Office', example: 'The deadline for this project is end of month.' }, - { id: 'o5', word: 'cubicle', phonetic: '/ˈkjuːbɪkəl/', meaningVi: 'góc làm việc riêng', topic: 'Office', example: 'Each employee has their own cubicle in the open office.' }, - ], - 'Travel': [ - { id: 't1', word: 'itinerary', phonetic: '/aɪˈtɪnəreri/', meaningVi: 'lịch trình chuyến đi', topic: 'Travel', example: 'Here is your detailed travel itinerary.' }, - { id: 't2', word: 'boarding pass', phonetic: '/ˈbɔːrdɪŋ pæs/', meaningVi: 'thẻ lên máy bay', topic: 'Travel', example: 'Please have your boarding pass ready at the gate.' }, - { id: 't3', word: 'layover', phonetic: '/ˈleɪoʊvər/', meaningVi: 'thời gian quá cảnh', topic: 'Travel', example: 'There is a two-hour layover in Singapore.' }, - { id: 't4', word: 'customs', phonetic: '/ˈkʌstəmz/', meaningVi: 'hải quan', topic: 'Travel', example: 'All passengers must go through customs on arrival.' }, - { id: 't5', word: 'baggage claim', phonetic: '/ˈbæɡɪdʒ kleɪm/', meaningVi: 'băng chuyền hành lý', topic: 'Travel', example: 'Meet us at the baggage claim after landing.' }, - ], - 'Finance': [ - { id: 'f1', word: 'reimburse', phonetic: '/ˌriːɪmˈbɜːrs/', meaningVi: 'hoàn tiền', topic: 'Finance', example: 'The company will reimburse all travel expenses.' }, - { id: 'f2', word: 'invoice', phonetic: '/ˈɪnvɔɪs/', meaningVi: 'hoá đơn', topic: 'Finance', example: 'Please send the invoice to our accounting department.' }, - { id: 'f3', word: 'budget', phonetic: '/ˈbʌdʒɪt/', meaningVi: 'ngân sách', topic: 'Finance', example: 'We need to stay within the approved budget.' }, - { id: 'f4', word: 'revenue', phonetic: '/ˈrevɪnjuː/', meaningVi: 'doanh thu', topic: 'Finance', example: 'Revenue increased by 15% last quarter.' }, - { id: 'f5', word: 'fiscal year', phonetic: '/ˈfɪskəl jɪər/', meaningVi: 'năm tài chính', topic: 'Finance', example: 'Our fiscal year ends on December 31st.' }, - ], - 'HR': [ - { id: 'h1', word: 'recruit', phonetic: '/rɪˈkruːt/', meaningVi: 'tuyển dụng', topic: 'HR', example: 'We are recruiting experienced software engineers.' }, - { id: 'h2', word: 'probation', phonetic: '/proʊˈbeɪʃən/', meaningVi: 'thử việc', topic: 'HR', example: 'New employees have a 3-month probation period.' }, - { id: 'h3', word: 'appraisal', phonetic: '/əˈpreɪzəl/', meaningVi: 'đánh giá nhân viên', topic: 'HR', example: 'Annual performance appraisals are held in December.' }, - { id: 'h4', word: 'resignation', phonetic: '/ˌrezɪɡˈneɪʃən/', meaningVi: 'đơn từ chức', topic: 'HR', example: 'She submitted her resignation letter this morning.' }, - { id: 'h5', word: 'onboarding', phonetic: '/ˈɒnbɔːrdɪŋ/', meaningVi: 'quy trình tiếp nhận nhân viên mới', topic: 'HR', example: 'The onboarding process takes about two weeks.' }, - ], - 'Marketing': [ - { id: 'm1', word: 'campaign', phonetic: '/kæmˈpeɪn/', meaningVi: 'chiến dịch', topic: 'Marketing', example: 'The marketing campaign exceeded all expectations.' }, - { id: 'm2', word: 'demographics', phonetic: '/ˌdeməˈɡræfɪks/', meaningVi: 'nhân khẩu học', topic: 'Marketing', example: 'We need to understand our target demographics.' }, - { id: 'm3', word: 'endorse', phonetic: '/ɪnˈdɔːrs/', meaningVi: 'chứng thực, bảo trợ', topic: 'Marketing', example: 'The product is endorsed by professional athletes.' }, - { id: 'm4', word: 'branding', phonetic: '/ˈbrændɪŋ/', meaningVi: 'xây dựng thương hiệu', topic: 'Marketing', example: 'Consistent branding builds long-term customer trust.' }, - { id: 'm5', word: 'conversion rate', phonetic: '/kənˈvɜːrʒən reɪt/', meaningVi: 'tỷ lệ chuyển đổi', topic: 'Marketing', example: 'Our conversion rate improved after the redesign.' }, - ], -} - -export const MOCK_WRITING_FEEDBACK: WritingFeedback = { - score: '6.5', - grammar: [ - '"managers are concern" → nên dùng "concerned" (tính từ, không phải danh từ)', - 'Thiếu mạo từ "an" trước "efficient arrangement" ở câu cuối', - 'Câu "This change is expected to improve" — đúng nhưng hơi thụ động, có thể dùng active voice', - ], - vocabulary: [ - 'Tốt: "implement", "productivity", "collaboration", "arrangement"', - 'Gợi ý nâng cao: "enhance" thay "increase", "address" thay "help with"', - 'Nên thêm từ nối: "Nevertheless", "In addition", "As a result of this"', - ], - structure: 'Bài viết có cấu trúc khá rõ ràng với mở đầu, thân bài và kết luận ngầm. Tuy nhiên cần phát triển thêm phần giải thích tác động và thêm ví dụ cụ thể để bài hoàn chỉnh hơn.', - improvedVersion: 'The company has decided to implement a new remote work policy starting next month. All employees will be able to work from home for three days per week. This change is expected to enhance work-life balance and boost overall productivity. Nevertheless, some managers are concerned about communication challenges and team collaboration. To address these concerns, the HR department will organize training sessions to help teams adapt to this new arrangement effectively.', - summary: 'Bài viết đạt mức Upper Intermediate (6.5) với ý tưởng rõ ràng. Cần sửa lỗi ngữ pháp cơ bản và bổ sung từ vựng phong phú hơn để đạt band 7.0+.', -} diff --git a/src/components/auth/AuthModal.tsx b/src/features/auth/components/AuthModal.tsx similarity index 100% rename from src/components/auth/AuthModal.tsx rename to src/features/auth/components/AuthModal.tsx diff --git a/src/components/auth/LoginForm.tsx b/src/features/auth/components/LoginForm.tsx similarity index 100% rename from src/components/auth/LoginForm.tsx rename to src/features/auth/components/LoginForm.tsx diff --git a/src/pages/Login.tsx b/src/features/auth/components/LoginPage.tsx similarity index 95% rename from src/pages/Login.tsx rename to src/features/auth/components/LoginPage.tsx index 169b6cf..1033386 100644 --- a/src/pages/Login.tsx +++ b/src/features/auth/components/LoginPage.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react' import { useNavigate } from '@tanstack/react-router' import { useUser } from '@/hooks/use-auth' -import { LoginForm } from '@/components/auth/LoginForm' +import { LoginForm } from './LoginForm' export function LoginPage() { const user = useUser() diff --git a/src/components/auth/RegisterForm.tsx b/src/features/auth/components/RegisterForm.tsx similarity index 100% rename from src/components/auth/RegisterForm.tsx rename to src/features/auth/components/RegisterForm.tsx diff --git a/src/pages/Register.tsx b/src/features/auth/components/RegisterPage.tsx similarity index 95% rename from src/pages/Register.tsx rename to src/features/auth/components/RegisterPage.tsx index e9eb1d2..243d7ae 100644 --- a/src/pages/Register.tsx +++ b/src/features/auth/components/RegisterPage.tsx @@ -1,7 +1,7 @@ import { useEffect } from 'react' import { useNavigate } from '@tanstack/react-router' import { useUser } from '@/hooks/use-auth' -import { RegisterForm } from '@/components/auth/RegisterForm' +import { RegisterForm } from './RegisterForm' export function RegisterPage() { const user = useUser() diff --git a/src/pages/Dashboard.tsx b/src/features/dashboard/components/Dashboard.tsx similarity index 92% rename from src/pages/Dashboard.tsx rename to src/features/dashboard/components/Dashboard.tsx index 4296089..d8ae3c3 100644 --- a/src/pages/Dashboard.tsx +++ b/src/features/dashboard/components/Dashboard.tsx @@ -3,11 +3,11 @@ import { useAuthStore } from '@/store/auth-store' import { useAuthModalStore } from '@/store/auth-modal-store' import { useGamification, useLeaderboard } from '@/hooks/use-gamification' import { XP_REWARDS } from '@/lib/gamification-service' -import { StatsRow } from './dashboard/StatsRow' -import { XpProgressCard } from './dashboard/XpProgressCard' -import { WeeklySection } from './dashboard/WeeklySection' -import { XuEconomyCard } from './dashboard/XuEconomyCard' -import { LeaderboardCard } from './dashboard/LeaderboardCard' +import { StatsRow } from './StatsRow' +import { XpProgressCard } from './XpProgressCard' +import { WeeklySection } from './WeeklySection' +import { XuEconomyCard } from './XuEconomyCard' +import { LeaderboardCard } from './LeaderboardCard' // Numeric level from XP (1 per 100 XP, min 1) export function calcNumericLevel(xp: number) { diff --git a/src/pages/dashboard/LeaderboardCard.tsx b/src/features/dashboard/components/LeaderboardCard.tsx similarity index 100% rename from src/pages/dashboard/LeaderboardCard.tsx rename to src/features/dashboard/components/LeaderboardCard.tsx diff --git a/src/pages/dashboard/StatsRow.tsx b/src/features/dashboard/components/StatsRow.tsx similarity index 98% rename from src/pages/dashboard/StatsRow.tsx rename to src/features/dashboard/components/StatsRow.tsx index 78ed988..410cf09 100644 --- a/src/pages/dashboard/StatsRow.tsx +++ b/src/features/dashboard/components/StatsRow.tsx @@ -1,5 +1,5 @@ import type { UserLevel } from '@/types' -import { calcNumericLevel } from '../Dashboard' +import { calcNumericLevel } from './Dashboard' const LEVEL_NAMES: Record = { beginner: 'Beginner', diff --git a/src/pages/dashboard/WeeklySection.tsx b/src/features/dashboard/components/WeeklySection.tsx similarity index 100% rename from src/pages/dashboard/WeeklySection.tsx rename to src/features/dashboard/components/WeeklySection.tsx diff --git a/src/pages/dashboard/XpProgressCard.tsx b/src/features/dashboard/components/XpProgressCard.tsx similarity index 96% rename from src/pages/dashboard/XpProgressCard.tsx rename to src/features/dashboard/components/XpProgressCard.tsx index f8dc0a8..03364f2 100644 --- a/src/pages/dashboard/XpProgressCard.tsx +++ b/src/features/dashboard/components/XpProgressCard.tsx @@ -1,4 +1,4 @@ -import { calcXpNextLevel, calcNumericLevel } from '../Dashboard' +import { calcXpNextLevel, calcNumericLevel } from './Dashboard' interface Props { xp: number } diff --git a/src/pages/dashboard/XuEconomyCard.tsx b/src/features/dashboard/components/XuEconomyCard.tsx similarity index 100% rename from src/pages/dashboard/XuEconomyCard.tsx rename to src/features/dashboard/components/XuEconomyCard.tsx diff --git a/src/pages/Home.tsx b/src/features/home/components/Home.tsx similarity index 100% rename from src/pages/Home.tsx rename to src/features/home/components/Home.tsx diff --git a/src/pages/settings/AccountCard.tsx b/src/features/settings/components/AccountCard.tsx similarity index 100% rename from src/pages/settings/AccountCard.tsx rename to src/features/settings/components/AccountCard.tsx diff --git a/src/pages/settings/DailyGoalCard.tsx b/src/features/settings/components/DailyGoalCard.tsx similarity index 100% rename from src/pages/settings/DailyGoalCard.tsx rename to src/features/settings/components/DailyGoalCard.tsx diff --git a/src/pages/settings/ExamDateCard.tsx b/src/features/settings/components/ExamDateCard.tsx similarity index 100% rename from src/pages/settings/ExamDateCard.tsx rename to src/features/settings/components/ExamDateCard.tsx diff --git a/src/pages/settings/NotificationsCard.tsx b/src/features/settings/components/NotificationsCard.tsx similarity index 100% rename from src/pages/settings/NotificationsCard.tsx rename to src/features/settings/components/NotificationsCard.tsx diff --git a/src/pages/settings/ProfileCard.tsx b/src/features/settings/components/ProfileCard.tsx similarity index 100% rename from src/pages/settings/ProfileCard.tsx rename to src/features/settings/components/ProfileCard.tsx diff --git a/src/pages/Settings.tsx b/src/features/settings/components/Settings.tsx similarity index 82% rename from src/pages/Settings.tsx rename to src/features/settings/components/Settings.tsx index 4efc8ad..e813d5a 100644 --- a/src/pages/Settings.tsx +++ b/src/features/settings/components/Settings.tsx @@ -1,11 +1,11 @@ import { useAuthStore } from '@/store/auth-store' import { useAuthModalStore } from '@/store/auth-modal-store' -import { ProfileCard } from './settings/ProfileCard' -import { XuWalletCard } from './settings/XuWalletCard' -import { DailyGoalCard } from './settings/DailyGoalCard' -import { ExamDateCard } from './settings/ExamDateCard' -import { NotificationsCard } from './settings/NotificationsCard' -import { AccountCard } from './settings/AccountCard' +import { ProfileCard } from './ProfileCard' +import { XuWalletCard } from './XuWalletCard' +import { DailyGoalCard } from './DailyGoalCard' +import { ExamDateCard } from './ExamDateCard' +import { NotificationsCard } from './NotificationsCard' +import { AccountCard } from './AccountCard' export function Settings() { const user = useAuthStore((s) => s.user) diff --git a/src/pages/settings/XuWalletCard.tsx b/src/features/settings/components/XuWalletCard.tsx similarity index 100% rename from src/pages/settings/XuWalletCard.tsx rename to src/features/settings/components/XuWalletCard.tsx diff --git a/src/components/QuestionCard.tsx b/src/features/toeic/components/QuestionCard.tsx similarity index 100% rename from src/components/QuestionCard.tsx rename to src/features/toeic/components/QuestionCard.tsx diff --git a/src/pages/TestResult.tsx b/src/features/toeic/components/TestResult.tsx similarity index 100% rename from src/pages/TestResult.tsx rename to src/features/toeic/components/TestResult.tsx diff --git a/src/pages/TestSession.tsx b/src/features/toeic/components/TestSession.tsx similarity index 100% rename from src/pages/TestSession.tsx rename to src/features/toeic/components/TestSession.tsx diff --git a/src/components/Timer.tsx b/src/features/toeic/components/Timer.tsx similarity index 100% rename from src/components/Timer.tsx rename to src/features/toeic/components/Timer.tsx diff --git a/src/pages/ToeicPractice.tsx b/src/features/toeic/components/ToeicPractice.tsx similarity index 99% rename from src/pages/ToeicPractice.tsx rename to src/features/toeic/components/ToeicPractice.tsx index 09fec59..180c7bc 100644 --- a/src/pages/ToeicPractice.tsx +++ b/src/features/toeic/components/ToeicPractice.tsx @@ -2,7 +2,7 @@ import { useState } from 'react' import { useNavigate } from '@tanstack/react-router' import { CircularProgress } from '@/components/CircularProgress' import { useTestStore } from '@/store/test-store' -import { TOEIC_PARTS } from '@/data/mock-data' +import { TOEIC_PARTS } from '@/temp/local-data' import { fetchQuestions } from '@/hooks/use-questions' import { useRequireAuth } from '@/hooks/use-require-auth' diff --git a/src/components/FlashCard.tsx b/src/features/vocab/components/FlashCard.tsx similarity index 100% rename from src/components/FlashCard.tsx rename to src/features/vocab/components/FlashCard.tsx diff --git a/src/pages/Vocabulary.tsx b/src/features/vocab/components/Vocabulary.tsx similarity index 98% rename from src/pages/Vocabulary.tsx rename to src/features/vocab/components/Vocabulary.tsx index 7cbce71..257351b 100644 --- a/src/pages/Vocabulary.tsx +++ b/src/features/vocab/components/Vocabulary.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { cn } from '@/lib/utils' -import { FlashCard } from '@/components/FlashCard' +import { FlashCard } from './FlashCard' import { useVocabStore } from '@/store/vocab-store' import { useVocab } from '@/hooks/use-vocab' import { VOCAB_TOPICS } from '@/types' @@ -170,7 +170,6 @@ export function Vocabulary() { Trước - {/* Mark buttons */}