Skip to content

Conversation

@suminb99
Copy link
Contributor

@suminb99 suminb99 commented Jul 18, 2025

⚙️ Related ISSUE Number

Related #3



📄 Work Description

  • 대시보드 페이지 UI 구현
  • CourseList, CourseCard, ScheduleList, ScheduleCard 컴포넌트 개발
  • UI 확인을 위한 mockData 추가
  • 폴더 구조 정리 (components/common/Dashboard, pages/common/Dashboard.tsx)
  • 라우트 추가 (/student, /admin 경로의 기본 페이지로 대시보드 페이지 설정)

  • URL 경로(pathname)를 기반으로 userType(admin 또는 student)을 임시로 판별하는 로직 구현 → useAuth 도입 전까지 임시방편으로 활용할 예정입니다!
  • userType에 따라 대시보드 내 UI 분기 처리 → admin인 경우에만 추가, 수정/삭제 관련 버튼 노출
  • 강좌의 메뉴 버튼(...) 클릭 시 옵션 메뉴(모달창) 표시 기능 구현 → 수정하기, 삭제하기 항목 포함



📷 Screenshot

Screen.Recording.2025-07-23.at.22.20.45.mov



💬 To Reviewers

머지 전 수정 / 추가 구현 필요한 부분:

  • 수정된 header 위치에 맞춰 레이아웃 재정리

아래 두 항목은 논의가 필요할 것 같습니다!

  • ScheduleCard 텍스트 처리 (줄 바꿈 or ellipsis 처리)
  • 남은 일자 라벨 색 변경 기준 (1일 전만 바뀌는지 or 가장 최근 것만 바뀌는지)



🔗 Reference

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a dashboard page displaying a course list and upcoming assignment schedules for both student and admin views.
    • Added components for course cards, course lists, schedule cards, and schedule lists with sample data and interactive elements.
    • Added a new ellipsis icon and an add icon for use in the UI.
    • Configured default dashboard routes for student and admin sections.
  • Style

    • Added new gray color and card shadow variables to the theme for consistent styling.
  • Documentation

    • Added type definitions for courses, schedules, and assignments to improve code clarity and maintainability.

@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a new Dashboard feature, including several React components for displaying course and schedule information. The routing configuration is updated to render the Dashboard as the default view for both student and admin paths. Supporting type definitions, SVG assets, and CSS variables are also added or modified.

Changes

File(s) Change Summary
src/pages/common/Dashboard.tsx Added new Dashboard component rendering course and schedule lists.
src/components/common/Dashboard/CourseCard.tsx, .../CourseList.tsx, .../ScheduleCard.tsx, .../ScheduleList.tsx Added new React components for displaying courses and schedules in the Dashboard.
src/components/common/Dashboard/types.ts Introduced TypeScript interfaces for Course, Schedule, and Assignment, plus UserType.
src/App.tsx Updated routing to show Dashboard as the index route for /student and /admin.
src/assets/svg/EllipsisIcon.tsx, src/assets/svg/AddIcon.tsx Added new SVG React components for ellipsis and add icons.
src/assets/svg/index.ts Exported the new EllipsisIcon and AddIcon SVG components.
src/index.css Added CSS variables --color-gray, --shadow-card, and --shadow-modal to the theme block.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant Layout
    participant Dashboard
    participant CourseList
    participant ScheduleList

    User->>App: Navigate to /student or /admin
    App->>Layout: Render layout for route
    Layout->>Dashboard: Render Dashboard as index route
    Dashboard->>CourseList: Render course list
    Dashboard->>ScheduleList: Render schedule list
Loading

Estimated code review effort

3 (~45 minutes)

Possibly related PRs

Suggested reviewers

  • JiiminHa

Poem

🐇
In the dashboard’s gentle light,
Courses and schedules now in sight.
Cards and icons, colors gray,
Guide our learning every day.
A hop, a skip, a brand new view—
This rabbit’s dashboard welcomes you!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-23T13_57_34_300Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02da871 and da5cdab.

📒 Files selected for processing (2)
  • src/App.tsx (2 hunks)
  • src/assets/svg/index.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (6)
src/pages/common/Dashboard.tsx (1)

4-16: Consider responsive design and header position adjustments.

The Dashboard component structure is clean and well-organized. However, consider these improvements:

  1. Responsive Design: The fixed width w-289 might not work well on all screen sizes
  2. Header Position: As mentioned in the PR objectives, layout adjustments may be needed for the modified header position

Consider this responsive improvement:

-    <div className='min-h-screen h-full py-10 bg-background flex-col'>
-      <div className='w-289 mx-auto my-0'>
+    <div className='min-h-screen h-full py-10 bg-background flex-col'>
+      <div className='max-w-289 w-full mx-auto my-0 px-4'>

This maintains the maximum width while allowing flexibility on smaller screens.

src/assets/svg/EllipsisIcon.tsx (1)

1-15: SVG component implementation looks good, consider making fill color customizable.

The component follows the established svgr pattern correctly with proper TypeScript typing and props spreading for customization. The SVG structure and positioning are appropriate for an ellipsis icon.

Consider making the fill color customizable by removing the hardcoded #7D7993 and allowing it to be overridden via props:

-    <circle cx={3.305} cy={3.198} r={2.5} fill='#7D7993' />
-    <circle cx={11.402} cy={3.198} r={2.5} fill='#7D7993' />
-    <circle cx={19.5} cy={3.198} r={2.5} fill='#7D7993' />
+    <circle cx={3.305} cy={3.198} r={2.5} fill='currentColor' />
+    <circle cx={11.402} cy={3.198} r={2.5} fill='currentColor' />
+    <circle cx={19.5} cy={3.198} r={2.5} fill='currentColor' />

This would allow the icon to inherit the text color from its parent, making it more flexible for different UI contexts.

src/components/common/Dashboard/ScheduleCard.tsx (1)

8-8: Consider making the card width responsive.

The hardcoded width of 396px might cause layout issues on different screen sizes. Consider using responsive width classes or making it configurable via props.

-    <div className='flex items-start p-7 gap-6 border-0 bg-white w-[396px] mb-5 rounded-3xl'>
+    <div className='flex items-start p-7 gap-6 border-0 bg-white w-full max-w-[396px] mb-5 rounded-3xl'>
src/components/common/Dashboard/CourseList.tsx (1)

38-43: Consider consistent button styling.

The "추가" button has explicit styling while the "더보기" button inherits default styles. Consider making the styling consistent:

-          <button className='bg-white border-0 px-3 py-0.5 rounded-[10px]'>
-            + 추가
-          </button>
-          <button>더보기</button>
+          <button className='bg-white border-0 px-3 py-0.5 rounded-[10px]'>
+            + 추가
+          </button>
+          <button className='bg-white border-0 px-3 py-0.5 rounded-[10px]'>
+            더보기
+          </button>
src/components/common/Dashboard/CourseCard.tsx (1)

22-22: Remove unused debugging line.

The line props.semester; appears to be leftover debugging code and should be removed.

-  props.semester;
src/components/common/Dashboard/ScheduleList.tsx (1)

6-51: Consider addressing the color criteria for remaining days mentioned in PR objectives.

The mock data currently assigns the same remainingDays value to all assignments within a schedule, but the PR objectives mention a discussion point about "criteria for changing the color of the remaining days label (whether it changes only one day before or only for the most recent item)."

The current implementation doesn't include color variation logic for the remaining days. Consider implementing this feature or adding a TODO comment to track this requirement.

Would you like me to help implement the color criteria logic for the remaining days label based on the discussion points in the PR objectives?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8797160 and 73dcf65.

⛔ Files ignored due to path filters (1)
  • public/svg/ellipsisIcon.svg is excluded by !**/*.svg
📒 Files selected for processing (10)
  • src/App.tsx (2 hunks)
  • src/assets/svg/EllipsisIcon.tsx (1 hunks)
  • src/assets/svg/index.ts (1 hunks)
  • src/components/common/Dashboard/CourseCard.tsx (1 hunks)
  • src/components/common/Dashboard/CourseList.tsx (1 hunks)
  • src/components/common/Dashboard/ScheduleCard.tsx (1 hunks)
  • src/components/common/Dashboard/ScheduleList.tsx (1 hunks)
  • src/components/common/Dashboard/types.ts (1 hunks)
  • src/index.css (1 hunks)
  • src/pages/common/Dashboard.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#6
File: src/App.tsx:6-11
Timestamp: 2025-07-16T12:33:43.839Z
Learning: JiiminHa prefers hierarchical routing structure with role-based path organization: common routes at root level (/), student-specific routes under /student prefix, and admin-specific routes under /admin prefix, using nested routes with a shared Layout component for consistent UI patterns.
src/assets/svg/index.ts (1)
Learnt from: suminb99
PR: 2025-snowCode/snowCode-Client#6
File: src/assets/svg/ChatIcon.tsx:14-14
Timestamp: 2025-07-16T13:14:38.797Z
Learning: In this project, the svgr workflow requires placing original SVG files in the `public/svg` folder first, then running `npm run svgr` command to generate converted TSX files in the `src/assets/svg` folder according to the root configuration.
src/assets/svg/EllipsisIcon.tsx (3)
Learnt from: suminb99
PR: 2025-snowCode/snowCode-Client#6
File: src/assets/svg/ChatIcon.tsx:14-14
Timestamp: 2025-07-16T13:00:01.888Z
Learning: This project uses svgr for automatic SVG to React component conversion. Running `npm run svgr` automatically converts all svgr files to React component format and handles camelCase conversion for SVG attributes (e.g., stroke-width → strokeWidth).
Learnt from: suminb99
PR: 2025-snowCode/snowCode-Client#6
File: src/assets/svg/ChatIcon.tsx:14-14
Timestamp: 2025-07-16T13:14:38.797Z
Learning: In this project, the svgr workflow requires placing original SVG files in the `public/svg` folder first, then running `npm run svgr` command to generate converted TSX files in the `src/assets/svg` folder according to the root configuration.
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
src/pages/common/Dashboard.tsx (1)
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
src/App.tsx (2)
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#6
File: src/App.tsx:6-11
Timestamp: 2025-07-16T12:33:43.839Z
Learning: JiiminHa prefers hierarchical routing structure with role-based path organization: common routes at root level (/), student-specific routes under /student prefix, and admin-specific routes under /admin prefix, using nested routes with a shared Layout component for consistent UI patterns.
src/components/common/Dashboard/ScheduleCard.tsx (1)
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
src/components/common/Dashboard/CourseList.tsx (1)
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
src/components/common/Dashboard/CourseCard.tsx (1)
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
src/components/common/Dashboard/ScheduleList.tsx (1)
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
src/components/common/Dashboard/types.ts (1)
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
🧬 Code Graph Analysis (2)
src/components/common/Dashboard/ScheduleCard.tsx (1)
src/components/common/Dashboard/types.ts (1)
  • Assignment (26-26)
src/components/common/Dashboard/CourseCard.tsx (1)
src/components/common/Dashboard/types.ts (1)
  • Course (26-26)
🔇 Additional comments (13)
src/index.css (1)

47-47: LGTM! Color variable addition follows established patterns.

The new --color-gray variable is properly placed within the @theme block and follows the existing naming convention. The light gray color (#f9f9f9) is appropriate for UI elements in the Dashboard components.

src/components/common/Dashboard/types.ts (1)

1-27: Excellent TypeScript interface design!

The type definitions are well-structured with clear separation of concerns:

  • Schedule properly references Assignment[] creating a good relationship
  • All interfaces use appropriate primitive types
  • Property names are descriptive and follow consistent naming conventions
  • The export type syntax is correctly used

This aligns with the project's preference for TypeScript interfaces providing clear structure and type safety.

src/assets/svg/index.ts (1)

4-5: EllipsisIcon follows svgr workflow and exports are correct

Verified that public/svg/ellipsisIcon.svg exists and src/assets/svg/EllipsisIcon.tsx was generated accordingly. The SVG export ordering remains alphabetical and consistent.

src/App.tsx (2)

3-3: Good import path convention.

The Dashboard import follows the established relative path pattern and is placed appropriately with other imports.


17-17: Excellent routing implementation aligns with established patterns.

The index routes for both /student and /admin paths perfectly match the hierarchical routing structure preference. Using the same Dashboard component for both roles makes sense for common functionality while maintaining the role-based path organization.

Also applies to: 23-23

src/pages/common/Dashboard.tsx (2)

1-2: Clean component imports following established patterns.

The relative imports are properly structured and follow the project's component organization.


9-12: Well-structured layout with clear component separation.

The flex layout properly separates CourseList and ScheduleList components, making the dashboard easy to understand and maintain.

src/components/common/Dashboard/ScheduleCard.tsx (1)

14-16: Text truncation implementation addresses the PR discussion point.

The use of truncate class for the assignment name effectively handles long text by showing ellipsis, which is a good solution for the text handling discussion point raised in the PR objectives. This maintains consistent card height while ensuring readability.

src/components/common/Dashboard/CourseList.tsx (1)

5-28: Mock data structure is well-organized for UI verification.

The hardcoded course data serves its purpose for UI verification as mentioned in the PR objectives. The data structure includes all necessary fields for the CourseCard component.

src/components/common/Dashboard/CourseCard.tsx (2)

6-19: Semester conversion function is well-implemented.

The getSemesterNumber function properly handles the semester string conversion with appropriate Korean translations for summer/winter terms and includes a sensible default case.


24-51: Card layout structure is well-organized.

The two-section layout effectively separates course information from the action button and statistics, creating a clean and readable interface.

src/components/common/Dashboard/ScheduleList.tsx (2)

54-59: Date formatting function is clean and effective.

The changeDateFormat function properly converts Date objects to the desired "mm.dd" format with appropriate handling of single-digit months and days.


70-90: Conditional rendering creates good visual hierarchy.

The conditional rendering logic effectively distinguishes between the first assignment (with date marker) and subsequent assignments (indented), creating a clear visual hierarchy for grouped schedules.

@suminb99 suminb99 added 🧩 feature 기능 개발 🎨 ui CSS 등 사용자 UI 디자인 변경 labels Jul 18, 2025
@suminb99 suminb99 self-assigned this Jul 19, 2025
@suminb99 suminb99 added the 🛠️ refactor 코드 리팩토링 label Jul 19, 2025
@JiiminHa JiiminHa self-requested a review July 20, 2025 09:37
Copy link
Contributor

@JiiminHa JiiminHa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/components/common/Dashboard/CourseList.tsx (1)

43-50: Improve conditional rendering with null instead of empty string.

The conditional rendering logic is correct, but using null instead of an empty string is more idiomatic in React.

        {userType === 'admin' ? (
          <button className='bg-white border-0 px-3 py-1 rounded-[10px] flex-center gap-[6px] text-base font-medium text-secondary-black'>
            <AddIcon width={12} height={12} />
            <span>추가</span>
          </button>
-        ) : (
-          ''
-        )}
+        ) : null}
src/components/common/Dashboard/CourseCard.tsx (1)

46-52: Improve conditional rendering with null instead of empty string.

Similar to the CourseList component, using null instead of an empty string is more idiomatic in React for conditional rendering.

        {userType === 'admin' ? (
          <button className='absolute right-8'>
            <EllipsisIcon width={21.2} height={5} />
          </button>
-        ) : (
-          ''
-        )}
+        ) : null}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f01c92a and 4d5ab48.

📒 Files selected for processing (5)
  • src/components/common/Dashboard/CourseCard.tsx (1 hunks)
  • src/components/common/Dashboard/CourseList.tsx (1 hunks)
  • src/components/common/Dashboard/ScheduleCard.tsx (1 hunks)
  • src/components/common/Dashboard/types.ts (1 hunks)
  • src/pages/common/Dashboard.tsx (1 hunks)
🧠 Learnings (4)
📓 Common learnings
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#6
File: src/App.tsx:6-11
Timestamp: 2025-07-16T12:33:43.867Z
Learning: JiiminHa prefers hierarchical routing structure with role-based path organization: common routes at root level (/), student-specific routes under /student prefix, and admin-specific routes under /admin prefix, using nested routes with a shared Layout component for consistent UI patterns.
src/components/common/Dashboard/CourseList.tsx (1)

Learnt from: JiiminHa
PR: #2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.

src/components/common/Dashboard/types.ts (1)

Learnt from: JiiminHa
PR: #2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.

src/components/common/Dashboard/CourseCard.tsx (1)

Learnt from: JiiminHa
PR: #2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.

🧬 Code Graph Analysis (1)
src/components/common/Dashboard/CourseList.tsx (1)
src/components/common/Dashboard/types.ts (2)
  • Course (28-28)
  • UserType (28-28)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/common/Dashboard.tsx
  • src/components/common/Dashboard/ScheduleCard.tsx
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.
Learnt from: JiiminHa
PR: 2025-snowCode/snowCode-Client#6
File: src/App.tsx:6-11
Timestamp: 2025-07-16T12:33:43.867Z
Learning: JiiminHa prefers hierarchical routing structure with role-based path organization: common routes at root level (/), student-specific routes under /student prefix, and admin-specific routes under /admin prefix, using nested routes with a shared Layout component for consistent UI patterns.
src/components/common/Dashboard/CourseList.tsx (1)

Learnt from: JiiminHa
PR: #2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.

src/components/common/Dashboard/types.ts (1)

Learnt from: JiiminHa
PR: #2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.

src/components/common/Dashboard/CourseCard.tsx (1)

Learnt from: JiiminHa
PR: #2
File: src/components/Header/StudentHeader.tsx:10-10
Timestamp: 2025-07-13T00:27:31.464Z
Learning: Using TypeScript interfaces for React component props (like StudentHeaderProps) provides clear structure, improves readability, and makes components more maintainable and extensible for future development.

🧬 Code Graph Analysis (1)
src/components/common/Dashboard/CourseList.tsx (1)
src/components/common/Dashboard/types.ts (2)
  • Course (28-28)
  • UserType (28-28)
🔇 Additional comments (7)
src/components/common/Dashboard/types.ts (1)

1-28: Well-structured TypeScript definitions for Dashboard feature.

The type definitions are comprehensive and well-organized. The UserType union type clearly distinguishes between user roles, and the interfaces provide strong typing for the Dashboard components. This aligns with the preference for TypeScript interfaces to improve code structure and maintainability.

src/components/common/Dashboard/CourseList.tsx (3)

6-29: Mock data structure aligns well with Course interface.

The hardcoded course data properly matches the Course interface definition and provides good test data for UI development. The data structure is comprehensive and realistic.


31-33: Well-defined props interface following TypeScript best practices.

The CourseListProps interface correctly extends the component's typing requirements and aligns with the preference for using TypeScript interfaces for React component props.


53-55: Correct use of key prop and spread operator for course data.

The mapping logic properly uses the course ID as the key and spreads the course properties to the CourseCard component. The userType prop is correctly passed down.

src/components/common/Dashboard/CourseCard.tsx (3)

4-6: Well-structured props interface extending Course type.

The CourseCardProps interface correctly extends the Course interface and adds the userType property, following TypeScript best practices for component props.


35-44: Well-structured course information display.

The course information section properly displays the formatted semester, year, section, title, and description with appropriate styling and text hierarchy.


53-62: Clean layout for unit and assignment count display.

The statistics section effectively displays unit count and assignment count with proper visual separation and formatting.

Comment on lines +8 to +21
const getSemesterNumber = (semester: string): string => {
switch (semester) {
case 'FIRST':
return '1';
case 'SUMMER':
return '여름';
case 'SECOND':
return '2';
case 'WINTER':
return '겨울';
default:
return 'unknown';
}
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove unsupported 'WINTER' case from semester mapping.

The getSemesterNumber function includes a 'WINTER' case, but the Course interface in types.ts only defines semester as 'FIRST' | 'SECOND' | 'SUMMER'. This creates an inconsistency.

const getSemesterNumber = (semester: string): string => {
  switch (semester) {
    case 'FIRST':
      return '1';
    case 'SUMMER':
      return '여름';
    case 'SECOND':
      return '2';
-    case 'WINTER':
-      return '겨울';
    default:
      return 'unknown';
  }
};
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const getSemesterNumber = (semester: string): string => {
switch (semester) {
case 'FIRST':
return '1';
case 'SUMMER':
return '여름';
case 'SECOND':
return '2';
case 'WINTER':
return '겨울';
default:
return 'unknown';
}
};
const getSemesterNumber = (semester: string): string => {
switch (semester) {
case 'FIRST':
return '1';
case 'SUMMER':
return '여름';
case 'SECOND':
return '2';
default:
return 'unknown';
}
};
🤖 Prompt for AI Agents
In src/components/common/Dashboard/CourseCard.tsx between lines 8 and 21, remove
the 'WINTER' case from the getSemesterNumber function to align with the Course
interface in types.ts, which only supports 'FIRST', 'SECOND', and 'SUMMER'
semesters. Adjust the switch statement to exclude 'WINTER' and ensure the
default case handles any unexpected values.

@suminb99 suminb99 merged commit 33d85c3 into develop Jul 23, 2025
1 check was pending
@suminb99 suminb99 deleted the feat/#3-dashboard branch July 23, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧩 feature 기능 개발 🛠️ refactor 코드 리팩토링 🎨 ui CSS 등 사용자 UI 디자인 변경

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants