File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,10 @@ import {NavList} from '@primer/react'
210
210
211
211
function NavItem ({href, children}) {
212
212
const router = useRouter ()
213
- const isCurrent = router .asPath === href
213
+ const isCurrent =
214
+ typeof href === ' string'
215
+ ? router .asPath === href
216
+ : router .pathname === href .pathname ;
214
217
return (
215
218
< Link href= {href} passHref>
216
219
< NavList .Item aria- current= {isCurrent ? ' page' : false }> {children}< / NavList .Item >
@@ -224,6 +227,14 @@ function App() {
224
227
< NavItem href= " /" > Dashboard< / NavItem>
225
228
< NavItem href= " /pulls" > Pull requests< / NavItem>
226
229
< NavItem href= " /issues" > Issues< / NavItem>
230
+ < NavItem
231
+ href= {{
232
+ pathname: ' /[owner]/[repo]' ,
233
+ query: { owner, repo },
234
+ }}
235
+ >
236
+ Summary
237
+ < / NavItem>
227
238
< / NavList>
228
239
)
229
240
}
You can’t perform that action at this time.
0 commit comments