Skip to content

Conversation

@wuzoo
Copy link
Member

@wuzoo wuzoo commented Sep 30, 2025

변경사항

바텀싯 컴포넌트를 구현하였습니다.

링크

시급한 정도

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

기타 사항

커밋 보시면서 리뷰해주시면 더 편하실 거에요

@height
Copy link

height bot commented Sep 30, 2025

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
Copy link

changeset-bot bot commented Sep 30, 2025

⚠️ No Changeset found

Latest commit: 8c82c1c

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

@wuzoo wuzoo self-assigned this Sep 30, 2025
Copy link

@constantly-dev constantly-dev left a comment

Choose a reason for hiding this comment

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

수고하셨습니다! 코드 깔끔한 것 같아요!
질문드리고 싶은 점이 구현하신 것처럼 제어/비제어의 경우를 모두 고려해 구현하신 이유가 사용 방법에 대한 선택을 더 많이 주기 위함인가요?

Choose a reason for hiding this comment

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

각 스토리 따로는 괜찮은데 docs 전체에서는 bottomSheet가 내부 wrapper에 의해서 짤리는 것 같아요.

image

portal이나 dialog, z-index 중 하나만 쓰면 해결될 것 같은데 혹시 궁금한 점이 portal 등을 사용하지 않아도 레이어 우선순위 관련해서 문제가 없을까요?

modal이나 bottomsheet 등의 컴포넌트를 구현할 때 평소에는 어떤 걸 사용하시는 지도 궁금합니다!

const context = useContext(BottomSheetContext);

if (context === null) {
throw new Error('this hook muse be used within a BottomSheetProvider');

Choose a reason for hiding this comment

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

사소하지만 muse -> must 오타인 것 같습니다!

Comment on lines +21 to +29
export function BottomSheetTrigger({ children }: HTMLAttributes<HTMLButtonElement>) {
const { open, onOpenChange } = useBottomSheetContext();

const handleOpenChange = () => {
onOpenChange(!open);
};

return <div onClick={handleOpenChange}>{children}</div>;
}

Choose a reason for hiding this comment

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

triggerbutton의 역할을 하지 않는 경우 때문에 div로 두신 걸까요??

Comment on lines +84 to +96
return (
open && (
<div className={overlayStyle}>
{title && (
<div className={titleWrapperStyle}>
{backIcon && <IconChevronLeft onClick={() => onOpenChange(false)} className={iconStyle} />}
<p className={titleTextStyle}>{title}</p>
</div>
)}
{children}
</div>
)
);

Choose a reason for hiding this comment

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

물론 open이 숫자 0이나 빈 문자열이 될 가능성이 없는 boolean이라 예상하지 못한 경우는 없어서 괜찮은데,
컴포넌트 조건부 렌더링(boolean)에서

  1. 현재처럼 &&를 사용 (BottomSheetContent의 return 값이 JSX.Element | false)
  2. early return으로 null 반환 (BottomSheetContent의 return 값이 JSX.Element | null)

이 두개 중 어떤걸 선호하시나요?

Comment on lines +45 to +58
const uncontrolled = _open === undefined;

const open = uncontrolled ? internalOpenValue : _open;
const handleOpenChange = (value: boolean) => {
if (uncontrolled) {
if (value) {
internalOpen();
} else {
internalClose();
}
} else {
onOpenChange?.(value);
}
};

Choose a reason for hiding this comment

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

물론 지금도 좋지만 uncontrolledboolean 값을 가지니 일반적인 is- prefix를 써서 isControlled로 사용하고 조건을 반대로 해도 가독성이 좋을 것 같습니다.

Comment on lines +12 to +17
const meta: Meta = {
title: 'Components/BottomSheet',
tags: ['autodocs'],
};
export default meta;

Choose a reason for hiding this comment

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

component: BottomSheetExample를 meta에 지정하지 않아서 args table이 자동으로 안뜨는 것 같습니다!

image

추가로 compound component pattern이라 단순하게 스토리 적용이 안된다면 subcomponents 등의 옵션이나 복잡한 컴포넌트 관련해서 옵션들을 적용해봐야 할 것 같아요!

storybook: subcomponents
storybook: 복잡한 컴포넌트 스토리

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.

3 participants