mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-17 23:35:50 -08:00
Webatrice updates (#4366)
This commit is contained in:
@@ -1,39 +1,37 @@
|
||||
// eslint-disable-next-line
|
||||
import React, { Component } from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { Form, Field, InjectedFormProps, reduxForm } from "redux-form"
|
||||
import { Form, Field, reduxForm } from "redux-form"
|
||||
|
||||
import Button from "@material-ui/core/Button";
|
||||
import { InputField } from "../../components";
|
||||
|
||||
import { InputField } from "components";
|
||||
import { FormKey } from 'types';
|
||||
|
||||
import "./ConnectForm.css";
|
||||
|
||||
class ConnectForm extends Component<InjectedFormProps> {
|
||||
render() {
|
||||
return (
|
||||
<Form className="connectForm" onSubmit={this.props.handleSubmit}>
|
||||
<div className="connectForm-item">
|
||||
<Field label="Host" name="host" component={InputField} />
|
||||
</div>
|
||||
<div className="connectForm-item">
|
||||
<Field label="Port" name="port" component={InputField} />
|
||||
</div>
|
||||
<div className="connectForm-item">
|
||||
<Field label="User" name="user" component={InputField} autoComplete="username" />
|
||||
</div>
|
||||
<div className="connectForm-item">
|
||||
<Field label="Pass" name="pass" type="password" component={InputField} autoComplete="current-password" />
|
||||
</div>
|
||||
<Button className="connectForm-submit" color="primary" variant="contained" type="submit">
|
||||
Connect
|
||||
</Button>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
const ConnectForm = ({ handleSubmit }) => (
|
||||
<Form className="connectForm" onSubmit={handleSubmit}>
|
||||
<div className="connectForm-item">
|
||||
<Field label="Host" name="host" component={InputField} />
|
||||
</div>
|
||||
<div className="connectForm-item">
|
||||
<Field label="Port" name="port" component={InputField} />
|
||||
</div>
|
||||
<div className="connectForm-item">
|
||||
<Field label="User" name="user" component={InputField} autoComplete="username" />
|
||||
</div>
|
||||
<div className="connectForm-item">
|
||||
<Field label="Pass" name="pass" type="password" component={InputField} autoComplete="current-password" />
|
||||
</div>
|
||||
<Button className="connectForm-submit" color="primary" variant="contained" type="submit">
|
||||
Connect
|
||||
</Button>
|
||||
</Form>
|
||||
);
|
||||
|
||||
const propsMap = {
|
||||
form: "connect"
|
||||
form: FormKey.CONNECT
|
||||
};
|
||||
|
||||
const mapStateToProps = () => ({
|
||||
|
||||
Reference in New Issue
Block a user