From 8cda28e9fdae92e16dc8b0d1eb60fe8d9ca2b732 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Sat, 2 Mar 2024 12:08:32 -0800 Subject: [PATCH] Fix profile-card warning rendering --- src/view/com/profile/ProfileCard.tsx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx index d522a2f9e0..66f762fabf 100644 --- a/src/view/com/profile/ProfileCard.tsx +++ b/src/view/com/profile/ProfileCard.tsx @@ -123,8 +123,8 @@ export function ProfileCardPills({ }) { const pal = usePalette('default') - const informs = moderation.ui('profileList').informs - if (!followedBy && !informs.length) { + const modui = moderation.ui('profileList') + if (!followedBy && !modui.inform && !modui.alert) { return null } @@ -137,17 +137,31 @@ export function ProfileCardPills({ )} - {informs.map(inform => ( + {modui.alerts.map(alert => ( + + ))} + {modui.informs.map(inform => ( ))} ) } -function ProfileCardPillModerationCause({cause}: {cause: ModerationCause}) { +function ProfileCardPillModerationCause({ + cause, + severity, +}: { + cause: ModerationCause + severity: 'alert' | 'inform' +}) { const pal = usePalette('default') const {name} = useModerationCauseDescription(cause, 'account') return ( @@ -155,7 +169,7 @@ function ProfileCardPillModerationCause({cause}: {cause: ModerationCause}) { style={[s.mt5, pal.btn, styles.pill]} key={getModerationCauseKey(cause)}> - {cause?.type === 'label' ? '⚠' : ''} + {severity === 'alert' ? '⚠ ' : ''} {name}