Skip to content

Commit

Permalink
Feature/#299 사이드바 외부 클릭시 닫히게 (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasper200207 authored Aug 22, 2024
1 parent f72d22e commit 38286a2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,15 @@ const Sidebar = () => {
w={!isDesktop && isOpen ? '100%' : '0'}
h="100%"
bg={!isDesktop && isOpen ? 'rgba(0,0,0,0.5)' : ''}
onClick={() => {
setIsOpen(false);
}}
>
<Box pos="absolute" w={isOpen ? { base: '215px', lg: '230px', '2xl': '240px' } : '52px'}>
<Box
pos="absolute"
w={isOpen ? { base: '215px', lg: '230px', '2xl': '240px' } : '52px'}
onClick={(e) => e.stopPropagation()}
>
<SidebarContent isOpen={isOpen} setIsOpen={setIsOpen} />
</Box>
</Box>
Expand Down

0 comments on commit 38286a2

Please sign in to comment.