mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Webclient: Handle firing an event once (#4499)
* draft: handle firing an event once * lint * Prevent rapid double-click on sending messages * no rest spread on single primative when sibling components exist * clear message instead of using a fireOnce handler. * fix tests * remove unnecessary validate mock
This commit is contained in:
parent
4bb13677c8
commit
513fcb0908
16 changed files with 21467 additions and 161 deletions
|
|
@ -1,23 +1,27 @@
|
|||
// eslint-disable-next-line
|
||||
import React from "react";
|
||||
import { Field } from 'redux-form'
|
||||
import React from 'react';
|
||||
import { Field } from 'react-final-form'
|
||||
import Button from '@material-ui/core/Button';
|
||||
|
||||
import { InputField } from 'components';
|
||||
|
||||
import './InputAction.css';
|
||||
|
||||
const InputAction = ({ action, label, name }) => (
|
||||
const InputAction = ({ action, label, name, validate, disabled }) => (
|
||||
<div className="input-action">
|
||||
<div className="input-action__item">
|
||||
<Field label={label} name={name} component={InputField} />
|
||||
<Field label={label} name={name} component={InputField} validate={validate} />
|
||||
</div>
|
||||
<div className="input-action__submit">
|
||||
<Button color="primary" variant="contained" type="submit">
|
||||
<Button color="primary" variant="contained" type="submit" disabled={disabled}>
|
||||
{action}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
InputAction.defaultProps = {
|
||||
disabled: false,
|
||||
validate: () => true,
|
||||
}
|
||||
|
||||
export default InputAction;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue