This repository was archived by the owner on Mar 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed
Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 1111 "noEmptyInterface" : " off" ,
1212 "noExplicitAny" : " off" ,
1313 "noArrayIndexKey" : " off" ,
14- "noShadowRestrictedNames" : " off" ,
15- "noAssignInExpressions" : " off"
14+ "noShadowRestrictedNames" : " off"
1615 },
1716 "a11y" : {
1817 "noSvgWithoutTitle" : " off"
Original file line number Diff line number Diff line change @@ -97,10 +97,14 @@ export const Menu: FC<MenuProps> = ({ components }) => {
9797 label : c . name ,
9898 icon : ( ) => c . icon ?? null ,
9999 selected : matchPath ( location . pathname , c . route ) !== null ,
100- onClick : ( ) =>
101- / ^ h t t p s ? : \/ \/ / . test ( c . route )
102- ? ( window . location . href = c . route )
103- : selectTab ( c . route ) ,
100+ onClick : ( ) => {
101+ const routeMatches = / ^ h t t p s ? : \/ \/ / . test ( c . route )
102+ if ( routeMatches ) {
103+ window . location . href = c . route
104+ return
105+ }
106+ selectTab ( c . route )
107+ } ,
104108 ...c ,
105109 } ) ) as unknown as ReadonlyArray < ComponentGroup > ,
106110 [ location . pathname , components , selectTab ]
Original file line number Diff line number Diff line change @@ -79,10 +79,14 @@ export const Menu: FC<MenuProps> = ({ components }) => {
7979 label : c . name ,
8080 icon : ( ) => null ,
8181 selected : c . route === location . pathname ,
82- onClick : ( ) =>
83- / ^ h t t p s ? : \/ \/ / . test ( c . route )
84- ? ( window . location . href = c . route )
85- : selectTab ( c . route ) ,
82+ onClick : ( ) => {
83+ const routeMatches = / ^ h t t p s ? : \/ \/ / . test ( c . route )
84+ if ( routeMatches ) {
85+ window . location . href = c . route
86+ return
87+ }
88+ selectTab ( c . route )
89+ } ,
8690 ...c ,
8791 } ) ) as unknown as ReadonlyArray < ComponentGroup > ,
8892 [ location . pathname , components , selectTab ]
You can’t perform that action at this time.
0 commit comments