Change AddEntryTo... to single-line component, add className prop to InputField and Autocomplete

This commit is contained in:
Florian Scholdei
2019-11-26 15:59:38 +01:00
parent 702cca59ed
commit b17f03247b
5 changed files with 90 additions and 38 deletions

View File

@@ -15,6 +15,7 @@ type Props = {
errorMessage?: string;
disabled?: boolean;
helpText?: string;
className?: string;
};
class InputField extends React.Component<Props> {
@@ -47,11 +48,21 @@ class InputField extends React.Component<Props> {
};
render() {
const { type, placeholder, value, validationError, errorMessage, disabled, label, helpText } = this.props;
const {
type,
placeholder,
value,
validationError,
errorMessage,
disabled,
label,
helpText,
className
} = this.props;
const errorView = validationError ? "is-danger" : "";
const helper = validationError ? <p className="help is-danger">{errorMessage}</p> : "";
return (
<div className="field">
<div className={classNames("field", className)}>
<LabelWithHelpIcon label={label} helpText={helpText} />
<div className="control">
<input