-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom mode searching did not work after the react-router 6 updates.
- Loading branch information
Showing
5 changed files
with
112 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { buildPath } from '../shared/routing' | ||
import { NavigationMenuAnyRoute } from '../Header/NavigationMenu' | ||
import { LEDGERS_ROUTE, NETWORK_ROUTE, VALIDATOR_ROUTE } from './routes' | ||
|
||
const isNetwork = (path) => | ||
path.indexOf(buildPath(NETWORK_ROUTE, {})) === 0 || | ||
path.indexOf(buildPath(VALIDATOR_ROUTE, { identifier: '' })) === 0 | ||
|
||
// NOTE: for submenus, remove `path` field and add `children` array of objects | ||
export const navigationConfig: NavigationMenuAnyRoute[] = [ | ||
{ | ||
route: LEDGERS_ROUTE, | ||
title: 'explorer', | ||
current: (path: string) => !isNetwork(path), | ||
}, | ||
{ | ||
route: NETWORK_ROUTE, | ||
title: 'network', | ||
current: (path: string) => isNetwork(path), | ||
}, | ||
{ | ||
link: 'https://xrpl.org', | ||
title: 'xrpl_org', | ||
}, | ||
{ | ||
link: 'https://github.com/ripple/explorer', | ||
title: 'github', | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters