抽屉菜单遮罩处理

This commit is contained in:
tangly1024
2021-10-15 15:18:59 +08:00
parent 3841f9fdac
commit bca507029c
2 changed files with 6 additions and 6 deletions

View File

@@ -24,8 +24,8 @@ const Drawer = ({ post, currentTag, cRef, tags }) => {
const handleMenuClick = () => {
switchShowDrawer(!showDrawer)
}
return <div>
<div className='fixed top-0 left-0 z-30 h-full'>
return <>
<div className='fixed top-0 left-0 z-40 h-full'>
<div
className={(showDrawer ? 'shadow-2xl' : '-ml-72') + ' overflow-y-auto duration-200 w-72 h-full bg-white dark:bg-gray-800 border-r dark:border-gray-600'}>
{/* LOGO */}
@@ -67,8 +67,8 @@ const Drawer = ({ post, currentTag, cRef, tags }) => {
</div>
</div>
{/* 背景蒙版 */}
<div className={(showDrawer ? 'block' : 'hidden') + ' fixed top-0 left-0 z-20 w-full h-full bg-black bg-opacity-50'}
<div className={(showDrawer ? 'block' : 'hidden') + ' fixed top-0 left-0 z-30 w-full h-full bg-black bg-opacity-50'}
onClick={handleMenuClick} />
</div>
</>
}
export default Drawer

View File

@@ -21,7 +21,7 @@ const DrawerRight = ({ post, cRef }) => {
}
return <div>
<div className='fixed top-0 right-0 z-30 h-full'>
<div className='fixed top-0 right-0 z-40 h-full'>
<div
className={(showDrawer ? 'shadow-2xl' : '-mr-72') + ' overflow-y-auto duration-200 w-72 h-full bg-white dark:bg-gray-700 border-r dark:border-gray-600'}>
{/* LOGO */}
@@ -44,7 +44,7 @@ const DrawerRight = ({ post, cRef }) => {
</div>
</div>
{/* 背景蒙版 */}
<div className={(showDrawer ? 'block' : 'hidden') + ' fixed top-0 left-0 z-20 w-full h-full bg-black bg-opacity-50'}
<div className={(showDrawer ? 'block' : 'hidden') + ' fixed top-0 left-0 z-30 w-full h-full bg-black bg-opacity-50'}
onClick={handleMenuClick} />
</div>
}