-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] BottomSheet 컴포넌트, 스토리북 #41
Changes from 12 commits
5af13cf
3d3cf25
7bf1a90
366e0cb
70ffaf2
eb7d761
beeb54a
a92c437
c1a3f12
c63dfac
2279cf6
631810a
90d4e6a
f273b49
f8f8c1f
390eb14
5bf5e10
489baf2
b2f0822
f3ff5ab
a4d2f8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* eslint-disable no-restricted-exports */ | ||
import { useState } from 'react'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { BottomSheet } from '.'; | ||
import { Button } from '../Button'; | ||
|
||
const meta = { | ||
title: 'components/common/BottomSheet', | ||
component: BottomSheet, | ||
tags: ['autodocs'], | ||
} satisfies Meta<typeof BottomSheet>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof BottomSheet>; | ||
|
||
export const Basic: Story = { | ||
render: () => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleClickBottomSheet = () => setIsOpen(!isOpen); | ||
|
||
return ( | ||
<> | ||
<Button variant="primary" size="medium" onClick={handleClickBottomSheet}> | ||
Open BottomSheet | ||
</Button> | ||
{isOpen && ( | ||
<BottomSheet isOpen={isOpen} onClose={() => setIsOpen(false)}> | ||
<div className="flex flex-col gap-6 items-center"> | ||
<div>Contents ...</div> | ||
</div> | ||
</BottomSheet> | ||
)} | ||
</> | ||
); | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentPropsWithoutRef, ReactNode } from 'react'; | ||
|
||
export type Props = ComponentPropsWithoutRef<'div'> & { | ||
/** | ||
* Indicates whether the BottomSheet is currently open. | ||
* @default false | ||
*/ | ||
isOpen: boolean; | ||
/** | ||
* Callback function that is called when the BottomSheet should close. | ||
*/ | ||
onClose?: VoidFunction; | ||
/** | ||
* The content to be displayed inside the BottomSheet. | ||
*/ | ||
children?: ReactNode; | ||
keemsebin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
|
||
export type DragInfo = { | ||
delta: { x: number; y: number }; | ||
}; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,52 @@ | ||||||||||||||||||||||||||
import { memo } from 'react'; | ||||||||||||||||||||||||||
import { motion, useDragControls, AnimatePresence } from 'framer-motion'; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
import { useBottomSheet } from '@/hooks/common/useBottomSheet'; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
import { Props } from './BottomSheet.types'; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
import { Portal } from '../Portal'; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const Content = ({ children }: React.PropsWithChildren) => ( | ||||||||||||||||||||||||||
<div className="w-full text-black p-6">{children}</div> | ||||||||||||||||||||||||||
keemsebin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
export const BottomSheet = memo(({ children, isOpen, onClose }: Props) => { | ||||||||||||||||||||||||||
const dragControls = useDragControls(); | ||||||||||||||||||||||||||
keemsebin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
const { sheetHeight, isHidden, isInteractionDisabled, handleDrag, handleDragEnd, handleClose } = | ||||||||||||||||||||||||||
useBottomSheet(isOpen, onClose); | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
return ( | ||||||||||||||||||||||||||
<Portal isOpen={!isHidden}> | ||||||||||||||||||||||||||
<div | ||||||||||||||||||||||||||
className={`absolute top-0 left-0 w-full h-full transition-opacity duration-300 ${ | ||||||||||||||||||||||||||
isHidden ? 'pointer-events-none' : 'pointer-events-auto' | ||||||||||||||||||||||||||
}`} | ||||||||||||||||||||||||||
onClick={handleClose} | ||||||||||||||||||||||||||
/> | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 백드롭 구현 개선 필요 현재 백드롭에 다음과 같은 개선이 필요합니다:
- className={`absolute top-0 left-0 w-full h-full transition-opacity duration-300 ${
- isHidden ? 'pointer-events-none' : 'pointer-events-auto'
- }`}
+ className={`absolute top-0 left-0 w-full h-full bg-black transition-opacity duration-300 ${
+ isHidden ? 'opacity-0 pointer-events-none' : 'opacity-70 pointer-events-auto'
+ }`} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
<AnimatePresence> | ||||||||||||||||||||||||||
keemsebin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||
{!isHidden && ( | ||||||||||||||||||||||||||
<motion.div | ||||||||||||||||||||||||||
className="absolute bottom-0 left-0 w-full bg-white shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.1)] rounded-t-3xl p-4 overflow-hidden z-[1000]" | ||||||||||||||||||||||||||
style={{ height: sheetHeight }} | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sheetHeight은 드래그에 따라 동적으로 변하는 값이어서 tailwind를 통해 적용하기 어려워, style 속성을 따로 적용했습니다 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하 JIT로 tailwind도 동적으로 적용 가능한 것 확인했습니다! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 문제가 생긴다기 보다..! tailwind에서 매번 새로운 동적 클래스를 생성하는 성능보다 style에서 직접 다루는 것이 더 나을 거라고 생각했습니당 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 어짜피 계산된 값이 들어갈텐데, style속성에 넣어도 새로운 값을 업데이트 하는건 똑같지 않나요?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저의 생각은 굳이 style,tailwind를 나눌 필요는 없어 보여요! 유지보수 측면에서도 css가 나눠져 있는 것 보단 하나에서 관리 하는게 좋을 것 같아요. 실제 성능상 유의미한 변화가 있는 지 체크 해보시면 좋을 것 같습니다~! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하 알겠습니다! 확인해보고 수정해서 올리겠습니당 |
||||||||||||||||||||||||||
drag="y" | ||||||||||||||||||||||||||
dragControls={dragControls} | ||||||||||||||||||||||||||
dragElastic={1} | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion dragElastic 값 조정 필요
- dragElastic={1}
+ dragElastic={0.3} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
dragConstraints={{ top: 0, bottom: 0 }} | ||||||||||||||||||||||||||
onDrag={handleDrag} | ||||||||||||||||||||||||||
onDragEnd={handleDragEnd} | ||||||||||||||||||||||||||
animate={{ height: sheetHeight, opacity: isHidden ? 0 : 1 }} | ||||||||||||||||||||||||||
transition={{ type: 'spring', stiffness: 170, damping: 30, duration: 0.3 }} | ||||||||||||||||||||||||||
onPointerDown={(e) => !isInteractionDisabled && dragControls.start(e)} | ||||||||||||||||||||||||||
exit={{ height: 0, opacity: 0 }} | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. framer 관련 객체들 저는 constants의 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하 확인했습니다! 수정해서 올리겠습니당 |
||||||||||||||||||||||||||
> | ||||||||||||||||||||||||||
<div className="w-20 h-1.5 bg-primary mx-auto rounded-full" /> | ||||||||||||||||||||||||||
<Content>{children}</Content> | ||||||||||||||||||||||||||
</motion.div> | ||||||||||||||||||||||||||
)} | ||||||||||||||||||||||||||
</AnimatePresence> | ||||||||||||||||||||||||||
</Portal> | ||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const INITIAL_HEIGHT = 150; | ||
export const MIN_VISIBLE_HEIGHT = 60; | ||
export const MAX_HEIGHT = window.innerHeight * 0.9; |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,76 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { useState, useCallback, useRef, useEffect } from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { DragInfo } from '@/components/common/BottomSheet/BottomSheet.types'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import { INITIAL_HEIGHT, MIN_VISIBLE_HEIGHT, MAX_HEIGHT } from '@/constants/bottomSheetOptions'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
export const useBottomSheet = (resetTrigger: boolean, onClose?: () => void) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const [sheetHeight, setSheetHeight] = useState(INITIAL_HEIGHT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const [isHidden, setIsHidden] = useState(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const [isInteractionDisabled, setIsInteractionDisabled] = useState(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const dragOffsetRef = useRef(0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const initialPositionRef = useRef(INITIAL_HEIGHT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (resetTrigger) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setSheetHeight(INITIAL_HEIGHT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setIsHidden(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setIsInteractionDisabled(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dragOffsetRef.current = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialPositionRef.current = INITIAL_HEIGHT; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, [resetTrigger]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 초기화 로직 중복 제거 필요 useEffect와 resetSheet 함수에서 초기화 로직이 중복되어 있습니다. 공통 함수로 추출하여 재사용성을 높이는 것이 좋습니다. +const resetSheetState = () => ({
+ sheetHeight: INITIAL_HEIGHT,
+ isHidden: false,
+ isInteractionDisabled: false,
+ dragOffset: 0,
+ initialPosition: INITIAL_HEIGHT,
+});
useEffect(() => {
if (resetTrigger) {
- setSheetHeight(INITIAL_HEIGHT);
- setIsHidden(false);
- setIsInteractionDisabled(false);
- dragOffsetRef.current = 0;
- initialPositionRef.current = INITIAL_HEIGHT;
+ const { sheetHeight, isHidden, isInteractionDisabled, dragOffset, initialPosition } = resetSheetState();
+ setSheetHeight(sheetHeight);
+ setIsHidden(isHidden);
+ setIsInteractionDisabled(isInteractionDisabled);
+ dragOffsetRef.current = dragOffset;
+ initialPositionRef.current = initialPosition;
}
}, [resetTrigger]); 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const handleDrag = useCallback( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(_: MouseEvent | TouchEvent | PointerEvent, info: DragInfo) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (isInteractionDisabled) return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
requestAnimationFrame(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const dragAmount = -info.delta.y; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dragOffsetRef.current += dragAmount; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const newHeight = Math.min( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Math.max(initialPositionRef.current + dragOffsetRef.current, MIN_VISIBLE_HEIGHT), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MAX_HEIGHT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setSheetHeight(newHeight); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[isInteractionDisabled, setSheetHeight] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 드래그 핸들러 성능 및 사용성 개선 필요 현재 구현은 기본적인 드래그 기능만 제공합니다. 사용자 경험 향상을 위해 다음 기능들의 추가가 필요합니다.
const handleDrag = useCallback(
(_: MouseEvent | TouchEvent | PointerEvent, info: DragInfo) => {
if (isInteractionDisabled) return;
+
+ // 수직 방향으로만 드래그 허용
+ if (Math.abs(info.delta.x) > Math.abs(info.delta.y)) return;
requestAnimationFrame(() => {
const dragAmount = -info.delta.y;
- dragOffsetRef.current += dragAmount;
+ // 드래그 저항 추가
+ const resistance = 0.5;
+ const resistedDrag = dragAmount * resistance;
+ dragOffsetRef.current += resistedDrag;
const newHeight = Math.min(
Math.max(initialPositionRef.current + dragOffsetRef.current, MIN_VISIBLE_HEIGHT),
MAX_HEIGHT
);
- setSheetHeight(newHeight);
+ // 불필요한 리렌더링 방지
+ if (Math.abs(newHeight - sheetHeight) > 1) {
+ setSheetHeight(newHeight);
+ }
});
},
[isInteractionDisabled, setSheetHeight]
); 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const handleDragEnd = useCallback(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (sheetHeight <= MIN_VISIBLE_HEIGHT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setIsHidden(true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setIsInteractionDisabled(true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (onClose) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
onClose(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} else if (sheetHeight > MAX_HEIGHT) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setSheetHeight(MAX_HEIGHT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, [sheetHeight, onClose]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
keemsebin marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const resetSheet = useCallback(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setSheetHeight(INITIAL_HEIGHT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setIsHidden(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
setIsInteractionDisabled(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dragOffsetRef.current = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
initialPositionRef.current = INITIAL_HEIGHT; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, []); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const handleClose = useCallback(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!isInteractionDisabled) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resetSheet(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}, [isInteractionDisabled, resetSheet]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sheetHeight, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isHidden, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
isInteractionDisabled, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
handleDrag, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
handleDragEnd, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resetSheet, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
handleClose, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isOpen 으로 close도 관리하면 될 것 같은데 onClose함수가 필요한 이유가 따로 있나요?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 나중에 바텀시트가 닫히는 시점에 부모 컴포넌트에서 액션이 필요한 부분이 있을까봐 부모 컴포넌트로 바텀시트 상태를 전달하려고 따로 작성했는데, 생각해보니 바텀시트가 닫혀도 다른 상태는 바뀔게 없을 것 같아서 isOpen으로 통합하겠습니다!