Skip to content

Commit cce4f8e

Browse files
committed
Refactor: BottomSheetMenu 리팩토링
1 parent 0c14b38 commit cce4f8e

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// SheetItemWithDivider에서 사용되는 Items 배열 요소
2-
export interface SheetItemDto {
3-
text: string;
4-
action: () => void;
5-
icon?: string; // svg를 import하여 값으로 사용
6-
}
7-
81
//TODO: marginBottom prop 제거
92
export interface BottomSheetMenuProps {
103
items: SheetItemDto[];
114
marginBottom?: string;
125
}
6+
7+
export interface SheetItemDto {
8+
text: string;
9+
action: () => void;
10+
icon?: string; // svg를 import하여 값으로 사용
11+
}

src/components/BottomSheetMenu/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { StyledText } from '../Text/StyledText';
2-
import { BottomSheetMenuLayout, SheetItem, Icon } from './styles';
1+
import { StyledText } from '@components/Text/StyledText';
2+
import { BottomSheetMenuLayout, SheetItem, IconButton } from './styles';
33
import { BottomSheetMenuProps, SheetItemDto } from './dto';
44
import React from 'react';
55

@@ -12,7 +12,11 @@ const BottomSheetMenu: React.FC<BottomSheetMenuProps> = React.memo(({ items }) =
1212
<StyledText $textTheme={{ style: 'body1-medium' }} color={'#7b7b7b'}>
1313
{item.text}
1414
</StyledText>
15-
{item.icon && <Icon src={item.icon} />}
15+
{item.icon && (
16+
<IconButton>
17+
<img src={item.icon} alt={`${item.text} 아이콘`} />
18+
</IconButton>
19+
)}
1620
</SheetItem>
1721
</div>
1822
))}

src/components/BottomSheetMenu/styles.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ export const SheetItem = styled.li`
1616
border-bottom: 1px solid rgb(0, 0, 0, 0.2);
1717
`;
1818

19-
export const Icon = styled.img`
19+
export const IconButton = styled.button`
2020
width: 1.5rem;
2121
height: 1.5rem;
22+
display: flex;
23+
align-items: center;
24+
justify-content: center;
2225
`;

src/pages/Chats/ChatRoom/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ const ChatRoom: React.FC = () => {
184184
icon: Block,
185185
},
186186
],
187-
marginBottom: '4.38rem',
188187
};
189188

190189
const leaveModalProps: ModalProps = {

0 commit comments

Comments
 (0)