Add Icon to sidebar
This commit is contained in:
parent
74c4138bad
commit
b84cc6d4a2
2 changed files with 13 additions and 7 deletions
|
|
@ -8,6 +8,7 @@ import IconButton from "material-ui/IconButton";
|
|||
import AppBar from "material-ui/AppBar";
|
||||
import Toolbar from "material-ui/Toolbar";
|
||||
import List from "material-ui/List";
|
||||
import { renderIcon } from "utils/parseIconName";
|
||||
|
||||
export type SideBarProps = {
|
||||
control: ?Control,
|
||||
|
|
@ -27,6 +28,9 @@ class SideBar extends React.Component<SideBarProps & Classes, SideBarState> {
|
|||
return {
|
||||
drawerPaper: {
|
||||
width: 320
|
||||
},
|
||||
flex: {
|
||||
flex: 1
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -45,12 +49,14 @@ class SideBar extends React.Component<SideBarProps & Classes, SideBarState> {
|
|||
>
|
||||
<AppBar position="static">
|
||||
<Toolbar>
|
||||
<IconButton onClick={this.close.bind(this)}>
|
||||
<i className="mdi mdi-format-horizontal-align-right mdi-36px"></i>
|
||||
</IconButton>
|
||||
<Typography type="title">
|
||||
{this.props.control == null
|
||||
|| renderIcon(this.props.control.icon, "mdi-36px")}
|
||||
<Typography type="title" className={this.props.classes.flex}>
|
||||
{this.props.control == null || this.props.control.name}
|
||||
</Typography>
|
||||
<IconButton onClick={this.close.bind(this)}>
|
||||
<i className="mdi mdi-close mdi-36px"></i>
|
||||
</IconButton>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<List id="drawer_uiComponents">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue