chore: set new features behind feature flags

This commit is contained in:
41666 2021-07-27 20:34:49 -04:00
parent c1e0e65823
commit 3074db0a21

View file

@ -4,7 +4,8 @@ import {
MainSide,
Title,
} from '@roleypoly/design-system/molecules/server-utilities/ServerUtilities.styled';
import { GuildData } from '@roleypoly/types';
import { hasFeature } from '@roleypoly/misc-utils/hasFeature';
import { Features, GuildData } from '@roleypoly/types';
import { GoArchive, GoChevronRight, GoReport, GoShield, GoSync } from 'react-icons/go';
type Props = {
@ -29,27 +30,30 @@ const Utility = (props: {
export const ServerUtilities = (props: Props) => (
<div>
{/* <LargeText>Server Utilities</LargeText> */}
<Utility
title={
<>
<GoShield />
&nbsp;&nbsp;Access Control
</>
}
description="Set up who can use Roleypoly in your server"
link={`/s/${props.guildData.id}/edit/access-control`}
/>
<Utility
title={
<>
<GoReport />
&nbsp;&nbsp;Audit Logging
</>
}
description="Setup audit logging via a Discord webhook"
link={`/s/${props.guildData.id}/edit/audit-logging`}
/>
{hasFeature(props.guildData.features, Features.AccessControl) && (
<Utility
title={
<>
<GoShield />
&nbsp;&nbsp;Access Control
</>
}
description="Set up who can use Roleypoly in your server"
link={`/s/${props.guildData.id}/edit/access-control`}
/>
)}
{hasFeature(props.guildData.features, Features.AuditLogging) && (
<Utility
title={
<>
<GoReport />
&nbsp;&nbsp;Audit Logging
</>
}
description="Setup audit logging via a Discord webhook"
link={`/s/${props.guildData.id}/edit/audit-logging`}
/>
)}
<Utility
title={
<>