File tree Expand file tree Collapse file tree 1 file changed +25
-17
lines changed
apps/webapp/app/components/navigation Expand file tree Collapse file tree 1 file changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -357,23 +357,31 @@ function ProjectSelector({
357
357
< Fragment key = { organization . id } >
358
358
< PopoverSectionHeader title = { organization . title } />
359
359
< div className = "flex flex-col gap-1 p-1" >
360
- { organization . projects . map ( ( p ) => {
361
- const isSelected = p . id === project . id ;
362
- return (
363
- < PopoverMenuItem
364
- key = { p . id }
365
- to = { projectPath ( organization , p ) }
366
- title = {
367
- < div className = "flex w-full items-center justify-between text-bright" >
368
- < span className = "grow truncate text-left" > { p . name } </ span >
369
- < MenuCount count = { p . jobCount } />
370
- </ div >
371
- }
372
- isSelected = { isSelected }
373
- icon = "folder"
374
- />
375
- ) ;
376
- } ) }
360
+ { organization . projects . length > 0 ? (
361
+ organization . projects . map ( ( p ) => {
362
+ const isSelected = p . id === project . id ;
363
+ return (
364
+ < PopoverMenuItem
365
+ key = { p . id }
366
+ to = { projectPath ( organization , p ) }
367
+ title = {
368
+ < div className = "flex w-full items-center justify-between text-bright" >
369
+ < span className = "grow truncate text-left" > { p . name } </ span >
370
+ < MenuCount count = { p . jobCount } />
371
+ </ div >
372
+ }
373
+ isSelected = { isSelected }
374
+ icon = "folder"
375
+ />
376
+ ) ;
377
+ } )
378
+ ) : (
379
+ < PopoverMenuItem
380
+ to = { newProjectPath ( organization ) }
381
+ title = "New project"
382
+ icon = "plus"
383
+ />
384
+ ) }
377
385
</ div >
378
386
</ Fragment >
379
387
) ) }
You can’t perform that action at this time.
0 commit comments