@@ -8,7 +8,7 @@ import { useState } from "react"
8
8
import { NavLink , useLocation } from "react-router-dom"
9
9
import { colors } from "theme/colors"
10
10
import * as TypesGen from "../../api/typesGenerated"
11
- import { navHeight } from "../../theme/constants"
11
+ import { containerWidth , navHeight , sidePadding } from "../../theme/constants"
12
12
import { combineClasses } from "../../util/combineClasses"
13
13
import { Logo } from "../Icons/Logo"
14
14
import { UserDropdown } from "../UserDropdown/UsersDropdown"
@@ -73,53 +73,58 @@ export const NavbarView: React.FC<React.PropsWithChildren<NavbarViewProps>> = ({
73
73
74
74
return (
75
75
< nav className = { styles . root } >
76
- < IconButton
77
- aria-label = "Open menu"
78
- className = { styles . mobileMenuButton }
79
- onClick = { ( ) => {
80
- setIsDrawerOpen ( true )
81
- } }
82
- >
83
- < MenuIcon />
84
- </ IconButton >
85
-
86
- < Drawer anchor = "left" open = { isDrawerOpen } onClose = { ( ) => setIsDrawerOpen ( false ) } >
87
- < div className = { styles . drawer } >
88
- < div className = { styles . drawerHeader } >
89
- < Logo fill = "white" opacity = { 1 } width = { 125 } />
76
+ < div className = { styles . wrapper } >
77
+ < IconButton
78
+ aria-label = "Open menu"
79
+ className = { styles . mobileMenuButton }
80
+ onClick = { ( ) => {
81
+ setIsDrawerOpen ( true )
82
+ } }
83
+ >
84
+ < MenuIcon />
85
+ </ IconButton >
86
+
87
+ < Drawer anchor = "left" open = { isDrawerOpen } onClose = { ( ) => setIsDrawerOpen ( false ) } >
88
+ < div className = { styles . drawer } >
89
+ < div className = { styles . drawerHeader } >
90
+ < Logo fill = "white" opacity = { 1 } width = { 125 } />
91
+ </ div >
92
+ < NavItems canViewAuditLog = { canViewAuditLog } />
90
93
</ div >
91
- < NavItems canViewAuditLog = { canViewAuditLog } />
92
- </ div >
93
- </ Drawer >
94
+ </ Drawer >
94
95
95
- < NavLink className = { styles . logo } to = "/workspaces" >
96
- < Logo fill = "white" opacity = { 1 } width = { 125 } />
97
- </ NavLink >
96
+ < NavLink className = { styles . logo } to = "/workspaces" >
97
+ < Logo fill = "white" opacity = { 1 } width = { 125 } />
98
+ </ NavLink >
98
99
99
- < NavItems className = { styles . desktopNavItems } canViewAuditLog = { canViewAuditLog } />
100
+ < NavItems className = { styles . desktopNavItems } canViewAuditLog = { canViewAuditLog } />
100
101
101
- < div className = { styles . profileButton } >
102
- { user && < UserDropdown user = { user } onSignOut = { onSignOut } /> }
102
+ < div className = { styles . profileButton } >
103
+ { user && < UserDropdown user = { user } onSignOut = { onSignOut } /> }
104
+ </ div >
103
105
</ div >
104
106
</ nav >
105
107
)
106
108
}
107
109
108
110
const useStyles = makeStyles ( ( theme ) => ( {
109
111
root : {
110
- position : "relative" ,
111
- display : "flex" ,
112
- justifyContent : "space-between" ,
113
- alignItems : "center" ,
114
112
height : navHeight ,
115
113
background : theme . palette . background . paper ,
116
- marginTop : 0 ,
117
- transition : "margin 150ms ease" ,
118
114
"@media (display-mode: standalone)" : {
119
115
borderTop : `1px solid ${ theme . palette . divider } ` ,
120
116
} ,
121
117
borderBottom : `1px solid ${ theme . palette . divider } ` ,
122
-
118
+ transition : "margin 150ms ease" ,
119
+ } ,
120
+ wrapper : {
121
+ position : "relative" ,
122
+ display : "flex" ,
123
+ justifyContent : "space-between" ,
124
+ alignItems : "center" ,
125
+ margin : "0 auto" ,
126
+ maxWidth : containerWidth ,
127
+ padding : `0 ${ sidePadding } px` ,
123
128
[ theme . breakpoints . up ( "md" ) ] : {
124
129
justifyContent : "flex-start" ,
125
130
} ,
@@ -155,7 +160,6 @@ const useStyles = makeStyles((theme) => ({
155
160
alignItems : "center" ,
156
161
display : "flex" ,
157
162
height : navHeight ,
158
- paddingLeft : theme . spacing ( 4 ) ,
159
163
paddingRight : theme . spacing ( 4 ) ,
160
164
"& svg" : {
161
165
width : 109 ,
0 commit comments