From 3074db0a21046c17e9ba300a49abbdf0d2c3e07c Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Tue, 27 Jul 2021 20:34:49 -0400 Subject: [PATCH] chore: set new features behind feature flags --- .../server-utilities/ServerUtilities.tsx | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/packages/design-system/molecules/server-utilities/ServerUtilities.tsx b/packages/design-system/molecules/server-utilities/ServerUtilities.tsx index a67098e..78264d4 100644 --- a/packages/design-system/molecules/server-utilities/ServerUtilities.tsx +++ b/packages/design-system/molecules/server-utilities/ServerUtilities.tsx @@ -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) => (
- {/* Server Utilities */} - - -   Access Control - - } - description="Set up who can use Roleypoly in your server" - link={`/s/${props.guildData.id}/edit/access-control`} - /> - - -   Audit Logging - - } - description="Setup audit logging via a Discord webhook" - link={`/s/${props.guildData.id}/edit/audit-logging`} - /> + {hasFeature(props.guildData.features, Features.AccessControl) && ( + + +   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) && ( + + +   Audit Logging + + } + description="Setup audit logging via a Discord webhook" + link={`/s/${props.guildData.id}/edit/audit-logging`} + /> + )}