mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge pull request #3133 from benjiwheeler/retry-join-flow-format-validation
Format validation; redo of PR 3116
This commit is contained in:
commit
5a175bc1af
3 changed files with 16 additions and 3 deletions
|
@ -11,9 +11,10 @@ require('../forms/row.scss');
|
||||||
const FormikInput = ({
|
const FormikInput = ({
|
||||||
className,
|
className,
|
||||||
error,
|
error,
|
||||||
|
validationClassName,
|
||||||
...props
|
...props
|
||||||
}) => (
|
}) => (
|
||||||
<div className="col-sm-9 row">
|
<div className="col-sm-9 row row-with-tooltip">
|
||||||
<Field
|
<Field
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'input',
|
'input',
|
||||||
|
@ -22,7 +23,10 @@ const FormikInput = ({
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
{error && (
|
{error && (
|
||||||
<ValidationMessage message={error} />
|
<ValidationMessage
|
||||||
|
className={validationClassName}
|
||||||
|
message={error}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -31,7 +35,8 @@ const FormikInput = ({
|
||||||
FormikInput.propTypes = {
|
FormikInput.propTypes = {
|
||||||
className: PropTypes.string,
|
className: PropTypes.string,
|
||||||
error: PropTypes.string,
|
error: PropTypes.string,
|
||||||
type: PropTypes.string
|
type: PropTypes.string,
|
||||||
|
validationClassName: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = FormikInput;
|
module.exports = FormikInput;
|
||||||
|
|
|
@ -21,6 +21,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* allow elements such as validation errors to position relative to this row */
|
||||||
|
.row-with-tooltip {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.row-label {
|
.row-label {
|
||||||
margin-bottom: .75rem;
|
margin-bottom: .75rem;
|
||||||
line-height: 1.7rem;
|
line-height: 1.7rem;
|
||||||
|
|
|
@ -10,6 +10,8 @@ const validate = require('../../lib/validate');
|
||||||
const FormikInput = require('../../components/formik-forms/formik-input.jsx');
|
const FormikInput = require('../../components/formik-forms/formik-input.jsx');
|
||||||
const JoinFlowStep = require('./join-flow-step.jsx');
|
const JoinFlowStep = require('./join-flow-step.jsx');
|
||||||
|
|
||||||
|
require('./join-flow-steps.scss');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Username step
|
* Username step
|
||||||
*/
|
*/
|
||||||
|
@ -127,6 +129,7 @@ class UsernameStep extends React.Component {
|
||||||
id="username"
|
id="username"
|
||||||
name="username"
|
name="username"
|
||||||
validate={this.validateUsernameIfPresent}
|
validate={this.validateUsernameIfPresent}
|
||||||
|
validationClassName="validation-full-width-input"
|
||||||
onBlur={() => validateField('username')} // eslint-disable-line react/jsx-no-bind
|
onBlur={() => validateField('username')} // eslint-disable-line react/jsx-no-bind
|
||||||
/>
|
/>
|
||||||
<div className="join-flow-password-section">
|
<div className="join-flow-password-section">
|
||||||
|
|
Loading…
Reference in a new issue