Skip to content

[Ui/#13] 공통 컴포넌트 제작 - #14

Merged
sungtaegyeong merged 13 commits into
devfrom
ui/13-common-ui
Jul 31, 2026
Merged

[Ui/#13] 공통 컴포넌트 제작#14
sungtaegyeong merged 13 commits into
devfrom
ui/13-common-ui

Conversation

@yewon20804

Copy link
Copy Markdown
Member

📌 관련 이슈번호

📌 PR 유형

어떤 변경 사항이 있나요?

  • 새 기능 추가
  • 버그 수정
  • 리팩토링

📌 PR 요약

공통 컴포넌트를 제작 및 기타 설정을 진행했습니다.

📌 작업 세부 내용

공통 컴포넌트 제작

1. 플로팅 버튼 (Fab)

2. 상단 앱바 헤더 (Header)

  • HeaderContainer(공통 셸: 배경/보더/높이/패딩) + BackHeader/LogoHeader/CloseHeader로 역할별 분리
  • 각 헤더에서 HeaderContainer를 내부에서 감싸는 구조
  • CloseHeader의 아이콘 색상이 토큰으로 안되어 있어서 gray-800으로 처리
  • CheckTask 로고 에셋 추가

3. 버튼 (Button)

  • variant(blue/gray/outline/white) × size(tiny/sm/modal/lg/xl) 조합
  • disabled는 동일한 톤이라 별도 조건문으로 분리
  • 버튼의 w는 sm는 고정 너비, tiny는 w-auto, 나머지는 페이지or모달에서 여백으로 처리되기 때문에 고정값이 아닌 w-full로 지정했습니다.

4. 아이콘 버튼 (IconButton)

  • 페이지를 봤을때 + 아이콘인 경우가 많아 기본값을 Add 아이콘으로 처리, 다른 아이콘으로 교체 가능

기타 설정

  • 아이콘 사이즈 체계에 xl(28px), 2xl(32px)추가
  • Fab에 사용되는 그림자 상수(FAB_PRIMARY_SHADOW, FAB_SECONDARY_SHADOW) 추가
  • Storybook 프리뷰에 backgrounds(dark/light) 옵션 추가
  • husky pre-commit이 GUI Git 툴에서 npx 못 찾던 문제 수정(PATH 보정)
  • 임시 버튼 + 스토리 제거

📸 스크린샷

image image image image image image

🔗 기타 (공유사항)

  • date/month 는 캘린더 커스텀 시, 과제 박스(메인 페이지에서만 사용)은 UI 제작때 진행하겠습니다

@yewon20804 yewon20804 self-assigned this Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5124630c-ac7a-4ed6-b6f6-7d89f8625602

📥 Commits

Reviewing files that changed from the base of the PR and between e86c5db and 68c02d0.

📒 Files selected for processing (2)
  • components/common/Button/Button.tsx
  • components/common/IconButton/IconButton.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/common/IconButton/IconButton.tsx
  • components/common/Button/Button.tsx

Walkthrough

공통 Button, Fab, Header, IconButton 컴포넌트와 Storybook 스토리를 추가했습니다. 기존 Button 경로와 HomeScreen 여백을 변경하고, 아이콘 크기와 그림자 상수를 확장했습니다.

Changes

공통 UI 컴포넌트

Layer / File(s) Summary
Button 계약과 렌더링
components/common/Button/*, app/(tabs)/index.tsx, components/button.tsx, components/button.stories.tsx
Button 컴포넌트에 variant, size, 비활성화 상태, 접근성 속성, 사용자 정의 클래스를 추가했습니다. HomeScreen의 import 경로와 좌우 여백을 변경하고 기존 Button 파일과 스토리를 삭제했습니다.
Fab 상태와 액션
components/common/Fab/*, constants/shadows.ts
Fab의 열림 상태 전환, 과제 액션 콜백, 접근성 속성, 아이콘과 그림자 스타일을 추가했습니다.
Header와 IconButton 구성
components/common/Header/*, components/common/IconButton/*, components/icons/icon.types.ts
뒤로가기, 닫기, 로고 Header와 IconButton을 추가했습니다. Header와 IconButton Storybook 스토리 및 xl, 2xl 아이콘 크기를 추가했습니다.
Storybook과 개발 실행 설정
.storybook/preview.tsx, .husky/pre-commit
Storybook에 dark 및 light 배경 옵션을 추가했습니다. pre-commit 실행 전에 /usr/local/binPATH 앞에 추가합니다.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 공통 컴포넌트 제작이라는 PR의 주요 변경 사항을 간결하게 설명합니다.
Description check ✅ Passed 이슈 번호, 변경 유형, 요약, 세부 내용, 스크린샷 및 공유사항을 포함해 템플릿을 대부분 충족합니다.
Linked Issues check ✅ Passed [#13]의 버튼, 탑 앱 바, 플로팅 버튼 제작 목표를 구현했고 관련 공통 UI 컴포넌트도 추가했습니다.
Out of Scope Changes check ✅ Passed 변경 사항은 [#13]의 공통 UI 컴포넌트 제작과 관련 설정 및 임시 코드 제거 범위에 포함됩니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ui/13-common-ui

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

🤖 PR Checks 결과

체크 항목 결과
Lint
Typecheck
Expo Doctor

워크플로우 로그 보기

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (1)
components/common/Button/Button.tsx (1)

39-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

ButtonProps를 파일 상단으로 이동하세요.

ButtonProps는 스타일 상수 뒤에 선언되어 있습니다. import와 관련 타입 선언 직후에 선언하세요.

As per path instructions, “props 타입은 파일 상단에 type XxxProps = {} 형태로 선언”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/common/Button/Button.tsx` around lines 39 - 46, Move the
ButtonProps type declaration to the top of Button.tsx, immediately after the
imports and related type declarations, before the style constants. Keep the
existing type shape and export unchanged.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@components/common/Fab/Fab.stories.tsx`:
- Around line 14-20: Remove pointerEvents="none" from the View wrapper in the
decorators configuration so the Fab Storybook story allows interaction with the
FAB toggle and secondary Pressable actions.

In `@components/common/IconButton/IconButton.tsx`:
- Around line 9-13: Update the IconButtonProps type so onPress is required,
ensuring every IconButton rendered as a button has an action. Do not add
disabled-state handling unless onPress must remain optional.

---

Nitpick comments:
In `@components/common/Button/Button.tsx`:
- Around line 39-46: Move the ButtonProps type declaration to the top of
Button.tsx, immediately after the imports and related type declarations, before
the style constants. Keep the existing type shape and export unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: db495353-a12d-4eb8-8955-dd06c56002cf

📥 Commits

Reviewing files that changed from the base of the PR and between c4dc212 and e86c5db.

⛔ Files ignored due to path filters (1)
  • assets/images/checktask-logo.png is excluded by !**/*.png, !**/assets/**
📒 Files selected for processing (18)
  • .husky/pre-commit
  • .storybook/preview.tsx
  • app/(tabs)/index.tsx
  • components/button.stories.tsx
  • components/button.tsx
  • components/common/Button/Button.stories.tsx
  • components/common/Button/Button.tsx
  • components/common/Fab/Fab.stories.tsx
  • components/common/Fab/Fab.tsx
  • components/common/Header/BackHeader.tsx
  • components/common/Header/CloseHeader.tsx
  • components/common/Header/Header.stories.tsx
  • components/common/Header/HeaderContainer.tsx
  • components/common/Header/LogoHeader.tsx
  • components/common/IconButton/IconButton.stories.tsx
  • components/common/IconButton/IconButton.tsx
  • components/icons/icon.types.ts
  • constants/shadows.ts
💤 Files with no reviewable changes (2)
  • components/button.tsx
  • components/button.stories.tsx

Comment on lines +14 to +20
decorators: [
(Story) => (
<View pointerEvents="none">
<Story />
</View>
),
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- target file ---'
cat -n components/common/Fab/Fab.stories.tsx
printf '%s\n' '--- related Fab files ---'
fd -i 'Fab' components/common/Fab
printf '%s\n' '--- pointerEvents usage ---'
rg -n --glob '*.tsx' --glob '*.ts' 'pointerEvents|Fab.stories|<Pressable|onPress' components/common/Fab components 2>/dev/null | head -200

Repository: check-task/mobile-frontend

Length of output: 4610


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- Fab implementation ---'
cat -n components/common/Fab/Fab.tsx
printf '%s\n' '--- package/runtime context ---'
rg -n '"react-native"|"react-native-web"|"`@storybook/react-native-web-vite`"|storybook' package.json pnpm-lock.yaml yarn.lock package-lock.json 2>/dev/null | head -120
printf '%s\n' '--- Storybook configuration ---'
fd -i 'storybook' . --exclude node_modules --exclude dist --exclude build

Repository: check-task/mobile-frontend

Length of output: 11438


🌐 Web query:

React Native View pointerEvents="none" children touch events react-native-web documentation

💡 Result:

In React Native and React Native for Web, the pointerEvents prop on a View component determines how that view and its children respond to touch events [1][2]. When you set pointerEvents="none" on a View, the View itself becomes transparent to all touch events, and crucially, all of its children are also excluded from receiving touch events [1][3]. If your goal is to make a parent View ignore touch events while allowing its children to remain interactive, you should use pointerEvents="box-none" instead [1][4]. Summary of pointerEvents values: - auto: The View and its children can be targets of touch events (default) [1]. - none: Neither the View nor its children can be targets of touch events [1][3]. - box-none: The View is never the target of touch events, but its subviews (children) can be [1][4]. - box-only: The View can be the target of touch events, but its subviews cannot be [1][3]. This behavior is consistent across both React Native and React Native for Web [2][3][5]. In the context of React Native for Web, these values are implemented by applying specific CSS pointer-events rules to the container and its children [2][6]. Note that pointerEvents is a property of the View component, not a CSS style, and must be passed as a prop [4].

Citations:


pointerEvents="none"을 제거하세요.

이 설정은 Fab 내부의 모든 Pressable 입력을 차단합니다. 제거하면 Storybook에서 FAB 토글과 보조 액션을 사용할 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/common/Fab/Fab.stories.tsx` around lines 14 - 20, Remove
pointerEvents="none" from the View wrapper in the decorators configuration so
the Fab Storybook story allows interaction with the FAB toggle and secondary
Pressable actions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

보조 액션 없이 그 상태가 보이도록 하려고 추가했습니다

Comment on lines +9 to +13
export type IconButtonProps = {
label: string;
icon?: ReactNode;
onPress?: () => void;
className?: string;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

onPress가 없을 때 비활성 상태를 명시하세요.

현재 계약은 동작이 없는 IconButton 생성을 허용합니다. 하지만 Line 24는 항상 이 요소를 버튼으로 노출합니다. 사용자는 버튼을 누를 수 있다고 인식하지만 아무 동작도 수행할 수 없습니다.

onPress를 필수 prop으로 변경하세요. 선택적으로 유지해야 하면 disabled prop, accessibilityState={{ disabled: true }}, 비활성 스타일을 추가하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@components/common/IconButton/IconButton.tsx` around lines 9 - 13, Update the
IconButtonProps type so onPress is required, ensuring every IconButton rendered
as a button has an action. Do not add disabled-state handling unless onPress
must remain optional.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

onPress 여부 기준으로 accessibilityRole가 버튼인지 아닌지로 조건으로 처리했고, 비활성 스타일은 따로 없습니다리

@sungtaegyeong
sungtaegyeong merged commit d5a547d into dev Jul 31, 2026
5 checks passed
@sungtaegyeong
sungtaegyeong deleted the ui/13-common-ui branch July 31, 2026 04:43
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.

[Feat] 공통 컴포넌트 제작

2 participants