Validate input fields

Summary: Adds basic non-empty validation to title and description.

Reviewed By: mweststrate

Differential Revision: D18762778

fbshipit-source-id: 4bdbb550f4e740d399fbeaa9fb8170b801fc500e
This commit is contained in:
John Knox
2019-12-02 10:21:22 -08:00
committed by Facebook Github Bot
parent bb6a7c50cd
commit d791814dfa
3 changed files with 45 additions and 16 deletions

View File

@@ -11,8 +11,20 @@ import styled from 'react-emotion';
import {inputStyle} from './Input';
const Textarea = styled('textarea')(
({compact, readOnly}: {compact?: boolean; readOnly?: boolean}) => ({
...inputStyle(compact || false, readOnly || false),
({
compact,
readOnly,
valid,
}: {
compact?: boolean;
readOnly?: boolean;
valid?: boolean;
}) => ({
...inputStyle({
compact: compact || false,
readOnly: readOnly || false,
valid: valid !== false,
}),
lineHeight: 'normal',
padding: compact ? '5px' : '8px',
resize: 'none',