Created
March 12, 2020 15:36
-
-
Save nazariyv/b9cd05903c889057aa83cc1b64c2034b to your computer and use it in GitHub Desktop.
side-navigation.jsx
This file contains hidden or 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
| import * as React from "react"; | |
| import { withRouter } from "react-router"; | |
| import { Navigation } from "baseui/side-navigation"; | |
| import { Block } from "baseui/block"; | |
| const SideNavigation = ({ history, location }) => { | |
| return ( | |
| <Block | |
| style={{ | |
| height: "100%", | |
| borderRightStyle: "solid" | |
| }} | |
| > | |
| <Navigation | |
| items={[ | |
| { | |
| title: "Create Escrow", | |
| itemId: "/create-escrow" | |
| }, | |
| { | |
| title: "Check Escrow", | |
| itemId: "/check-escrow" | |
| }, | |
| { | |
| title: "Approve Escrow", | |
| itemId: "/approve-escrow" | |
| }, | |
| { | |
| title: "Release Escrow", | |
| itemId: "/release-escrow" | |
| } | |
| ]} | |
| activeItemId={location.pathname} // activeItemId | |
| onChange={({ event, item }) => { | |
| event.preventDefault(); | |
| history.push(item.itemId); | |
| }} | |
| /> | |
| </Block> | |
| ); | |
| }; | |
| export default withRouter(SideNavigation); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment