From 42a6b80399c680c561a101a939c4a7793bfe966c Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 7 Mar 2024 17:47:09 -0800 Subject: [PATCH] Add adult-content-enabled behavior to label config --- .../moderation/ModerationLabelPref.tsx | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/moderation/ModerationLabelPref.tsx b/src/components/moderation/ModerationLabelPref.tsx index 1bccaa8b68..61da9d6c54 100644 --- a/src/components/moderation/ModerationLabelPref.tsx +++ b/src/components/moderation/ModerationLabelPref.tsx @@ -20,6 +20,7 @@ import {Text} from '#/components/Typography' import * as Dialog from '#/components/Dialog' import {Button, ButtonText, ButtonIcon} from '#/components/Button' import {ArrowTriangleBottom_Stroke2_Corner1_Rounded as ArrowTriangleBottom} from '../icons/ArrowTriangle' +import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfo} from '../icons/CircleInfo' import {Check_Stroke2_Corner0_Rounded as Check} from '../icons/Check' export function ModerationLabelPref({ @@ -68,6 +69,9 @@ export function ModerationLabelPref({ labelValueDefinition.blurs === 'none' && labelValueDefinition.severity === 'none' ) + const adultOnly = labelValueDefinition.flags.includes('adult') + const cantConfigure = + adultOnly && !preferences?.moderationPrefs.adultContentEnabled const onSelectPref = (newPref: LabelPreference) => mutate({label: identifier, visibility: newPref, labelerDid}) @@ -110,10 +114,12 @@ export function ModerationLabelPref({ {settingDesc} )} - + {!cantConfigure && ( + + )} )} @@ -130,7 +136,17 @@ export function ModerationLabelPref({ {labelStrings.description} - {disabled ? ( + {cantConfigure && ( + + + + + Adult content must be enabled to configure this label. + + + + )} + {disabled || cantConfigure ? (