-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sidebar toggle button in mobile environment (#161)
* wip * wip
- Loading branch information
1 parent
96aed1d
commit 17a0d07
Showing
5 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
import { HiOutlineMenuAlt2 } from 'react-icons/hi'; | ||
|
||
import styles from './Aside.module.scss'; | ||
|
||
export default function Aside({ children }) { | ||
return <aside className={styles.aside}>{children}</aside>; | ||
const [visible, setVisible] = useState(false); | ||
|
||
return ( | ||
<> | ||
<aside className={`${styles.aside} ${visible ? styles.visible : ''}`}> | ||
{children} | ||
</aside> | ||
<div | ||
className={`${styles.div} ${visible ? styles.visible : ''}`} | ||
onClick={() => { | ||
setVisible(prevState => !prevState); | ||
}} | ||
> | ||
<HiOutlineMenuAlt2 /> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
// TODO: Add `useMemo` Hook to `${visible ? styles.visible : ''}`. |
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
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
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