Skip to content

Commit 69bda79

Browse files
committed
Refactor: attrs 메서드를 사용해 바텀시트 드래그 시 불필요한 클래스 생성 방지
1 parent 53e1ae6 commit 69bda79

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/components/BottomSheet/styles.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ export const BottomSheetWrapper = styled.div<{ $isOpenBottomSheet: boolean }>`
1616
visibility 0.3s ease-out;
1717
`;
1818

19-
export const BottomSheetLayout = styled.div<{
20-
$isOpenBottomSheet: boolean;
21-
$currentTranslateY: number;
19+
export const BottomSheetLayout = styled.div.attrs<{ $currentTranslateY: number; $isOpenBottomSheet: boolean }>(
20+
({ $currentTranslateY, $isOpenBottomSheet }) => ({
21+
style: {
22+
transform: `translate(-50%, ${$isOpenBottomSheet ? `${$currentTranslateY}px` : '100%'})`,
23+
},
24+
}),
25+
)<{
2226
$isHandlerVisible: boolean;
2327
}>`
2428
position: fixed;
@@ -33,10 +37,6 @@ export const BottomSheetLayout = styled.div<{
3337
z-index: 200;
3438
user-select: none;
3539
touch-action: none;
36-
transform: translate(
37-
-50%,
38-
${({ $currentTranslateY, $isOpenBottomSheet }) => ($isOpenBottomSheet ? `${$currentTranslateY}px` : '100%')}
39-
);
4040
transition: transform 0.3s;
4141
`;
4242

0 commit comments

Comments
 (0)