1+ 'use client' ;
2+ import MenuIcon from '@mui/icons-material/Menu' ;
13import {
24 AppBar ,
35 Box ,
46 Container ,
7+ IconButton ,
58 Link ,
69 List ,
710 ListItem ,
811 ListItemText ,
12+ Menu ,
13+ MenuItem ,
914 Stack ,
1015 Toolbar ,
1116 Typography ,
1217} from '@mui/material' ;
18+ import React from 'react' ;
1319
1420const sections = [
1521 { label : 'Introduction' , id : 'introduction' } ,
@@ -19,64 +25,71 @@ const sections = [
1925 { label : 'Future Work' , id : 'future-work' } ,
2026 { label : 'Contact Us' , id : 'contact' } ,
2127] ;
22-
23- const APP_BAR_OFFSET = '204px' ;
28+ const APP_BAR_HEIGHT = '64px' ;
29+ const APP_BAR_OFFSET = APP_BAR_HEIGHT ; // Offset for scroll margin
2430
2531export default function Home ( ) {
2632 const appBarLogo = '' ;
2733 const appBarLogoAlt = '' ;
34+
35+ const [ anchorEl , setAnchorEl ] = React . useState < null | HTMLElement > ( null ) ;
36+ const open = Boolean ( anchorEl ) ;
37+
38+ const handleMenuClick = ( event : React . MouseEvent < HTMLElement > ) => {
39+ setAnchorEl ( event . currentTarget ) ;
40+ } ;
41+
42+ const handleClose = ( ) => {
43+ setAnchorEl ( null ) ;
44+ } ;
2845 return (
2946 < div style = { { minWidth : '200px' , width : '100%' } } >
3047 < AppBar
48+ position = "static"
3149 sx = { {
3250 width : '100%' ,
3351 position : 'sticky' ,
3452 top : 0 ,
3553 zIndex : 1000 ,
54+ height : APP_BAR_HEIGHT ,
3655 } }
3756 >
3857 < Toolbar
3958 sx = { {
4059 position : 'relative' ,
41- minHeight : '64px' ,
42- py : 1 ,
43- flexWrap : 'wrap' ,
4460 display : 'flex' ,
45- justifyContent : 'center' ,
61+ justifyContent : 'space-between' ,
62+ alignItems : 'center' ,
4663 } }
4764 >
48- < Box
49- sx = { { display : 'flex' , justifyContent : 'center' , width : '122px' } }
50- >
51- { appBarLogo && (
52- < >
53- { /* eslint-disable-next-line @next/next/no-img-element */ }
54- < img src = { appBarLogo } alt = { appBarLogoAlt } width = "122px" />
55- </ >
56- ) }
57- </ Box >
65+ { appBarLogo && (
66+ < Box
67+ sx = { {
68+ display : 'flex' ,
69+ alignItems : 'center' ,
70+ width : '122px' ,
71+ } }
72+ >
73+ { /* eslint-disable-next-line @next/next/no-img-element */ }
74+ < img src = { appBarLogo } alt = { appBarLogoAlt } width = "122px" />
75+ </ Box >
76+ ) }
5877 < Stack
5978 direction = "row"
79+ spacing = { 6 }
80+ maxWidth = "lg"
6081 sx = { {
61- flexWrap : 'wrap' ,
62- justifyContent : 'center' ,
63- alignItems : 'center' ,
64- textAlign : 'center' ,
65- columnGap : 13 ,
66- px : 2 ,
67- maxWidth : '100%' ,
68- margin : '0 auto' ,
69- overflowX : 'hidden' ,
82+ position : 'absolute' ,
83+ left : '50%' ,
84+ transform : 'translateX(-50%)' ,
85+ display : {
86+ xs : 'none' ,
87+ lg : 'flex' ,
88+ } ,
7089 } }
7190 >
7291 { sections . map ( ( section ) => (
73- < Typography
74- variant = "h6"
75- key = { section . id }
76- component = "span"
77- sx = { { whiteSpace : 'nowrap' } }
78- noWrap
79- >
92+ < Typography variant = "h6" key = { section . id } component = "span" noWrap >
8093 < Link
8194 href = { `#${ section . id } ` }
8295 underline = "none"
@@ -91,8 +104,50 @@ export default function Home() {
91104 </ Typography >
92105 ) ) }
93106 </ Stack >
107+
108+ < >
109+ < Box
110+ sx = { {
111+ marginLeft : 'auto' ,
112+ display : {
113+ xs : 'block' ,
114+ lg : 'none' ,
115+ } ,
116+ } }
117+ >
118+ < IconButton
119+ color = "inherit"
120+ onClick = { handleMenuClick }
121+ aria-label = "navigation menu"
122+ size = "large"
123+ >
124+ < MenuIcon />
125+ </ IconButton >
126+ </ Box >
127+ < Menu
128+ anchorEl = { anchorEl }
129+ open = { open }
130+ onClose = { handleClose }
131+ anchorOrigin = { { vertical : 'bottom' , horizontal : 'right' } }
132+ transformOrigin = { { vertical : 'top' , horizontal : 'right' } }
133+ >
134+ { sections . map ( ( section ) => (
135+ < MenuItem
136+ key = { section . id }
137+ component = "a"
138+ href = { `#${ section . id } ` }
139+ onClick = { handleClose }
140+ >
141+ < Typography variant = "h6" component = "span" >
142+ { section . label }
143+ </ Typography >
144+ </ MenuItem >
145+ ) ) }
146+ </ Menu >
147+ </ >
94148 </ Toolbar >
95149 </ AppBar >
150+
96151 < Box
97152 sx = { {
98153 position : 'fixed' ,
@@ -413,7 +468,7 @@ export default function Home() {
413468 < Typography variant = "body1" >
414469 < strong > History</ strong > – Keep a history of edits made to
415470 the entities. For example, tracking the history of every
416- single position/location of an optic will allow EPAC to see
471+ single position/location of an optic will allow users to see
417472 where it has moved throughout its lifetime. They will also
418473 be able to work out how many optics have been damaged in a
419474 particular location.
0 commit comments