Improve the entire icon logic
- Tree Shaking for Icons (Closes #53) - New API for the config (See https://github.com/uwap/mqtt-control-map/wiki/Icons) - Icons can now be colored everywhere, not just on the map
This commit is contained in:
parent
43a33c3ab3
commit
856aab41ad
18 changed files with 288 additions and 269 deletions
|
|
@ -8,16 +8,14 @@ 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 { renderRawIcon } 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,
|
||||
icon?: ?React.Node,
|
||||
children?: React.Node
|
||||
};
|
||||
|
||||
|
|
@ -43,7 +41,7 @@ const SideBar = (props: SideBarProps) => {
|
|||
<AppBar position="static">
|
||||
<Toolbar>
|
||||
<span>
|
||||
{props.icon == null || renderRawIcon(props.icon, "mdi-36px")}
|
||||
{props.icon == null || props.icon}
|
||||
</span>
|
||||
<Typography variant="subtitle1" className={classes.title}>
|
||||
{props.control == null ? "" : props.control.name}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue