mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
Add optional Input prop to render with display: inline-block;
This commit is contained in:
parent
14aab54982
commit
468ad3d081
2 changed files with 9 additions and 3 deletions
|
|
@ -14,3 +14,7 @@
|
|||
height: 50px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.inline {
|
||||
display: inline-block;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,21 +4,23 @@ import classNames from 'classnames';
|
|||
import css from './Input.css';
|
||||
|
||||
const Input = props => {
|
||||
const { className, ...rest } = props;
|
||||
const { className, inline, ...rest } = props;
|
||||
|
||||
const classes = classNames(css.root, className);
|
||||
const classes = classNames(css.root, { [css.inline]: inline }, className);
|
||||
|
||||
return <input className={classes} {...rest} />;
|
||||
};
|
||||
|
||||
const { string } = PropTypes;
|
||||
const { string, bool } = PropTypes;
|
||||
|
||||
Input.defaultProps = {
|
||||
className: null,
|
||||
inline: false,
|
||||
};
|
||||
|
||||
Input.propTypes = {
|
||||
className: string,
|
||||
inline: bool,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue