@@ -44,81 +44,6 @@ export const Language = {
44
44
deployment : "Deployment" ,
45
45
} ;
46
46
47
- const styles = {
48
- desktopNavItems : ( theme ) => css `
49
- display : none;
50
-
51
- ${ theme . breakpoints . up ( "md" ) } {
52
- display : flex;
53
- }
54
- ` ,
55
- mobileMenuButton : ( theme ) => css `
56
- ${ theme . breakpoints . up ( "md" ) } {
57
- display : none;
58
- }
59
- ` ,
60
- wrapper : ( theme ) => css `
61
- position : relative;
62
- display : flex;
63
- justify-content : space-between;
64
- align-items : center;
65
-
66
- ${ theme . breakpoints . up ( "md" ) } {
67
- justify-content : flex-start;
68
- }
69
- ` ,
70
- drawerHeader : {
71
- padding : 16 ,
72
- paddingTop : 32 ,
73
- paddingBottom : 32 ,
74
- } ,
75
- logo : ( theme ) => css `
76
- align-items : center;
77
- display : flex;
78
- height : ${ navHeight } px;
79
- color : ${ theme . palette . text . primary } ;
80
- padding : 16px ;
81
-
82
- // svg is for the Coder logo, img is for custom images
83
- & svg ,
84
- & img {
85
- height : 100% ;
86
- object-fit : contain;
87
- }
88
- ` ,
89
- drawerLogo : {
90
- padding : 0 ,
91
- maxHeight : 40 ,
92
- } ,
93
- item : {
94
- padding : 0 ,
95
- } ,
96
- link : ( theme ) => css `
97
- align-items : center;
98
- color : ${ colors . gray [ 6 ] } ;
99
- display : flex;
100
- flex : 1 ;
101
- font-size : 16px ;
102
- padding : 12px 16px ;
103
- text-decoration : none;
104
- transition : background-color 0.15s ease-in-out;
105
-
106
- & .active {
107
- color : ${ theme . palette . text . primary } ;
108
- font-weight : 500 ;
109
- }
110
-
111
- & : hover {
112
- background-color : ${ theme . palette . action . hover } ;
113
- }
114
-
115
- ${ theme . breakpoints . up ( "md" ) } {
116
- height : ${ navHeight } px;
117
- padding : 0 24px ;
118
- }
119
- ` ,
120
- } satisfies Record < string , Interpolation < Theme > > ;
121
-
122
47
interface NavItemsProps {
123
48
children ?: ReactNode ;
124
49
className ?: string ;
@@ -183,6 +108,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
183
108
canViewAllUsers,
184
109
proxyContextValue,
185
110
} ) => {
111
+ const theme = useTheme ( ) ;
186
112
const [ isDrawerOpen , setIsDrawerOpen ] = useState ( false ) ;
187
113
188
114
return (
@@ -243,15 +169,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
243
169
canViewAllUsers = { canViewAllUsers }
244
170
/>
245
171
246
- < div
247
- css = { {
248
- display : "flex" ,
249
- marginLeft : "auto" ,
250
- gap : 16 ,
251
- alignItems : "center" ,
252
- paddingRight : 16 ,
253
- } }
254
- >
172
+ < div css = { styles . navMenus } >
255
173
{ proxyContextValue && (
256
174
< ProxyMenu proxyContextValue = { proxyContextValue } />
257
175
) }
@@ -465,3 +383,87 @@ const ProxyMenu: FC<ProxyMenuProps> = ({ proxyContextValue }) => {
465
383
</ >
466
384
) ;
467
385
} ;
386
+
387
+ const styles = {
388
+ desktopNavItems : ( theme ) => css `
389
+ display : none;
390
+
391
+ ${ theme . breakpoints . up ( "md" ) } {
392
+ display : flex;
393
+ }
394
+ ` ,
395
+ mobileMenuButton : ( theme ) => css `
396
+ ${ theme . breakpoints . up ( "md" ) } {
397
+ display : none;
398
+ }
399
+ ` ,
400
+ navMenus : ( theme ) => ( {
401
+ display : "flex" ,
402
+ gap : 16 ,
403
+ alignItems : "center" ,
404
+ paddingRight : 16 ,
405
+ [ theme . breakpoints . up ( "md" ) ] : {
406
+ marginLeft : "auto" ,
407
+ } ,
408
+ } ) ,
409
+ wrapper : ( theme ) => css `
410
+ position : relative;
411
+ display : flex;
412
+ justify-content : space-between;
413
+ align-items : center;
414
+
415
+ ${ theme . breakpoints . up ( "md" ) } {
416
+ justify-content : flex-start;
417
+ }
418
+ ` ,
419
+ drawerHeader : {
420
+ padding : 16 ,
421
+ paddingTop : 32 ,
422
+ paddingBottom : 32 ,
423
+ } ,
424
+ logo : ( theme ) => css `
425
+ align-items : center;
426
+ display : flex;
427
+ height : ${ navHeight } px;
428
+ color : ${ theme . palette . text . primary } ;
429
+ padding : 16px ;
430
+
431
+ // svg is for the Coder logo, img is for custom images
432
+ & svg ,
433
+ & img {
434
+ height : 100% ;
435
+ object-fit : contain;
436
+ }
437
+ ` ,
438
+ drawerLogo : {
439
+ padding : 0 ,
440
+ maxHeight : 40 ,
441
+ } ,
442
+ item : {
443
+ padding : 0 ,
444
+ } ,
445
+ link : ( theme ) => css `
446
+ align-items : center;
447
+ color : ${ colors . gray [ 6 ] } ;
448
+ display : flex;
449
+ flex : 1 ;
450
+ font-size : 16px ;
451
+ padding : 12px 16px ;
452
+ text-decoration : none;
453
+ transition : background-color 0.15s ease-in-out;
454
+
455
+ & .active {
456
+ color : ${ theme . palette . text . primary } ;
457
+ font-weight : 500 ;
458
+ }
459
+
460
+ & : hover {
461
+ background-color : ${ theme . palette . action . hover } ;
462
+ }
463
+
464
+ ${ theme . breakpoints . up ( "md" ) } {
465
+ height : ${ navHeight } px;
466
+ padding : 0 24px ;
467
+ }
468
+ ` ,
469
+ } satisfies Record < string , Interpolation < Theme > > ;
0 commit comments