Skip to content

뱃지 컴포넌트 구현#25

Merged
jungwon123 merged 2 commits into
mainfrom
feat/badge
Feb 8, 2026
Merged

뱃지 컴포넌트 구현#25
jungwon123 merged 2 commits into
mainfrom
feat/badge

Conversation

@jungwon123

Copy link
Copy Markdown
Contributor

Summary

  • 이 PR에서 변경한 내용 한 줄 요약

Issue

  • Closes 뱃지 컴포넌트 개발 #14

  • 특이사항
    피그마 아이콘 모음에는 없지만 컴포넌트 피그마 사용화면에는 아이콘이 있습니다. 이 부분은 피그마 설계 잘못인거같습니다.
    그리하여 상태 없음을 나타내는 0/0일때 아이콘을 작은버전 , 큰버전으로 추가했습니다.

@jungwon123 jungwon123 added this to the 컴포넌트 milestone Feb 4, 2026
@jungwon123 jungwon123 added the 기능추가 기능개발 및 추가할 때 사용해주세요. label Feb 4, 2026
@github-project-automation github-project-automation Bot moved this to 개발 대기중 in workers Feb 4, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jungwon123, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 애플리케이션의 다양한 상태를 시각적으로 표현하기 위한 새로운 Badge 컴포넌트를 도입합니다. 이 컴포넌트는 '완료', '진행 중', '시작 전'과 같은 상태를 나타내며, 두 가지 크기 옵션을 제공합니다. Storybook을 통해 컴포넌트의 모든 변형을 쉽게 확인하고 테스트할 수 있으며, 접근성을 고려한 구현이 포함되어 있습니다.

Highlights

  • 뱃지 컴포넌트 구현: 상태(완료, 진행 중, 시작 전)와 크기(작게, 크게)를 지원하는 새로운 뱃지 컴포넌트가 구현되었습니다.
  • 새로운 SVG 아이콘 추가: 상태 없음(empty)을 나타내는 작은 버전과 큰 버전의 SVG 아이콘이 추가되었습니다.
  • Storybook 통합: 새로운 뱃지 컴포넌트의 다양한 상태와 크기를 시각적으로 확인하고 테스트할 수 있도록 Storybook 스토리가 추가되었습니다.
  • 접근성 고려: 스크린리더 사용자를 위해 aria-label 속성을 통해 뱃지 상태와 레이블을 명확하게 전달하도록 구현되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/assets/icons/state/stateEmptyLarge.svg
    • 상태 없음(empty)을 나타내는 큰 크기의 SVG 아이콘이 추가되었습니다.
  • src/assets/icons/state/stateEmptySmall.svg
    • 상태 없음(empty)을 나타내는 작은 크기의 SVG 아이콘이 추가되었습니다.
  • src/components/badge/Badge.stories.tsx
    • 새로운 Badge 컴포넌트의 Storybook 스토리가 추가되었습니다.
    • 완료(Done), 진행 중(Ongoing), 시작 전(Empty) 상태와 큰(Large) 크기를 보여주는 스토리가 포함되었습니다.
    • 모든 상태와 크기를 한눈에 볼 수 있는 Overview 스토리가 추가되었습니다.
  • src/components/badge/Badge.tsx
    • 핵심 Badge 컴포넌트가 구현되었습니다.
    • state, size, label prop을 받아 뱃지를 렌더링합니다.
    • 상태와 크기에 따라 적절한 아이콘과 스타일을 적용합니다.
    • 스크린리더를 위한 aria-label을 동적으로 생성합니다.
  • src/components/badge/constants/badgeConstants.ts
    • 뱃지 상태에 따른 레이블(BADGE_STATE_LABEL)과 아이콘 경로 및 크기(BADGE_STYLE)를 정의하는 상수가 추가되었습니다.
  • src/components/badge/index.ts
    • Badge 컴포넌트와 관련 타입(BadgeProps, BadgeState, BadgeSize)을 외부로 내보내기 위한 인덱스 파일이 추가되었습니다.
  • src/components/badge/styles/Badge.module.css
    • Badge 컴포넌트의 스타일을 정의하는 CSS 모듈 파일이 추가되었습니다.
    • 기본 뱃지 스타일, 크기별 스타일(large, small), 상태별 색상(done, ongoing, empty)이 포함되었습니다.
  • src/components/badge/types/types.ts
    • BadgeState, BadgeSize, BadgeProps 타입을 정의하는 TypeScript 타입 파일이 추가되었습니다.
Activity
  • 이 PR은 뱃지 컴포넌트 구현이라는 새로운 기능을 도입합니다.
  • 이슈 #14를 해결합니다.
  • 피그마 디자인과의 불일치로 인해 '상태 없음' 아이콘이 작은 버전과 큰 버전으로 추가되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

이 PR은 새로운 뱃지 컴포넌트를 구현하는군요. 전반적으로 코드가 깔끔하고, Storybook을 통한 컴포넌트 문서화도 잘 되어 있습니다. 접근성을 고려한 aria-label 사용도 좋습니다. 몇 가지 유지보수성 및 시맨틱 개선을 위한 제안 사항을 리뷰 코멘트로 남겼습니다.

return (
<span
className={clsx(styles.badge, styles[size], styles[state])}
role="img"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

role="img"는 시각적인 그림 콘텐츠에 사용하는 것이 적합합니다. 뱃지는 상태를 나타내는 정보이므로, role="status"를 사용하는 것이 시맨틱적으로 더 올바른 표현입니다. 스크린리더 사용자에게 더 명확한 의미를 전달할 수 있습니다.

Suggested change
role="img"
role="status"

Comment on lines +1 to +23
import type { BadgeState } from '../types/types';

import stateDoneLarge from '@/assets/icons/state/stateDoneLarge.svg';
import stateDoneSmall from '@/assets/icons/state/stateDoneSmall.svg';
import stateOngoingLarge from '@/assets/icons/state/stateOngoingLarge.svg';
import stateOngoingSmall from '@/assets/icons/state/stateOngoingSmall.svg';
import stateEmptyLarge from '@/assets/icons/state/stateEmptyLarge.svg';
import stateEmptySmall from '@/assets/icons/state/stateEmptySmall.svg';

export const BADGE_STATE_LABEL: Record<BadgeState, string> = {
done: '완료',
ongoing: '진행 중',
empty: '시작 전',
} as const;

export const BADGE_STYLE = {
icons: {
done: { large: stateDoneLarge, small: stateDoneSmall },
ongoing: { large: stateOngoingLarge, small: stateOngoingSmall },
empty: { large: stateEmptyLarge, small: stateEmptySmall },
},
iconSize: { large: 20, small: 16 },
} as const;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

BADGE_STYLE 상수에 명시적인 타입을 지정하여 유지보수성을 향상시키는 것이 좋습니다. BadgeStateBadgeSize에 새로운 값이 추가될 경우, BADGE_STYLE 객체도 함께 수정해야 함을 타입스크립트 컴파일러가 강제해줘서 실수를 방지할 수 있습니다.

StaticImageData 타입을 사용하기 위해 next/image에서 임포트하고, BadgeSize 타입도 임포트하도록 수정했습니다.

import type { StaticImageData } from 'next/image';
import type { BadgeState, BadgeSize } from '../types/types';

import stateDoneLarge from '@/assets/icons/state/stateDoneLarge.svg';
import stateDoneSmall from '@/assets/icons/state/stateDoneSmall.svg';
import stateOngoingLarge from '@/assets/icons/state/stateOngoingLarge.svg';
import stateOngoingSmall from '@/assets/icons/state/stateOngoingSmall.svg';
import stateEmptyLarge from '@/assets/icons/state/stateEmptyLarge.svg';
import stateEmptySmall from '@/assets/icons/state/stateEmptySmall.svg';

export const BADGE_STATE_LABEL: Record<BadgeState, string> = {
  done: '완료',
  ongoing: '진행 중',
  empty: '시작 전',
} as const;

type BadgeStyle = {
  icons: Record<BadgeState, Record<BadgeSize, StaticImageData>>;
  iconSize: Record<BadgeSize, number>;
};

export const BADGE_STYLE: BadgeStyle = {
  icons: {
    done: { large: stateDoneLarge, small: stateDoneSmall },
    ongoing: { large: stateOngoingLarge, small: stateOngoingSmall },
    empty: { large: stateEmptyLarge, small: stateEmptySmall },
  },
  iconSize: { large: 20, small: 16 },
} as const;

@jungwon123 jungwon123 changed the title feat: 뱃지 컴포넌트 구현 뱃지 컴포넌트 구현 Feb 4, 2026
@jungwon123 jungwon123 merged commit 5993f81 into main Feb 8, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from 개발 대기중 to 개발 완료 in workers Feb 8, 2026
@jungwon123 jungwon123 deleted the feat/badge branch February 20, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

기능추가 기능개발 및 추가할 때 사용해주세요.

Projects

Status: 개발 완료

Development

Successfully merging this pull request may close these issues.

뱃지 컴포넌트 개발

3 participants