mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-26 00:23:59 +01:00
feat: click outside mobile sidebar to close
This commit is contained in:
parent
b1b6caed8f
commit
990a83fea8
|
@ -1,4 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import useStore from '@store/store';
|
||||||
|
|
||||||
import NewChat from './NewChat';
|
import NewChat from './NewChat';
|
||||||
import ChatHistoryList from './ChatHistoryList';
|
import ChatHistoryList from './ChatHistoryList';
|
||||||
|
@ -38,6 +39,13 @@ const Menu = () => {
|
||||||
<div
|
<div
|
||||||
id='menu-backdrop'
|
id='menu-backdrop'
|
||||||
className='hidden md:hidden fixed top-0 left-0 h-full w-full z-[60] bg-gray-900/70'
|
className='hidden md:hidden fixed top-0 left-0 h-full w-full z-[60] bg-gray-900/70'
|
||||||
|
onClick={() => {
|
||||||
|
document
|
||||||
|
.getElementById('menu')
|
||||||
|
?.classList.remove('max-md:translate-x-[0%]');
|
||||||
|
document.getElementById('menu-close')?.classList.add('hidden');
|
||||||
|
document.getElementById('menu-backdrop')?.classList.add('hidden');
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue