docbrown/app/javascript/chat/ChatChannelSettings/ModSection.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

49 lines
1.5 KiB
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
import { InviteForm } from './InviteForm';
import { SettingsForm } from './SettingsForm';
export const ModSection = ({
handleChannelInvitations,
invitationUsernames,
handleInvitationUsernames,
channelDescription,
handleDescriptionChange,
channelDiscoverable,
handleChannelDiscoverableStatus,
handleChannelDescriptionChanges,
currentMembershipRole,
}) => {
if (currentMembershipRole === 'member') {
return null;
}
return (
<div className="mod-section">
<InviteForm
handleInvitationUsernames={handleInvitationUsernames}
invitationUsernames={invitationUsernames}
handleChannelInvitations={handleChannelInvitations}
/>
<SettingsForm
channelDescription={channelDescription}
handleDescriptionChange={handleDescriptionChange}
channelDiscoverable={channelDiscoverable}
handleChannelDiscoverableStatus={handleChannelDiscoverableStatus}
handleChannelDescriptionChanges={handleChannelDescriptionChanges}
/>
</div>
);
};
ModSection.propTypes = {
handleInvitationUsernames: PropTypes.func.isRequired,
handleChannelInvitations: PropTypes.func.isRequired,
invitationUsernames: PropTypes.func.isRequired,
channelDescription: PropTypes.string.isRequired,
handleDescriptionChange: PropTypes.func.isRequired,
handleChannelDiscoverableStatus: PropTypes.func.isRequired,
handleChannelDescriptionChanges: PropTypes.func.isRequired,
channelDiscoverable: PropTypes.bool.isRequired,
};