Skip to content

feat: 코스 지속시간을 원형으로 보여주는 DurationBadge 컴포넌트 추가 - #18

Open
hamxxn wants to merge 3 commits into
developfrom
feat/issue-17
Open

feat: 코스 지속시간을 원형으로 보여주는 DurationBadge 컴포넌트 추가#18
hamxxn wants to merge 3 commits into
developfrom
feat/issue-17

Conversation

@hamxxn

@hamxxn hamxxn commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

minutes(분)를 받아 점선 원형 배지로 표시하는 순수 표시용 DurationBadge를 추가했다. 파란 아크 길이가 minutes/60에 비례해 채워진다(15분→1/4, 30분→1/2, 45분→3/4, 60분→풀서클).

Related Issues

PR Point (To Reviewer)

  • 이슈 본문에는 배경이 50/50 고정 분할, className으로 크기 지정이라고 적혀 있지만, 이후 대화에서 Figma를 더 자세히 보고 두 가지를 바꿨다: (1) 링의 파란 부분이 minutes/60 비율로 채워지는 진행률 형태라는 걸 확인해서 고정 분할 대신 describeArc/polarToCartesian로 각도를 계산하도록 구현, (2) 텍스트+패딩(가로 1rem/세로 1.4rem, Figma auto-layout 스펙) 기준 고정 크기(6.2rem)로 바꿔서 더 이상 className으로 크기를 지정하지 않는다. 둘 다 의도된 변경이라 이슈 텍스트가 낡은 상태다.
  • svgo가 아이콘마다 붙이는 짧은 id 충돌 문제와 비슷하게, 이 컴포넌트도 여러 개를 한 화면에 렌더링하면 파란/회색 dash가 만나는 이음새에서 점이 두 개로 겹쳐 보이는 버그가 있었다. stroke-dashoffset으로 dash 위상을 반 칸 밀어서 이음새에 점 하나만 정중앙에 오도록 고쳤다(DASH_OFFSET).
  • minutes가 60을 초과하면 throw한다 (에러 바운더리 없는 상태라 렌더링이 그대로 중단됨 — 의도된 동작).
  • 색상은 하드코딩 hex 대신 stroke-secondary-200/stroke-gray-60 토큰 클래스를 쓴다(코드리뷰 반영 — 기존 --color-secondary-200: #a9def0, --color-gray-60: #878a93와 값이 정확히 일치).
  • 코드리뷰 반영: (1) 바깥 원 크기를 6.2rem7.4rem으로 키웠다 — 안쪽 패딩(p-[0.6rem])만큼 원이 작아 보였던 문제. (2) 분 숫자 타이포를 typo-title-2-regulartypo-title-2-5-regular로 수정. (3) 숫자/분 정렬을 items-center에서 items-baseline으로 바꾸되, 그대로 두면 그룹 전체가 컨테이너 안에서 위로 치우쳐 보여서 숫자/분을 감싸는 wrapper span을 하나 추가해 baseline 정렬은 wrapper 내부에서만 적용하고 바깥은 다시 items-center로 wrapper 전체를 가운데 정렬했다.

Screenshot

스크린샷 2026-08-08 오후 1 24 09

ETC

없음

hamxxn added 2 commits August 8, 2026 13:30
minutes(분)를 받아 점선 원형 배지로 표시하는 순수 표시용 컴포넌트.
파란 아크 길이가 minutes/60에 비례해 채워지고(15분->1/4, 60분->풀서클),
60 초과 값은 에러를 던진다. 클릭/선택 상태는 없음.
@hamxxn hamxxn self-assigned this Aug 8, 2026
@hamxxn hamxxn linked an issue Aug 8, 2026 that may be closed by this pull request
5 tasks
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aligner Ready Ready Preview Aug 11, 2026 12:35am

@hamxxn hamxxn changed the title 코스 지속시간을 원형으로 보여주는 DurationBadge 컴포넌트 추가 feat: 코스 지속시간을 원형으로 보여주는 DurationBadge 컴포넌트 추가 Aug 8, 2026

@sohxxny sohxxny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

코멘트만 확인 부탁드립니다!

Comment thread src/shared/ui/duration-badge/DurationBadge.tsx
Comment thread src/shared/ui/duration-badge/DurationBadge.tsx Outdated
Comment thread src/shared/ui/duration-badge/DurationBadge.tsx Outdated
- 배지 크기를 6.2rem -> 7.4rem으로 키워서 안쪽 패딩만큼 원이
  작아 보이던 문제를 해결
- 분 숫자 타이포를 typo-title-2-regular -> typo-title-2-5-regular로 수정
- 숫자/분 그룹을 wrapper span으로 감싸 baseline 정렬은 그 안에서만
  적용하고, 바깥은 다시 items-center로 컨테이너 가운데 정렬되게 함

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@thwjddlqslek thwjddlqslek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

수고하셨습니다~ 리뷰 확인하시고 머지해도 좋을 것 같아요!

)}
</svg>
<div className="absolute inset-0 flex items-center justify-center px-[1rem] py-[1.4rem] leading-none text-white">
<span className="flex items-baseline leading-none">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

여기 leading-none은 부모 div에 이미 있어서 상속되니 중복이라 제거해도 될 것 같아요!

@@ -0,0 +1,104 @@
import { cn } from "@/shared/lib/cn";

const MAX_MINUTES = 60;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

저희 코스 중에 60분 초과하는 코스가 없는지 확인이 필요할 것 같아요. 우선 요대로 가시죵

@sohxxny sohxxny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

수정사항 확인했습니다~!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

코스 지속시간을 원형으로 보여주는 DurationBadge 컴포넌트 추가

3 participants