-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use parentPath property to fix the issue
I've manage to resolve the issue using `resolvePath` and `matchPath` functions instead of `useMatch` and `useResolvedPath` hooks. For that I had to introduce a new property - `parentPath` - that is passed to `SubNavigationPills` component and will be used as a `pathnaemBase` for the `resolvePath` function. If more than one pill is active then the one with the longest `pathnameBase` from the `matchPath` function will be active. This will happen when there are two paths with asterisk, for example: `tBTC/*`, `tBTC/how-it-work/*`. For the path `tBTC/how-it-work/overview` we want only the second one to be active so we are picking the one with the longest `pathnameBase`. In the first case the pathnameBase is `tBTC` and in the second one it's `tBTC/how-it-works`.
- Loading branch information
1 parent
1f37f71
commit 780e859
Showing
8 changed files
with
121 additions
and
42 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
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
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