1- import React , { useState } from 'react' ;
2- import { AppBar , Toolbar , Typography , Button , Menu , MenuItem , Box , Container } from '@mui/material' ;
3- import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown' ;
1+ import React from 'react' ;
2+ import { AppBar , Toolbar , Typography , Button , Box , Container , IconButton } from '@mui/material' ;
43import CodeIcon from '@mui/icons-material/Code' ;
4+ import { Link as RouterLink } from 'react-router-dom' ;
5+ import ThemeToggle from './ThemeToggle' ;
56
67export const Layout : React . FC < { children : React . ReactNode } > = ( { children } ) => {
7- // Dropdown State
8- const [ anchorEl , setAnchorEl ] = useState < null | HTMLElement > ( null ) ;
9- const open = Boolean ( anchorEl ) ;
10-
11- const handleMenuClick = ( event : React . MouseEvent < HTMLElement > ) => {
12- setAnchorEl ( event . currentTarget ) ;
13- } ;
14- const handleClose = ( ) => {
15- setAnchorEl ( null ) ;
16- } ;
17-
188 return (
19- < Box sx = { { display : 'flex' , flexDirection : 'column' , minHeight : '100vh' , bgcolor : '#121212 ' , color : 'white ' } } >
9+ < Box sx = { { display : 'flex' , flexDirection : 'column' , minHeight : '100vh' , bgcolor : 'background.default ' , color : 'text.primary ' } } >
2010
2111 { /* --- HEADER --- */ }
22- < AppBar position = "static" sx = { { bgcolor : '#1e1e1e' , borderBottom : '1px solid #333' } } >
12+ < AppBar
13+ position = "sticky"
14+ elevation = { 0 }
15+ sx = { {
16+ bgcolor : 'background.paper' ,
17+ borderBottom : '1px solid' ,
18+ borderColor : 'divider' ,
19+ color : 'text.primary'
20+ } }
21+ >
2322 < Toolbar >
24- < CodeIcon sx = { { mr : 1 , color : '#61dafb' } } />
25- < Typography variant = "h6" sx = { { flexGrow : 1 , fontFamily : 'monospace' , fontWeight : 700 } } >
23+ < CodeIcon sx = { { mr : 1 , color : 'primary.main' } } />
24+ < Typography
25+ variant = "h6"
26+ component = { RouterLink }
27+ to = "/"
28+ sx = { {
29+ flexGrow : 1 ,
30+ fontFamily : 'monospace' ,
31+ fontWeight : 700 ,
32+ textDecoration : 'none' ,
33+ color : 'inherit'
34+ } }
35+ >
2636 const correctness;
2737 </ Typography >
2838
29- < Button color = "inherit" href = "/" > Home</ Button >
30-
31- { /* Blog Dropdown */ }
32- < Button
33- color = "inherit"
34- endIcon = { < KeyboardArrowDownIcon /> }
35- onClick = { handleMenuClick }
36- >
37- Blog
38- </ Button >
39- < Menu anchorEl = { anchorEl } open = { open } onClose = { handleClose } >
40- { /* These link to your rendered Jupyter Book pages */ }
41- < MenuItem onClick = { handleClose } component = "a" href = "/notes/index.html" >
42- Intro & Setup
43- </ MenuItem >
44- < MenuItem onClick = { handleClose } component = "a" href = "/notes/structure.html" >
45- C++ Deep Dives
46- </ MenuItem >
47- </ Menu >
39+ < Box sx = { { display : { xs : 'none' , md : 'flex' } , gap : 1 , alignItems : 'center' } } >
40+ < Button component = { RouterLink } to = "/" color = "inherit" > Home</ Button >
41+ < Button component = { RouterLink } to = "/notes" color = "inherit" > Blog</ Button >
42+ < Button component = "a" href = "https://github.com/constcorrectness" target = "_blank" color = "inherit" > GitHub</ Button >
43+ < ThemeToggle />
44+ </ Box >
4845
49- < Button color = "inherit" href = "https://github.com/constcorrectness" > GitHub</ Button >
46+ { /* Mobile view could be added here later with a Drawer */ }
47+ < Box sx = { { display : { xs : 'flex' , md : 'none' } } } >
48+ < ThemeToggle />
49+ </ Box >
5050 </ Toolbar >
5151 </ AppBar >
5252
@@ -56,11 +56,25 @@ export const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) =>
5656 </ Box >
5757
5858 { /* --- FOOTER --- */ }
59- < Box component = "footer" sx = { { py : 3 , px : 2 , mt : 'auto' , backgroundColor : '#0a0a0a' , textAlign : 'center' } } >
60- < Container maxWidth = "sm" >
61- < Typography variant = "body2" color = "#888" >
59+ < Box
60+ component = "footer"
61+ sx = { {
62+ py : 6 ,
63+ px : 2 ,
64+ mt : 'auto' ,
65+ bgcolor : 'background.paper' ,
66+ borderTop : '1px solid' ,
67+ borderColor : 'divider' ,
68+ textAlign : 'center'
69+ } }
70+ >
71+ < Container maxWidth = "md" >
72+ < Typography variant = "body2" color = "text.secondary" >
6273 © { new Date ( ) . getFullYear ( ) } ConstCorrectness ™️
6374 </ Typography >
75+ < Typography variant = "caption" color = "text.secondary" sx = { { display : 'block' , mt : 1 } } >
76+ Built with React, MUI, and Three.js
77+ </ Typography >
6478 </ Container >
6579 </ Box >
6680 </ Box >
0 commit comments