Require the use of hex, rgb, rgba or rainbow for colors and refactor config types

This commit is contained in:
uwap 2018-02-04 03:43:22 +01:00
parent 436abf682f
commit a96fa1622b
14 changed files with 178 additions and 147 deletions

View file

@ -2,6 +2,8 @@
import React from "react";
import _ from "lodash";
import type { Config, Control, Topics } from "config/types";
import MuiThemeProvider from "material-ui/styles/MuiThemeProvider";
import createMuiTheme from "material-ui/styles/createMuiTheme";
import withStyles from "material-ui/styles/withStyles";

View file

@ -5,6 +5,8 @@ import Leaflet from "leaflet";
import _ from "lodash";
import parseIconName, { controlGetIcon } from "utils/parseIconName";
import type { Controls, Control } from "config/types";
export type Point = [number, number];
const convertPoint = ([y, x]: Point): Point => [-x, y];

View file

@ -10,6 +10,8 @@ import Toolbar from "material-ui/Toolbar";
import List from "material-ui/List";
import { renderIcon } from "utils/parseIconName";
import type { Control } from "config/types";
export type SideBarProps = {
control: ?Control,
open: boolean,

View file

@ -14,6 +14,11 @@ import { MenuItem } from "material-ui/Menu";
import Button from "material-ui/Button";
import { LinearProgress } from "material-ui/Progress";
import type {
UIControl, UIToggle, UIDropDown, UILink,
UISection, UIText, UIProgress
} from "config/types";
import keyOf from "utils/keyOf";
import { getInternals, getActuals } from "utils/state";

View file

@ -9,6 +9,8 @@ import {
} from "material-ui/List";
import { renderIcon } from "utils/parseIconName";
import type { ControlUI, UIControl, UISlider } from "config/types";
// TODO: Use something else
import Slider from "material-ui-old/Slider";
import MuiThemeProvider from "material-ui-old/styles/MuiThemeProvider";