File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,13 @@ function flattenNavigation(navigation: NavigationItem[]): NavigationItem[] {
69
69
return flatList
70
70
}
71
71
72
+ const allLinks = flattenNavigation ( navigation )
72
73
export function PrevNextLinks ( ) {
73
- let pathname = usePathname ( )
74
- let allLinks = flattenNavigation ( navigation )
74
+ const pathname = usePathname ( )
75
75
76
- let linkIndex = allLinks . findIndex ( ( link ) => link . href === pathname )
77
- let previousPage = linkIndex > - 1 ? allLinks [ linkIndex - 1 ] : null
78
- let nextPage = linkIndex > - 1 ? allLinks [ linkIndex + 1 ] : null
76
+ const linkIndex = allLinks . findIndex ( ( link ) => link . href === pathname )
77
+ const previousPage = linkIndex > - 1 ? allLinks [ linkIndex - 1 ] : null
78
+ const nextPage = linkIndex > - 1 ? allLinks [ linkIndex + 1 ] : null
79
79
80
80
if ( ! nextPage && ! previousPage ) {
81
81
return null
You can’t perform that action at this time.
0 commit comments