Fix eslint errors

This commit is contained in:
uwap 2020-10-08 08:46:06 +02:00
parent 856aab41ad
commit 8376f404e4
10 changed files with 44 additions and 46 deletions

View file

@ -1,5 +1,4 @@
// @flow
import type { Color } from "config/colors";
import type { Icon } from "config/icon";
export type TopicType = (msg: Buffer) => string;

View file

@ -1,9 +1,8 @@
// @flow
import React from "react";
import ReactIcon from "@mdi/react";
import ReactContext from "mqtt/context";
import { hex, type Color } from "./colors"
import * as mdiIcons from "@mdi/js"
import { type Color } from "./colors";
import * as mdiIcons from "@mdi/js";
export type Icon = {
render: (s: State) => React.Node,
@ -36,7 +35,7 @@ export const svg = (data: string, props?: IconPropHelper): Icon => {
horizontal={props?.horizontal ?? false}
vertical={props?.vertical ?? false}
color={propColor(state)}
/>
/>
),
size: (n: number) => svg(data, {...props, size: n}),
rotate: (n: number) => svg(data, {...props, rotate: n}),
@ -44,7 +43,7 @@ export const svg = (data: string, props?: IconPropHelper): Icon => {
flipV: () => svg(data, {...props, vertical: !props?.vertical ?? true}),
color: (c: Color | (State) => Color) => svg(data, {...props, color: c})
};
}
};
export const withState = (f: (s: State) => Icon): Icon => {
return {
@ -55,7 +54,7 @@ export const withState = (f: (s: State) => Icon): Icon => {
flipV: () => withState(f),
color: () => withState(f)
};
}
};
export const mdiBattery = (topic: string): Icon => withState((state) => {
const rawval = state[topic];