generated from coding-club-gct/nextjs-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4f9bb8
commit bf3d768
Showing
5 changed files
with
63 additions
and
15 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use client" | ||
|
||
import { Button, Drawer } from "@mui/material" | ||
import { UserBox } from "./user-box" | ||
import { ReactNode, useState } from "react" | ||
|
||
export default function MobileHeader({ Chapter, TOC }: { Chapter: ReactNode, TOC: ReactNode }) { | ||
const [chapters, setChapters] = useState(false) | ||
const [toc, setToc] = useState(false) | ||
|
||
return <div className="-mb-8 px-4 flex justify-between md:hidden"> | ||
<Button onClick={() => setChapters(true)} variant="contained"> | ||
Chapters | ||
</Button> | ||
<Button variant="contained" onClick={() => setToc(true)}> | ||
TOC | ||
</Button> | ||
<Drawer anchor="left" open={chapters} onClose={() => setChapters(false)}> | ||
{Chapter} | ||
</Drawer> | ||
<Drawer anchor="right" open={toc} onClose={() => setToc(false)}> | ||
{TOC} | ||
</Drawer> | ||
</div> | ||
} |