import React from "react"; import Example, { ExampleCode } from "./components/Example"; import { FlexBox, FlexItem, Button, LeftNav, Icon } from "../src/"; import "./LeftNavExample.less"; export default class LeftNavExample extends React.Component { constructor(props) { super(props); this.state = { selected: "Home", collapseOnSubNavOpen: true, collapsed: false, closeSubNavOnBlur: true, withActiveNavGroups: true, withTooltips: true, }; } _renderCheckbox(id) { const { cssClass } = LeftNavExample; return ( this.setState({ [id]: e.target.checked })} /> {id} ); } render() { const { cssClass } = LeftNavExample; const { NavLink, NavGroup } = LeftNav; const { closeSubNavOnBlur, collapseOnSubNavOpen, collapsed, selected, withActiveNavGroups, withTooltips, } = this.state; const icon = (name) => ; const link = (label, iconNode) => ( this.setState({ selected: label })} /> ); return ( } onClick={() => this.setState({ collapsed: !collapsed })} /> this.setState({ collapsed: !collapsed })} /> {link("Home", icon(Icon.names.SCHOOL))} {link("Hammer")} {link("Screwdriver")} {link("Measuring Tape")} {link("Balls")} {link("Clubs")} {link("Rings")} {link("So Much To Say")} {link("So Little Time")} {link("Profile", icon(Icon.names.USER))} {selected} Look at that pretty left nav! {this._renderCheckbox("collapseOnSubNavOpen")} {this._renderCheckbox("closeSubNavOnBlur")} {this._renderCheckbox("withActiveNavGroups")} {this._renderCheckbox("withTooltips")} ); } } LeftNavExample.cssClass = { COLLAPSE: "LeftNavExample--collapse", CONFIG_CONTAINER: "LeftNavExample--configContainer", CONFIG: "LeftNavExample--config", CONTAINER: "LeftNavExample", RIGHT_PANE: "LeftNavExample--rightPane", };
Look at that pretty left nav!