mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
Format validation; redo of PR 3116
This commit is contained in:
parent
62f30c7a8b
commit
911ecc8516
2 changed files with 13 additions and 3 deletions
|
@ -11,9 +11,10 @@ require('../forms/row.scss');
|
|||
const FormikInput = ({
|
||||
className,
|
||||
error,
|
||||
validationClassName,
|
||||
...props
|
||||
}) => (
|
||||
<div className="col-sm-9 row">
|
||||
<div className="col-sm-9 row row-relative">
|
||||
<Field
|
||||
className={classNames(
|
||||
'input',
|
||||
|
@ -22,7 +23,10 @@ const FormikInput = ({
|
|||
{...props}
|
||||
/>
|
||||
{error && (
|
||||
<ValidationMessage message={error} />
|
||||
<ValidationMessage
|
||||
className={validationClassName}
|
||||
message={error}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
@ -31,7 +35,8 @@ const FormikInput = ({
|
|||
FormikInput.propTypes = {
|
||||
className: PropTypes.string,
|
||||
error: PropTypes.string,
|
||||
type: PropTypes.string
|
||||
type: PropTypes.string,
|
||||
validationClassName: PropTypes.string
|
||||
};
|
||||
|
||||
module.exports = FormikInput;
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* allow elements such as validation errors to position relative to this row */
|
||||
.row-relative {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.row-label {
|
||||
margin-bottom: .75rem;
|
||||
line-height: 1.7rem;
|
||||
|
|
Loading…
Reference in a new issue