@@ -11,8 +11,6 @@ import { useLocation, useRouteMatch } from "react-router";
11
11
import { Location } from "history" ;
12
12
import { countries } from "countries-list" ;
13
13
import gitpodIcon from "./icons/gitpod.svg" ;
14
- import CaretDown from "./icons/CaretDown.svg" ;
15
- import CaretUpDown from "./icons/CaretUpDown.svg" ;
16
14
import { getGitpodService , gitpodHostUrl } from "./service/service" ;
17
15
import { UserContext } from "./user-context" ;
18
16
import { TeamsContext , getCurrentTeam } from "./teams/teams-context" ;
@@ -108,6 +106,8 @@ export default function Menu() {
108
106
109
107
// Hide most of the top menu when in a full-page form.
110
108
const isMinimalUI = [ "/new" , "/teams/new" , "/open" ] . includes ( location . pathname ) ;
109
+ const isWorkspacesUI = [ "/workspaces" ] . includes ( location . pathname ) ;
110
+ const isAdminUI = window . location . pathname . startsWith ( "/admin" ) ;
111
111
112
112
const [ teamMembers , setTeamMembers ] = useState < Record < string , TeamMemberInfo [ ] > > ( { } ) ;
113
113
useEffect ( ( ) => {
@@ -228,11 +228,6 @@ export default function Menu() {
228
228
}
229
229
// User menu
230
230
return [
231
- {
232
- title : "Workspaces" ,
233
- link : "/workspaces" ,
234
- alternatives : [ "/" ] ,
235
- } ,
236
231
{
237
232
title : "Projects" ,
238
233
link : "/projects" ,
@@ -255,8 +250,9 @@ export default function Menu() {
255
250
]
256
251
: [ ] ) ,
257
252
{
258
- title : "Docs" ,
259
- link : "https://www.gitpod.io/docs/" ,
253
+ title : "Workspaces" ,
254
+ link : "/workspaces" ,
255
+ alternatives : [ "/" ] ,
260
256
} ,
261
257
] ;
262
258
@@ -269,24 +265,29 @@ export default function Menu() {
269
265
} ;
270
266
const renderTeamMenu = ( ) => {
271
267
return (
272
- < div className = "flex p-1 pl-3 " >
268
+ < div className = "flex p-1 pl-3" >
273
269
{ projectSlug && (
274
- < div className = "flex h-full rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 px-2 py-1" >
275
- < Link to = { team ? `/t/${ team . slug } /projects` : `/projects` } >
276
- < span className = "text-base text-gray-600 dark:text-gray-400 font-semibold" >
277
- { team ?. name || userFullName }
278
- </ span >
279
- </ Link >
280
- </ div >
270
+ < Link to = { team ? `/t/${ team . slug } /projects` : `/projects` } >
271
+ < span className = "flex h-full text-base text-gray-500 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700 font-semibold pl-3 pr-2 py-1 bg-gray-50 hover:bg-gray-100 rounded-tl-2xl rounded-bl-2xl border-gray-100 dark:border-gray-700 border-r" >
272
+ { team ?. name || userFullName }
273
+ </ span >
274
+ </ Link >
281
275
) }
282
- < div className = "flex h-full rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800" >
276
+ { ! projectSlug && (
277
+ < Link to = { team ? `/t/${ team . slug } /projects` : `/projects` } >
278
+ < span className = "flex h-full text-base text-gray-500 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700 font-semibold pl-3 pr-2 py-1 bg-gray-50 hover:bg-gray-100 rounded-tl-2xl rounded-bl-2xl border-gray-100 dark:border-gray-700 border-r" >
279
+ { team ?. name || userFullName }
280
+ </ span >
281
+ </ Link >
282
+ ) }
283
+ < div className = "flex h-full rounded-tr-2xl rounded-br-2xl bg-gray-50 hover:bg-gray-100 px-1 dark:bg-gray-800 dark:hover:bg-gray-700" >
283
284
< ContextMenu
284
285
customClasses = "w-64 left-0"
285
286
menuEntries = { [
286
287
{
287
288
title : userFullName ,
288
289
customContent : (
289
- < div className = "w-full text-gray-400 flex flex-col" >
290
+ < div className = "w-full text-gray-500 flex flex-col" >
290
291
< span className = "text-gray-800 dark:text-gray-100 text-base font-semibold" >
291
292
{ userFullName }
292
293
</ span >
@@ -295,7 +296,7 @@ export default function Menu() {
295
296
) ,
296
297
active : ! team ,
297
298
separator : true ,
298
- link : "/" ,
299
+ link : "/projects " ,
299
300
} ,
300
301
...( teams || [ ] )
301
302
. map ( ( t ) => ( {
@@ -343,35 +344,50 @@ export default function Menu() {
343
344
} ,
344
345
] }
345
346
>
346
- < div className = "flex h-full px-2 py-1 space-x-3.5" >
347
- { ! projectSlug && (
348
- < span className = "text-base text-gray-600 dark:text-gray-400 font-semibold" >
349
- { team ?. name || userFullName }
350
- </ span >
351
- ) }
352
- < img
353
- alt = ""
354
- aria-label = "Toggle team selection menu"
355
- className = "filter-grayscale"
356
- style = { { marginTop : 5 , marginBottom : 5 } }
357
- src = { CaretUpDown }
358
- />
347
+ < div className = "flex h-full pl-0 pr-1 py-1.5 text-gray-50" >
348
+ < svg width = "20" height = "20" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
349
+ < path
350
+ fill-rule = "evenodd"
351
+ clip-rule = "evenodd"
352
+ d = "M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414Z"
353
+ fill = "#78716C"
354
+ />
355
+ < title > Toggle team selection menu</ title >
356
+ </ svg >
359
357
</ div >
360
358
</ ContextMenu >
361
359
</ div >
362
- { projectSlug && (
363
- < div className = "flex h-full rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 px-2 py-1" >
364
- < Link to = { `${ teamOrUserSlug } /${ projectSlug } ${ prebuildId ? "/prebuilds" : "" } ` } >
365
- < span className = "text-base text-gray-600 dark:text-gray-400 font-semibold" >
366
- { project ?. name }
367
- </ span >
368
- </ Link >
369
- </ div >
360
+ { projectSlug && ! prebuildId && (
361
+ < Link to = { `${ teamOrUserSlug } /${ projectSlug } ${ prebuildId ? "/prebuilds" : "" } ` } >
362
+ < span className = " flex h-full text-base text-gray-50 bg-gray-800 dark:bg-gray-50 dark:text-gray-900 font-semibold ml-2 px-3 py-1 rounded-2xl border-gray-100" >
363
+ { project ?. name }
364
+ </ span >
365
+ </ Link >
370
366
) }
371
367
{ prebuildId && (
372
- < div className = "flex h-full ml-2 py-1" >
373
- < img alt = "" className = "mr-3 filter-grayscale m-auto transform -rotate-90" src = { CaretDown } />
374
- < span className = "text-base text-gray-600 dark:text-gray-400 font-semibold" > { prebuildId } </ span >
368
+ < Link to = { `${ teamOrUserSlug } /${ projectSlug } ${ prebuildId ? "/prebuilds" : "" } ` } >
369
+ < span className = " flex h-full text-base text-gray-500 bg-gray-50 hover:bg-gray-100 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700 font-semibold ml-2 px-3 py-1 rounded-2xl border-gray-100" >
370
+ { project ?. name }
371
+ </ span >
372
+ </ Link >
373
+ ) }
374
+ { prebuildId && (
375
+ < div className = "flex ml-2" >
376
+ < div className = "flex pl-0 pr-1 py-1.5" >
377
+ < svg width = "20" height = "20" fill = "none" xmlns = "http://www.w3.org/2000/svg" >
378
+ < path
379
+ fill-rule = "evenodd"
380
+ clip-rule = "evenodd"
381
+ d = "M7.293 14.707a1 1 0 0 1 0-1.414L10.586 10 7.293 6.707a1 1 0 1 1 1.414-1.414l4 4a1 1 0 0 1 0 1.414l-4 4a1 1 0 0 1-1.414 0Z"
382
+ fill = "#78716C"
383
+ />
384
+ </ svg >
385
+ </ div >
386
+ < Link to = { `${ teamOrUserSlug } /${ projectSlug } /${ prebuildId } ` } >
387
+ < span className = "flex h-full text-base text-gray-50 bg-gray-800 dark:bg-gray-50 dark:text-gray-900 font-semibold px-3 py-1 rounded-2xl border-gray-100" >
388
+ { prebuildId . substring ( 0 , 8 ) . trimEnd ( ) }
389
+ </ span >
390
+ </ Link >
375
391
</ div >
376
392
) }
377
393
</ div >
@@ -380,11 +396,8 @@ export default function Menu() {
380
396
381
397
return (
382
398
< >
383
- < header
384
- className = { `app-container flex flex-col pt-4 space-y-4 ${ isMinimalUI || ! ! prebuildId ? "pb-4" : "" } ` }
385
- data-analytics = '{"button_type":"menu"}'
386
- >
387
- < div className = "flex h-10" >
399
+ < header className = "app-container flex flex-col pt-4 space-y-4" data-analytics = '{"button_type":"menu"}' >
400
+ < div className = "flex h-10 mb-3" >
388
401
< div className = "flex justify-between items-center pr-3" >
389
402
< Link to = "/" >
390
403
< img src = { gitpodIcon } className = "h-6" alt = "Gitpod's logo" />
@@ -393,7 +406,7 @@ export default function Menu() {
393
406
</ div >
394
407
< div className = "flex flex-1 items-center w-auto" id = "menu" >
395
408
< nav className = "flex-1" >
396
- < ul className = "flex flex-1 items-center justify-between text-base text-gray-700 space-x-2" >
409
+ < ul className = "flex flex-1 items-center justify-between text-base text-gray-500 dark:text-gray-400 space-x-2" >
397
410
< li className = "flex-1" > </ li >
398
411
{ ! isMinimalUI &&
399
412
rightMenu . map ( ( entry ) => (
@@ -427,6 +440,10 @@ export default function Menu() {
427
440
title : "Settings" ,
428
441
link : "/settings" ,
429
442
} ,
443
+ {
444
+ title : "Docs" ,
445
+ link : "https://www.gitpod.io/docs/" ,
446
+ } ,
430
447
{
431
448
title : "Help" ,
432
449
href : "https://www.gitpod.io/support" ,
@@ -448,7 +465,7 @@ export default function Menu() {
448
465
</ div >
449
466
{ isFeedbackFormVisible && < FeedbackFormModal onClose = { onFeedbackFormClose } /> }
450
467
</ div >
451
- { ! isMinimalUI && ! prebuildId && (
468
+ { ! isMinimalUI && ! prebuildId && ! isWorkspacesUI && ! isAdminUI && (
452
469
< nav className = "flex" >
453
470
{ leftMenu . map ( ( entry : Entry ) => (
454
471
< TabMenuItem
0 commit comments