// @flow import * as React from "react"; import withStyles from "@material-ui/core/styles/withStyles"; import Drawer from "@material-ui/core/Drawer"; import Typography from "@material-ui/core/Typography"; import IconButton from "@material-ui/core/IconButton"; import AppBar from "@material-ui/core/AppBar"; import Toolbar from "@material-ui/core/Toolbar"; import List from "@material-ui/core/List"; import { renderIcon } from "config/icon"; import type { RawIcon } from "config/icon"; import type { Control } from "config/flowtypes"; export type SideBarProps = { control: ?Control, open: boolean, onCloseRequest: () => void, icon?: ?RawIcon, children?: React.Node }; export type SideBarState = { }; type Props = SideBarProps & Classes; class SideBar extends React.PureComponent { constructor(props: Props) { super(props); } static styles(): Object { return { drawerPaper: { width: 340 }, flex: { flex: 1 } }; } close() { this.props.onCloseRequest(); } render() { return ( {this.props.icon == null || renderIcon(this.props.icon, "mdi-36px")} {this.props.control == null ? "" : this.props.control.name} {this.props.children} ); } } export default withStyles(SideBar.styles)(SideBar);