mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -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,19 +1,16 @@
|
|||
// eslint-disable-next-line
|
||||
import React from "react";
|
||||
import { connect } from 'react-redux';
|
||||
import { Form, reduxForm } from 'redux-form'
|
||||
import React from 'react';
|
||||
import { Form } from 'react-final-form'
|
||||
|
||||
import { InputAction } from 'components';
|
||||
import { FormKey } from 'types';
|
||||
|
||||
const AddToBuddies = ({ handleSubmit }) => (
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<InputAction action="Add" label="Add to Buddies" name="userName" />
|
||||
const AddToBuddies = ({ onSubmit }) => (
|
||||
<Form onSubmit={values => onSubmit(values)}>
|
||||
{({ handleSubmit }) => (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<InputAction action="Add" label="Add to Buddies" name="userName" />
|
||||
</form>
|
||||
)}
|
||||
</Form>
|
||||
);
|
||||
|
||||
const propsMap = {
|
||||
form: FormKey.ADD_TO_BUDDIES
|
||||
};
|
||||
|
||||
export default connect()(reduxForm(propsMap)(AddToBuddies));
|
||||
export default AddToBuddies;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
// eslint-disable-next-line
|
||||
import React from "react";
|
||||
import { connect } from 'react-redux';
|
||||
import { Form, reduxForm } from 'redux-form'
|
||||
import React from 'react';
|
||||
import { Form } from 'react-final-form'
|
||||
|
||||
import { InputAction } from 'components';
|
||||
import { FormKey } from 'types';
|
||||
|
||||
const AddToIgnore = ({ handleSubmit }) => (
|
||||
<Form onSubmit={handleSubmit}>
|
||||
<InputAction action="Add" label="Add to Ignore" name="userName" />
|
||||
const AddToIgnore = ({ onSubmit }) => (
|
||||
<Form onSubmit={values => onSubmit(values)}>
|
||||
{({ handleSubmit }) => (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<InputAction action="Add" label="Add to Ignore" name="userName" />
|
||||
</form>
|
||||
)}
|
||||
</Form>
|
||||
);
|
||||
|
||||
const propsMap = {
|
||||
form: FormKey.ADD_TO_IGNORE,
|
||||
};
|
||||
|
||||
export default connect()(reduxForm(propsMap)(AddToIgnore));
|
||||
export default AddToIgnore;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue