mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-12-03 12:27:30 -05:00
formik input can be made to appear inline
This commit is contained in:
parent
bd83a282c5
commit
40c90e2d2e
2 changed files with 18 additions and 1 deletions
|
@ -5,12 +5,14 @@ import {Field} from 'formik';
|
|||
|
||||
const ValidationMessage = require('../forms/validation-message.jsx');
|
||||
|
||||
require('./forms.scss');
|
||||
require('../forms/input.scss');
|
||||
require('../forms/row.scss');
|
||||
|
||||
const FormikInput = ({
|
||||
className,
|
||||
error,
|
||||
inline,
|
||||
validationClassName,
|
||||
wrapperClassName,
|
||||
...props
|
||||
|
@ -43,9 +45,14 @@ const FormikInput = ({
|
|||
FormikInput.propTypes = {
|
||||
className: PropTypes.string,
|
||||
error: PropTypes.string,
|
||||
inline: PropTypes.bool,
|
||||
type: PropTypes.string,
|
||||
validationClassName: PropTypes.string
|
||||
validationClassName: PropTypes.string,
|
||||
wrapperClassName: PropTypes.string
|
||||
};
|
||||
|
||||
FormikInput.defaultProps = {
|
||||
inline: false
|
||||
};
|
||||
|
||||
module.exports = FormikInput;
|
||||
|
|
|
@ -30,3 +30,13 @@
|
|||
margin-bottom: .75rem;
|
||||
line-height: 1.7rem;
|
||||
}
|
||||
|
||||
.row-inline {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* override margin-bottom so placing a label next to a radio button does not
|
||||
mess up vertical alignment */
|
||||
.row-inline label {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue