-
Notifications
You must be signed in to change notification settings - Fork 3
feat: 팀 상태바 컴포넌트 추가 #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import styles from './style/TeamStatusBar.module.css'; | ||
| import type { TeamStatusBarProps } from './interface/interface'; | ||
| import Image from 'next/image'; | ||
| import settingBigIcon from '@/assets/icons/setting/SettingBig.svg'; | ||
| import ProgressBar from '../progressbar'; | ||
|
|
||
| export default function TeamStatusBar({ | ||
| title, | ||
| percentage, | ||
| taskCount, | ||
| completed, | ||
| }: TeamStatusBarProps) { | ||
| return ( | ||
| <section className={styles.mainContainer} aria-label={title}> | ||
| <h2 className={styles.title}>{title}</h2> | ||
| <header className={styles.subContainer}> | ||
| <dl> | ||
| <dt className={styles.subTitle}>오늘의 진행 상황</dt> | ||
| <dd className={styles.percent}>{percentage}%</dd> | ||
| </dl> | ||
| <dl className={styles.countContainer}> | ||
| <div> | ||
| <dt className={styles.subTitle}>오늘의 할 일</dt> | ||
| <dd className={styles.taskNumber}>{taskCount}</dd> | ||
| </div> | ||
| <span className={styles.line} role="separator" aria-hidden /> | ||
| <div> | ||
| <dt className={styles.subTitle}>완료 🙌</dt> | ||
| <dd className={styles.completedNumber}>{completed}</dd> | ||
| </div> | ||
| </dl> | ||
| </header> | ||
|
|
||
| <div className={styles.barContainer}> | ||
| <ProgressBar | ||
| value={percentage / 100} | ||
| done={completed} | ||
| total={taskCount} | ||
| ariaLabel="team progress" | ||
| className={styles.progressBar} | ||
| /> | ||
| <button className={styles.settingButton} aria-label="settings"> | ||
| <Image src={settingBigIcon} alt="" width={24} height={24} /> | ||
| </button> | ||
| </div> | ||
| </section> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export interface TeamStatusBarProps { | ||
| title: string; | ||
| percentage: number; | ||
| taskCount: number; | ||
| completed: number; | ||
| } | ||
|
Comment on lines
+1
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 컴포넌트 API 설계에 대한 제안입니다. 데이터의 단일 공급원(Single Source of Truth) 원칙을 따르기 위해, 이렇게 하면 다음과 같은 이점이 있습니다:
이 변경을 적용하면 |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시맨틱 HTML 구조 개선을 제안합니다. 현재
<dl>요소의 자식으로<div>와<span>이 함께 사용되고 있는데, 이는 HTML 명세에 맞지 않습니다.<dl>요소는<dt>,<dd>, 또는 이들을 감싸는<div>그룹만을 자식으로 가질 수 있습니다. 유효한 HTML 구조를 위해 바깥쪽<dl>을<div>로 변경하고, 각 용어-설명 쌍을 별도의<dl>로 감싸는 것을 제안합니다. 이렇게 하면 스타일링을 위한 레이아웃을 유지하면서도 시맨틱 마크업을 준수할 수 있습니다.