import * as React from "react"; import { cssPropertyChangeCompleted, cssPropertyChanged } from "../../../../../../../actions"; import { DropdownMenuOption, dropdownMenuOptionFromValue } from "../../../../../../inputs/dropdown/controller"; import { memoize } from "tandem-common"; import { ComputedStyleInfo } from "paperclip"; // import { BaseBoxModelProps } from "./spacing.pc"; import { Dispatch } from "redux"; const BOX_SIZING_OPTIONS: DropdownMenuOption[] = [ undefined, "border-box", "content-box" ].map(dropdownMenuOptionFromValue); export type Props = { dispatch: Dispatch; computedStyleInfo: ComputedStyleInfo; }; export default (Base: React.ComponentClass) => class SpacingController extends React.PureComponent { onClick = () => {}; onPropertyChange = (name, value) => { this.props.dispatch(cssPropertyChanged(name, value)); }; onPropertyChangeComplete = (name, value) => { this.props.dispatch(cssPropertyChangeCompleted(name, value)); }; render() { const { onPropertyChange, onPropertyChangeComplete } = this; const { computedStyleInfo } = this.props; return ( ); } }; const propertyChangeCallback = memoize((name: string, listener) => value => listener(name, value) );