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:
uwap 2020-10-08 08:36:56 +02:00
parent 43a33c3ab3
commit 856aab41ad
18 changed files with 288 additions and 269 deletions

View file

@ -2,7 +2,8 @@
import type { Config } from "config/flowtypes";
import { hex } from "config/colors";
import * as types from "config/types";
import { mdi } from "config/icon";
import * as icons from "@mdi/js";
import { svg } from "config/icon";
const config: Config = {
space: {
@ -32,20 +33,19 @@ const config: Config = {
hauptraumTableLight: {
name: "Hauptraum Tisch",
position: [450, 450],
icon: mdi("white-balance-iridescent"),
iconColor: () => hex("#000000"),
icon: svg(icons.mdiWhiteBalanceIridescent),
ui: [
{
type: "toggle",
text: "Licht",
topic: "hauptraumTableLight",
icon: mdi("power")
icon: svg(icons.mdiPower)
},
{
type: "toggle",
text: "Licht",
topic: "hauptraumTableLightOnHack",
icon: mdi("power")
icon: svg(icons.mdiPower)
}
]
}