Merge pull request #935 from mewtaylor/issue/gh-933

Fix GH-933: Put label for “Not Required” above input
This commit is contained in:
Matthew Taylor 2016-10-02 11:46:02 -04:00 committed by GitHub
commit 5c3cba2a89
2 changed files with 15 additions and 3 deletions

View file

@ -20,3 +20,8 @@
} }
} }
} }
.row-label {
margin-bottom: .75rem;
line-height: 1.7rem;
}

View file

@ -741,8 +741,15 @@ module.exports = {
required /> : required /> :
[] []
} }
<Input label={formatMessage({id: 'teacherRegistration.zipCode'})} <b className="row-label">
type="text" <intl.FormattedMessage id="teacherRegistration.zipCode" />
</b>
{this.state.countryChoice !== 'us' ?
<p className="help-text">
<intl.FormattedMessage id="teacherRegistration.notRequired" />
</p> : []
}
<Input type="text"
name="address.zip" name="address.zip"
validations={{ validations={{
maxLength: 10 maxLength: 10
@ -752,7 +759,7 @@ module.exports = {
id: 'registration.validationMaxLength' id: 'registration.validationMaxLength'
}) })
}} }}
required={(this.state.countryChoice === 'us')} /> required={(this.state.countryChoice === 'us') ? true : 'isFalse'} />
<GeneralError name="all" /> <GeneralError name="all" />
<NextStepButton waiting={this.props.waiting || this.state.waiting} <NextStepButton waiting={this.props.waiting || this.state.waiting}
text={<intl.FormattedMessage id="registration.nextStep" />} /> text={<intl.FormattedMessage id="registration.nextStep" />} />