// @flow import { observable } from "mobx"; import { observer, inject } from "mobx-react"; import * as React from "react"; import styled, { withTheme } from "styled-components"; import UiStore from "stores/UiStore"; import Editor from "components/Editor"; import HelpText from "components/HelpText"; import { LabelText, Outline } from "components/Input"; type Props = {| label: string, minHeight?: number, maxHeight?: number, readOnly?: boolean, ui: UiStore, |}; @observer class InputRich extends React.Component { @observable editorComponent: React.ComponentType; @observable focused: boolean = false; handleBlur = () => { this.focused = false; }; handleFocus = () => { this.focused = true; }; render() { const { label, minHeight, maxHeight, ui, ...rest } = this.props; return ( <> {label} Loading editor…}> ); } } const StyledOutline = styled(Outline)` display: block; padding: 8px 12px; min-height: ${({ minHeight }) => (minHeight ? `${minHeight}px` : "0")}; max-height: ${({ maxHeight }) => (maxHeight ? `${maxHeight}px` : "auto")}; overflow-y: auto; > * { display: block; } `; export default inject("ui")(withTheme(InputRich));