aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ColorBox.tsx
blob: 4aff770f90919dc9d596ce9a4d5934a10ebd2802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import React = require("react");
import { observer } from "mobx-react";
import { SketchPicker } from 'react-color';
import { FieldView, FieldViewProps } from './FieldView';
import "./ColorBox.scss";
import { InkingControl } from "../InkingControl";

@observer
export class ColorBox extends React.Component<FieldViewProps> {
    public static LayoutString(fieldKey?: string) { return FieldView.LayoutString(ColorBox, fieldKey); }
    render() {
        return <div className="colorBox-container" >
            <SketchPicker color={InkingControl.Instance.selectedColor} onChange={InkingControl.Instance.switchColor} />
        </div>;
    }
}