Another large update for all components
reorganization, linting, updating file imports, consolidation warning: there will be errors in this commit todo: update webpack, add missing styles, scss files, consolidate group page components.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import Button from '../button';
|
||||
|
||||
import './column_inline_form.scss';
|
||||
|
||||
export default class ColumnInlineForm extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
value: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onSubmit: PropTypes.func.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
btnTitle: PropTypes.string.isRequired,
|
||||
disabled: PropTypes.bool,
|
||||
};
|
||||
|
||||
handleChange = e => {
|
||||
this.props.onChange(e.target.value);
|
||||
}
|
||||
|
||||
handleSubmit = e => {
|
||||
e.preventDefault();
|
||||
this.props.onSubmit();
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
this.props.onSubmit();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { value, label, btnTitle, disabled } = this.props;
|
||||
|
||||
return (
|
||||
<form className='column-inline-form' onSubmit={this.handleSubmit}>
|
||||
<label className='column-inline-form__block'>
|
||||
<span className='column-inline-form__title'>{label}</span>
|
||||
|
||||
<input
|
||||
className='column-inline-form__input'
|
||||
value={value}
|
||||
disabled={disabled}
|
||||
onChange={this.handleChange}
|
||||
placeholder={label}
|
||||
/>
|
||||
</label>
|
||||
|
||||
<Button
|
||||
className='column-inline-form__btn'
|
||||
disabled={disabled}
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
{btnTitle}
|
||||
</Button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
.column-inline-form {
|
||||
padding: 7px 5px 7px 15px;
|
||||
background: lighten($ui-base-color, 4%);
|
||||
|
||||
@include flex(flex-start, center);
|
||||
|
||||
&__block {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
&__title {
|
||||
|
||||
}
|
||||
|
||||
&__input {
|
||||
width: 100%;
|
||||
margin-bottom: 6px;
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__btn {
|
||||
flex: 0 0 auto;
|
||||
margin: 0 5px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './column_inline_form';
|
||||
Reference in New Issue
Block a user