docbrown/app/javascript/chat/ChatChannelSettings/InviteForm.jsx
Katie Davis 76453b41fb
Updates ESLint rules to error on default imports (#12512)
* add rule

* add named imports

* more missed files

* so many files
2021-02-02 10:24:03 -05:00

42 lines
1.2 KiB
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
import { Button } from '@crayons';
export const InviteForm = ({
handleChannelInvitations,
invitationUsernames,
handleInvitationUsernames,
}) => {
return (
<div data-testid="invite-form" className="crayons-card p-4 grid gap-2 mb-4">
<div className="crayons-field">
<label
className="crayons-field__label invitation_form_title"
htmlFor="chat_channel_membership_invitation_usernames"
>
Usernames to invite
</label>
<input
placeholder="Comma separated"
className="crayons-textfield"
type="text"
value={invitationUsernames}
name="chat_channel_membership[invitation_usernames]"
id="chat_channel_membership_invitation_usernames"
onChange={handleInvitationUsernames}
/>
</div>
<div>
<Button type="submit" onClick={handleChannelInvitations}>
Submit
</Button>
</div>
</div>
);
};
InviteForm.propTypes = {
handleInvitationUsernames: PropTypes.func.isRequired,
handleChannelInvitations: PropTypes.func.isRequired,
invitationUsernames: PropTypes.func.isRequired,
};