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

@ -40,12 +40,12 @@ export type AppState = {
};
/*
const App = (props: AppProps) => {
const topics = Array.isArray(props.config.topics) ?
Object.assign({}, ...props.config.topics) : props.config.topics;
const [mqttConnected, setMqttConnected] = useState(false);
};
*/
*const App = (props: AppProps) => {
* const topics = Array.isArray(props.config.topics) ?
* Object.assign({}, ...props.config.topics) : props.config.topics;
* const [mqttConnected, setMqttConnected] = useState(false);
*};
*/
class App extends React.PureComponent<AppProps & Classes, AppState> {
controlMap: React.Node

View file

@ -7,7 +7,7 @@ import filter from "lodash/filter";
import reduce from "lodash/reduce";
import MqttContext from "mqtt/context";
import type { Controls, Control, UIControl, ControlUI } from "config/flowtypes";
import { renderToString } from 'react-dom/server'
import { renderToString } from "react-dom/server";
export type Point = [number, number];

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];