@@ -55,10 +55,13 @@ export const menuItems = ({
55
55
56
56
const item =
57
57
( baseUrl : string , page : string ) =>
58
- ( label : string , pageName ?: string , matcher ?: ( url : string ) => boolean ) => {
58
+ ( label : string , pageName ?: string , matchSubPath ?: string ) => {
59
59
const href = pageName ? `${ baseUrl } /${ pageName } ` : baseUrl ;
60
60
const { count, badge } = getInventory ( pageName ) ;
61
- const active = matcher ?.( path ) || pageName === page ;
61
+ const active =
62
+ ( matchSubPath && path . startsWith ( `/team/${ team } /${ page } /${ matchSubPath } /` ) ) ||
63
+ pageName === page ;
64
+
62
65
return {
63
66
label,
64
67
href,
@@ -89,15 +92,14 @@ export const menuItems = ({
89
92
[ menuItem ( 'Overview' ) ] ,
90
93
[ menuItem ( 'Applications' , 'applications' ) , menuItem ( 'Jobs' , 'jobs' ) ] ,
91
94
[
92
- member &&
93
- menuItem ( 'Secrets' , 'secrets' , ( url ) => url . startsWith ( `/team/${ team } /${ page } /secret/` ) ) ,
94
- menuItem ( 'Postgres' , 'postgres' ) ,
95
- menuItem ( 'Buckets' , 'buckets' ) ,
96
- features ?. redis && menuItem ( 'Redis' , 'redis' ) ,
97
- features ?. valkey && menuItem ( 'Valkey' , 'valkey' ) ,
98
- features ?. openSearch && menuItem ( 'OpenSearch' , 'opensearch' ) ,
99
- features ?. kafka && menuItem ( 'Kafka topics' , 'kafka' ) ,
100
- menuItem ( 'BigQuery' , 'bigquery' ) ,
95
+ member && menuItem ( 'Secrets' , 'secrets' , 'secret' ) ,
96
+ menuItem ( 'Postgres' , 'postgres' , 'postgres' ) ,
97
+ menuItem ( 'Buckets' , 'buckets' , 'bucket' ) ,
98
+ features ?. redis && menuItem ( 'Redis' , 'redis' , 'redis' ) ,
99
+ features ?. valkey && menuItem ( 'Valkey' , 'valkey' , 'valkey' ) ,
100
+ features ?. openSearch && menuItem ( 'OpenSearch' , 'opensearch' , 'opensearch' ) ,
101
+ features ?. kafka && menuItem ( 'Kafka topics' , 'kafka' , 'kafka' ) ,
102
+ menuItem ( 'BigQuery' , 'bigquery' , 'bigquery' ) ,
101
103
features ?. unleash && menuItem ( 'Unleash' , 'unleash' )
102
104
] . filter ( Boolean ) as { label : string ; href : string ; active ?: boolean } [ ] ,
103
105
[
0 commit comments