ensure all publish form errors have same styling

This commit is contained in:
Sean Yesmunt 2018-06-28 16:12:17 -04:00
parent abacec9e3a
commit b79d13b44d
2 changed files with 5 additions and 17 deletions

View file

@ -251,23 +251,15 @@ class PublishForm extends React.PureComponent<Props> {
renderFormErrors() { renderFormErrors() {
const { name, nameError, title, bid, bidError, tosAccepted } = this.props; const { name, nameError, title, bid, bidError, tosAccepted } = this.props;
if (nameError || bidError) { // These are extra help
// There will be inline errors if either of these exist // If there is an error it will be presented as an inline error as well
// These are just extra help at the bottom of the screen
// There could be multiple bid errors, so just duplicate it at the bottom
return (
<div className="card__subtitle form-field__error">
{nameError && <div>{__('The URL you created is not valid.')}</div>}
{bidError && <div>{bidError}</div>}
</div>
);
}
return ( return (
<div className="card__content card__subtitle card__subtitle--block form-field__error"> <div className="card__content card__subtitle form-field__error">
{!title && <div>{__('A title is required')}</div>} {!title && <div>{__('A title is required')}</div>}
{!name && <div>{__('A URL is required')}</div>} {!name && <div>{__('A URL is required')}</div>}
{name && nameError && <div>{__('The URL you created is not valid.')}</div>}
{!bid && <div>{__('A bid amount is required')}</div>} {!bid && <div>{__('A bid amount is required')}</div>}
{bid && bidError && <div>{bidError}</div>}
{!tosAccepted && <div>{__('You must agree to the terms of service')}</div>} {!tosAccepted && <div>{__('You must agree to the terms of service')}</div>}
</div> </div>
); );

View file

@ -150,10 +150,6 @@
padding-top: $spacing-vertical * 1/3; padding-top: $spacing-vertical * 1/3;
} }
.card__subtitle--block {
display: block;
}
.card__meta { .card__meta {
color: var(--color-help); color: var(--color-help);
font-size: 14px; font-size: 14px;