Created
June 29, 2023 10:17
-
-
Save barrybtw/97fb521510b7f892f6b6f4afc93fbbab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { twMerge } from 'tailwind-merge'; | |
import { useSidebarStore } from './sidebar-store'; | |
function App() { | |
const { | |
value, | |
close, | |
open, | |
toggle: _toggle, | |
} = useSidebarStore((store) => store); | |
return ( | |
<div | |
className={twMerge( | |
'w-screen h-screen bg-teal-900', | |
value && 'flex flex-row', | |
)} | |
> | |
{!value && <button onClick={open}>Open</button>} | |
<aside | |
className={twMerge( | |
'bg-slate-50/50 block', | |
value && | |
'block min-w-[128px] min-[500px]:min-w-[256px] lg:min-w-[468px] w-auto', | |
!value && 'hidden', | |
)} | |
> | |
{value && <button onClick={close}>Close</button>} | |
</aside> | |
<main className='flex-1'>main part of the page</main> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment