Prechádzať zdrojové kódy

close drawer on click backdrop

Yuki Takei 2 rokov pred
rodič
commit
dd78aa58a6

+ 2 - 2
apps/app/src/components/Sidebar/Sidebar.tsx

@@ -156,7 +156,7 @@ const DrawableContainer = memo((props: DrawableContainerProps): JSX.Element => {
 
 
   const { className, children } = props;
   const { className, children } = props;
 
 
-  const { data: isDrawerOpened } = useDrawerOpened();
+  const { data: isDrawerOpened, mutate } = useDrawerOpened();
 
 
   const openClass = `${isDrawerOpened ? 'open' : ''}`;
   const openClass = `${isDrawerOpened ? 'open' : ''}`;
 
 
@@ -166,7 +166,7 @@ const DrawableContainer = memo((props: DrawableContainerProps): JSX.Element => {
         {children}
         {children}
       </div>
       </div>
       { isDrawerOpened && (
       { isDrawerOpened && (
-        <div className="modal-backdrop fade show" />
+        <div className="modal-backdrop fade show" onClick={() => mutate(false)} />
       ) }
       ) }
     </>
     </>
   );
   );