Skip to content

refactor(Button): Button 컴포넌트 variant 추가 - #287

Open
imddoy wants to merge 9 commits into
mainfrom
refactor/button-theme-sync
Open

imddoy wants to merge 9 commits into
mainfrom
refactor/button-theme-sync

Conversation

@imddoy

@imddoy imddoy commented Sep 30, 2025

Copy link
Copy Markdown

변경사항

링크

시급한 정도

🏃‍♂️ 보통 : 최대한 빠르게 리뷰 부탁드립니다.

기타 사항

@height

height Bot commented Sep 30, 2025

Copy link
Copy Markdown

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@changeset-bot

changeset-bot Bot commented Sep 30, 2025 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e2ea234

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@imddoy imddoy self-assigned this Sep 30, 2025

@constantly-dev constantly-dev 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.

수고하셨습니다! 코멘트 확인해주세요~

Comment thread packages/ui/Button/Button.tsx Resolved
Comment thread packages/ui/Button/hooks.ts Resolved
rounded?: 'md' | 'lg';
}

export const useResolvedProps = ({ intent, shape, theme, rounded }: UseResolvedProps) => {

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.

button 컴포넌트 interface가 변경되면서 useResolvedProps로 이전 interface의 호환성을 가져가기 위함이 맞을까요?
물론 개인적인 생각이지만 호환성을 위해서는 필요하지만 이렇게 진행하게 되면 결국 레거시가 또 추가되는 느낌이 들어서..! 이후에 각 팀에서 interface 최신화해주고, 없애는 것은 어떨까요?

Comment thread packages/ui/Button/hooks.ts Resolved
const [scrollDirection, setScrollDirection] = useState<'up' | 'down' | null>(null);

useEffect(() => {
let lastScrollY = window.pageYOffset;

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.

클로저로 구현된 거 같은데 맞을까요?? 지금도 잘 작동할 것 같고 useRef를 사용해도 동일하게 작동하겠네요!

Comment thread packages/ui/Button/utils.ts Resolved
Comment thread packages/ui/Button/Button.tsx Resolved
Comment thread packages/ui/Button/Button.tsx Resolved

@constantly-dev constantly-dev 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.

👀

Comment thread packages/ui/Button/utils.ts Resolved
Comment thread packages/ui/Button/utils.ts Resolved
Comment on lines +4 to +9
interface UseResolvedProps {
intent: ButtonIntent;
shape: ButtonShape;
theme?: ButtonColorTheme;
rounded?: 'md' | 'lg';
}

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.

Suggested change
interface UseResolvedProps {
intent: ButtonIntent;
shape: ButtonShape;
theme?: ButtonColorTheme;
rounded?: 'md' | 'lg';
}
type UseResolvedProps = Pick<ButtonProps, pick_union>

새로 작성하지 않는게 좋을 것 같아요

@jeonghoon11 jeonghoon11 Apr 27, 2026 •

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.

hooks.ts에서 Button.tsx의 타입을 참조하면 Button.tsx -> hooks.ts, hooks.ts -> Button.tsx 형태로 순환참조가 걸릴것 같아요! 그래도 일단 ButtonProps를 import할 때 import type으로 import해와서 사용하는게 좋을까요?

Comment thread packages/ui/Button/Button.tsx Resolved
@jeonghoon11

Copy link
Copy Markdown
Member

@imddoy 이번 스프린트에서 급하게 Button 컴포넌트에 variants로 text 추가된걸 사용해야돼서 제가 수정했어요.. 사과드립니다..

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants