import { IconHelper } from '@roleypoly/design-system/atoms/icon-helper'; import { Space } from '@roleypoly/design-system/atoms/space'; import { Toggle } from '@roleypoly/design-system/atoms/toggle'; import { AmbientLarge, LargeText, Link, Text, } from '@roleypoly/design-system/atoms/typography'; import { EditableRoleList } from '@roleypoly/design-system/molecules/editable-role-list'; import { EditorUtilityProps, EditorUtilityShell, } from '@roleypoly/design-system/molecules/editor-utility-shell'; import { GuildAccessControl, PresentableGuild } from '@roleypoly/types'; import deepEqual from 'deep-equal'; import * as React from 'react'; import { GoAlert, GoInfo, GoShield, GoThumbsdown, GoThumbsup } from 'react-icons/go'; import { RoleContainer } from './EditorAccessControl.styled'; export type EditorAccessControlProps = { guild: PresentableGuild; } & EditorUtilityProps; export const EditorAccessControl = (props: EditorAccessControlProps) => { const [accessControl, setAccessControl] = React.useState( props.guild.data.accessControl ); React.useEffect(() => { setAccessControl(props.guild.data.accessControl); }, [props.guild.data.accessControl]); const onSubmit = () => { props.onSubmit(accessControl); }; const handleChange = (key: keyof GuildAccessControl) => (value: GuildAccessControl[keyof GuildAccessControl]) => { setAccessControl((prev) => ({ ...prev, [key]: value })); }; const hasChanges = React.useMemo(() => { return !deepEqual(accessControl, props.guild.data.accessControl); }, [accessControl, props.guild.data.accessControl]); const rolesNotInBlocked = React.useMemo(() => { return props.guild.roles.filter( (role) => role.id !== props.guild.id && !accessControl.blockList.includes(role.id) ); }, [accessControl, props.guild.roles]); const rolesNotInAllowed = React.useMemo(() => { return props.guild.roles.filter( (role) => role.id !== props.guild.id && !accessControl.allowList.includes(role.id) ); }, [accessControl, props.guild.roles]); return ( } hasChanges={hasChanges} onSubmit={onSubmit} onExit={props.onExit} >

 Admins and Role Managers are exempt from all of these limits. Please note, this settings page is in order of precedence.

Block pending members from using Roleypoly  

{/* */} If a user is behind Discord's{' '} Membership Screening {' '} feature, they can not use Roleypoly. {/* */}

  This only applies to Discord servers with Community features enabled.

Block roles from using Roleypoly  
If there are roles in this list, any server member with a role in the list can not use Roleypoly.
 Blocked roles take precedence over the allowed roles.

  If your Discord server has a "muted" or "visitor" role, this setting is meant to complement it.

Allow these roles to use Roleypoly  
If there are roles in this list, any server member without a role in the list can not use Roleypoly.
 This can disrupt use of the bot, so be careful!

 If your Discord server uses a "role gating" system, this setting is meant to complement it.

); };