Skip to content

Instantly share code, notes, and snippets.

@nazariyv
Created March 12, 2020 15:36
Show Gist options
  • Select an option

  • Save nazariyv/b9cd05903c889057aa83cc1b64c2034b to your computer and use it in GitHub Desktop.

Select an option

Save nazariyv/b9cd05903c889057aa83cc1b64c2034b to your computer and use it in GitHub Desktop.
side-navigation.jsx
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