2021-04-12 13:32:25 +00:00
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import PropTypes from "prop-types";
|
2017-05-10 16:26:05 +00:00
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
import Form from "components/forms/Form";
|
|
|
|
|
import formFieldInterface from "interfaces/form_field";
|
|
|
|
|
import Button from "components/buttons/Button";
|
|
|
|
|
import InputFieldWithIcon from "components/forms/fields/InputFieldWithIcon";
|
|
|
|
|
import helpers from "./helpers";
|
2017-05-10 16:26:05 +00:00
|
|
|
|
2021-06-24 20:42:29 +00:00
|
|
|
const formFields = ["name", "password", "password_confirmation"];
|
2017-05-10 16:26:05 +00:00
|
|
|
const { validate } = helpers;
|
|
|
|
|
|
|
|
|
|
class ConfirmSSOInviteForm extends Component {
|
|
|
|
|
static propTypes = {
|
|
|
|
|
baseError: PropTypes.string,
|
|
|
|
|
className: PropTypes.string,
|
|
|
|
|
fields: PropTypes.shape({
|
|
|
|
|
name: formFieldInterface.isRequired,
|
|
|
|
|
password: formFieldInterface.isRequired,
|
|
|
|
|
password_confirmation: formFieldInterface.isRequired,
|
|
|
|
|
}).isRequired,
|
|
|
|
|
handleSubmit: PropTypes.func.isRequired,
|
|
|
|
|
};
|
|
|
|
|
|
2021-04-12 13:32:25 +00:00
|
|
|
render() {
|
2017-05-10 16:26:05 +00:00
|
|
|
const { baseError, className, fields, handleSubmit } = this.props;
|
|
|
|
|
|
|
|
|
|
return (
|
2021-10-27 17:31:45 +00:00
|
|
|
<form className={className} autoComplete="off">
|
2017-05-10 16:26:05 +00:00
|
|
|
{baseError && <div className="form__base-error">{baseError}</div>}
|
|
|
|
|
<div className="fields">
|
|
|
|
|
<InputFieldWithIcon
|
|
|
|
|
{...fields.name}
|
|
|
|
|
autofocus
|
2021-06-25 21:46:11 +00:00
|
|
|
placeholder="Full name"
|
2022-02-09 01:40:38 +00:00
|
|
|
inputOptions={{
|
|
|
|
|
maxLength: "80",
|
|
|
|
|
}}
|
2017-05-10 16:26:05 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2021-03-31 00:16:51 +00:00
|
|
|
<div className="confirm-invite-button-wrap">
|
|
|
|
|
<Button onClick={handleSubmit} type="Submit" variant="brand">
|
|
|
|
|
Submit
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
2017-05-10 16:26:05 +00:00
|
|
|
</form>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Form(ConfirmSSOInviteForm, {
|
|
|
|
|
fields: formFields,
|
|
|
|
|
validate,
|
|
|
|
|
});
|