We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
please help me!!! How to do the navigation menu ? MainMenuItem is none。 // // <MainMenuItem // icon={} //> // Stake // // <MainMenuItem // active // icon={} // > // Wrap // // <MainMenuItem // icon={} // > // Wallet // //
The text was updated successfully, but these errors were encountered:
@bxlkm Hello! You can wrap MainMenuItem by MainMenu And use React router to check the current path with useRouter hook in next.js (or useLocation in React.js). You can find a simple example here - https://github.com/lidofinance/ui/blob/main/packages/main-menu/MainMenu.stories.tsx Docs for next useRouter - https://nextjs.org/docs/api-reference/next/router Docs for react useLocation - https://v5.reactrouter.com/web/api/Hooks/uselocation
MainMenuItem
MainMenu
React
useRouter
useLocation
This should be enough. If you have any questions - please let me know =)
const Component = () => { const router = useRouter(); return ( <MainMenu> <MainMenuItem active={router.pathname === '/stake'} icon={<Stake />}> Stake </MainMenuItem> <MainMenuItem active={router.pathname === '/wrap'} icon={<Wrap />}> Wrap </MainMenuItem> <MainMenuItem active={router.pathname === '/wallet'} icon={<Wallet />}> Wallet </MainMenuItem> </MainMenu> ) }
Sorry, something went wrong.
No branches or pull requests
please help me!!!
How to do the navigation menu ?
MainMenuItem is none。
//
// <MainMenuItem
// icon={}
//>
// Stake
//
// <MainMenuItem
// active
// icon={}
// >
// Wrap
//
// <MainMenuItem
// icon={}
// >
// Wallet
//
//
The text was updated successfully, but these errors were encountered: