Cleanup flow types and fix eslint errors
This commit is contained in:
parent
ef41de4349
commit
c1ed43ee6c
4 changed files with 118 additions and 147 deletions
|
|
@ -7,7 +7,7 @@ import parseIconName, { controlGetIcon } from "utils/parseIconName";
|
|||
|
||||
export type Point = [number, number];
|
||||
|
||||
const convertPoint = ([y,x]: Point): Point => [-x, y];
|
||||
const convertPoint = ([y, x]: Point): Point => [-x, y];
|
||||
|
||||
export type ControlMapProps = {
|
||||
width: number,
|
||||
|
|
@ -58,12 +58,10 @@ export default class ControlMap extends React.Component<ControlMapProps> {
|
|||
}
|
||||
|
||||
iconColor(control: Control): string {
|
||||
const ints = _.mapValues(this.props.state, (x) => x.internal || x.actual);
|
||||
const acts = _.mapValues(this.props.state, (x) => x.actual);
|
||||
if (control.iconColor != null) {
|
||||
return control.iconColor(
|
||||
_.mapValues(this.props.state, (x) => x.internal || x.actual),
|
||||
_.mapValues(this.props.state, (x) => x.actual),
|
||||
this.props.state
|
||||
);
|
||||
return control.iconColor(ints, acts, this.props.state);
|
||||
}
|
||||
return "#000";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue