@@ -2,6 +2,7 @@ import { useState } from "react";
2
2
3
3
import { MenuRounded as MenuRoundedIcon } from "@mui/icons-material" ;
4
4
import {
5
+ Box ,
5
6
Divider ,
6
7
Grid2 as Grid ,
7
8
IconButton ,
@@ -17,17 +18,13 @@ import { NavLink } from "./NavLink";
17
18
import { OUPContext } from "./OUPContext" ;
18
19
import { UserMenuContent } from "./UserMenuContent" ;
19
20
20
- export interface MobileNavMenuProps {
21
- links ?: boolean ;
22
- }
23
-
24
21
/**
25
22
* Mobile modal navigation menu with
26
23
* * Page links
27
24
* * Project management
28
25
* * User menu
29
26
*/
30
- export const MobileNavMenu = ( { links = true } : MobileNavMenuProps ) => {
27
+ export const MobileNavMenu = ( ) => {
31
28
const [ open , setOpen ] = useState ( false ) ;
32
29
const isDMAuthorized = useDMAuthorizationStatus ( ) ;
33
30
@@ -38,49 +35,61 @@ export const MobileNavMenu = ({ links = true }: MobileNavMenuProps) => {
38
35
</ IconButton >
39
36
< ModalWrapper id = "mobile-menu" open = { open } title = "" onClose = { ( ) => setOpen ( false ) } >
40
37
< Grid container spacing = { 2 } >
41
- { ! ! links && (
42
- < Grid size = { 12 } >
43
- < Typography component = "h3" variant = "h6" >
44
- Links
45
- </ Typography >
46
- < List aria-label = "main-mobile-navigation" component = "nav" >
47
- < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Datasets" >
48
- { ( { active } ) => (
49
- < ListItemButton component = "a" selected = { active } >
50
- < ListItemText primary = "Datasets" />
51
- </ ListItemButton >
52
- ) }
53
- </ NavLink >
54
- < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Project" >
55
- { ( { active } ) => (
56
- < ListItemButton component = "a" selected = { active } >
57
- < ListItemText primary = "Project" />
58
- </ ListItemButton >
59
- ) }
60
- </ NavLink >
61
- < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Run" >
62
- { ( { active } ) => (
63
- < ListItemButton component = "a" selected = { active } >
64
- < ListItemText primary = "Apps/Jobs" />
65
- </ ListItemButton >
66
- ) }
67
- </ NavLink >
68
- < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Results" >
69
- { ( { active } ) => (
70
- < ListItemButton component = "a" selected = { active } >
71
- < ListItemText primary = "Results" />
72
- </ ListItemButton >
73
- ) }
74
- </ NavLink >
75
- </ List >
76
- </ Grid >
77
- ) }
78
- { ! ! isDMAuthorized && ! ! links && (
79
- < Grid size = { 12 } >
80
- < Divider />
81
- </ Grid >
82
- ) }
83
- < Grid size = { 12 } > { ! ! isDMAuthorized && < OUPContext header /> } </ Grid >
38
+ < Grid
39
+ size = { 12 }
40
+ sx = { { display : { xs : "block" } , "@media (min-width:655px)" : { display : "none" } } }
41
+ >
42
+ < Typography component = "h3" variant = "h6" >
43
+ Links
44
+ </ Typography >
45
+ < List aria-label = "main-mobile-navigation" component = "nav" >
46
+ < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Datasets" >
47
+ { ( { active } ) => (
48
+ < ListItemButton component = "a" selected = { active } >
49
+ < ListItemText primary = "Datasets" />
50
+ </ ListItemButton >
51
+ ) }
52
+ </ NavLink >
53
+ < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Project" >
54
+ { ( { active } ) => (
55
+ < ListItemButton component = "a" selected = { active } >
56
+ < ListItemText primary = "Project" />
57
+ </ ListItemButton >
58
+ ) }
59
+ </ NavLink >
60
+ < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Run" >
61
+ { ( { active } ) => (
62
+ < ListItemButton component = "a" selected = { active } >
63
+ < ListItemText primary = "Apps/Jobs" />
64
+ </ ListItemButton >
65
+ ) }
66
+ </ NavLink >
67
+ < NavLink stripQueryParameters = { [ "taskId" , "instanceId" , "path" ] } title = "Results" >
68
+ { ( { active } ) => (
69
+ < ListItemButton component = "a" selected = { active } >
70
+ < ListItemText primary = "Results" />
71
+ </ ListItemButton >
72
+ ) }
73
+ </ NavLink >
74
+ </ List >
75
+ </ Grid >
76
+ < Grid
77
+ size = { 12 }
78
+ sx = { { display : { xs : "block" } , "@media (min-width:655px)" : { display : "none" } } }
79
+ >
80
+ < Divider />
81
+ </ Grid >
82
+ < Grid size = { 12 } >
83
+ { ! ! isDMAuthorized && (
84
+ < Box >
85
+ < Typography gutterBottom variant = "h3" >
86
+ Project
87
+ </ Typography >
88
+
89
+ < OUPContext />
90
+ </ Box >
91
+ ) }
92
+ </ Grid >
84
93
< Grid size = { 12 } >
85
94
< UserMenuContent />
86
95
</ Grid >
0 commit comments