@@ -428,21 +428,20 @@ function App() {
428
428
< Route
429
429
exact
430
430
path = { projectsPathMainWithParams }
431
- render = { ( props ) => {
432
- const { resourceOrPrebuild } = props . match . params ;
433
- if ( resourceOrPrebuild === "events" ) {
434
- return < Events /> ;
435
- }
436
- if ( resourceOrPrebuild === "prebuilds" ) {
437
- return < Prebuilds /> ;
438
- }
439
- if ( resourceOrPrebuild === "settings" ) {
440
- return < ProjectSettings /> ;
441
- }
442
- if ( resourceOrPrebuild === "variables" ) {
443
- return < ProjectVariables /> ;
431
+ render = { ( { match } ) => {
432
+ const { resourceOrPrebuild } = match . params ;
433
+ switch ( resourceOrPrebuild ) {
434
+ case "events" :
435
+ return < Events /> ;
436
+ case "prebuilds" :
437
+ return < Prebuilds /> ;
438
+ case "settings" :
439
+ return < ProjectSettings /> ;
440
+ case "variables" :
441
+ return < ProjectVariables /> ;
442
+ default :
443
+ return resourceOrPrebuild ? < Prebuild /> : < Project /> ;
444
444
}
445
- return resourceOrPrebuild ? < Prebuild /> : < Project /> ;
446
445
} }
447
446
/>
448
447
</ Route >
@@ -459,39 +458,36 @@ function App() {
459
458
< Route
460
459
exact
461
460
path = { `/t/${ team . slug } /:maybeProject/:resourceOrPrebuild?` }
462
- render = { ( props ) => {
463
- const { maybeProject, resourceOrPrebuild } = props . match . params ;
464
- if ( maybeProject === "projects" ) {
465
- return < Projects /> ;
466
- }
467
- if ( maybeProject === "workspaces" ) {
468
- return < Workspaces /> ;
469
- }
470
- if ( maybeProject === "members" ) {
471
- return < Members /> ;
472
- }
473
- if ( maybeProject === "settings" ) {
474
- return < TeamSettings /> ;
461
+ render = { ( { match } ) => {
462
+ const { maybeProject, resourceOrPrebuild } = match . params ;
463
+ switch ( maybeProject ) {
464
+ case "projects" :
465
+ return < Projects /> ;
466
+ case "workspaces" :
467
+ return < Workspaces /> ;
468
+ case "members" :
469
+ return < Members /> ;
470
+ case "settings" :
471
+ return < TeamSettings /> ;
472
+ case "billing" :
473
+ return < TeamBilling /> ;
474
+ case "usage" :
475
+ return < TeamUsage /> ;
476
+ default :
477
+ break ;
475
478
}
476
- if ( maybeProject === "billing" ) {
477
- return < TeamBilling /> ;
478
- }
479
- if ( maybeProject === "usage" ) {
480
- return < TeamUsage /> ;
481
- }
482
- if ( resourceOrPrebuild === "events" ) {
483
- return < Events /> ;
484
- }
485
- if ( resourceOrPrebuild === "prebuilds" ) {
486
- return < Prebuilds /> ;
487
- }
488
- if ( resourceOrPrebuild === "settings" ) {
489
- return < ProjectSettings /> ;
490
- }
491
- if ( resourceOrPrebuild === "variables" ) {
492
- return < ProjectVariables /> ;
479
+ switch ( resourceOrPrebuild ) {
480
+ case "events" :
481
+ return < Events /> ;
482
+ case "prebuilds" :
483
+ return < Prebuilds /> ;
484
+ case "settings" :
485
+ return < ProjectSettings /> ;
486
+ case "variables" :
487
+ return < ProjectVariables /> ;
488
+ default :
489
+ return resourceOrPrebuild ? < Prebuild /> : < Project /> ;
493
490
}
494
- return resourceOrPrebuild ? < Prebuild /> : < Project /> ;
495
491
} }
496
492
/>
497
493
</ Route >
0 commit comments