Fix profile-card warning rendering
This commit is contained in:
@@ -123,8 +123,8 @@ export function ProfileCardPills({
|
|||||||
}) {
|
}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
|
|
||||||
const informs = moderation.ui('profileList').informs
|
const modui = moderation.ui('profileList')
|
||||||
if (!followedBy && !informs.length) {
|
if (!followedBy && !modui.inform && !modui.alert) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,17 +137,31 @@ export function ProfileCardPills({
|
|||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{informs.map(inform => (
|
{modui.alerts.map(alert => (
|
||||||
|
<ProfileCardPillModerationCause
|
||||||
|
key={getModerationCauseKey(alert)}
|
||||||
|
cause={alert}
|
||||||
|
severity="alert"
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
{modui.informs.map(inform => (
|
||||||
<ProfileCardPillModerationCause
|
<ProfileCardPillModerationCause
|
||||||
key={getModerationCauseKey(inform)}
|
key={getModerationCauseKey(inform)}
|
||||||
cause={inform}
|
cause={inform}
|
||||||
|
severity="inform"
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProfileCardPillModerationCause({cause}: {cause: ModerationCause}) {
|
function ProfileCardPillModerationCause({
|
||||||
|
cause,
|
||||||
|
severity,
|
||||||
|
}: {
|
||||||
|
cause: ModerationCause
|
||||||
|
severity: 'alert' | 'inform'
|
||||||
|
}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const {name} = useModerationCauseDescription(cause, 'account')
|
const {name} = useModerationCauseDescription(cause, 'account')
|
||||||
return (
|
return (
|
||||||
@@ -155,7 +169,7 @@ function ProfileCardPillModerationCause({cause}: {cause: ModerationCause}) {
|
|||||||
style={[s.mt5, pal.btn, styles.pill]}
|
style={[s.mt5, pal.btn, styles.pill]}
|
||||||
key={getModerationCauseKey(cause)}>
|
key={getModerationCauseKey(cause)}>
|
||||||
<Text type="xs" style={pal.text}>
|
<Text type="xs" style={pal.text}>
|
||||||
{cause?.type === 'label' ? '⚠' : ''}
|
{severity === 'alert' ? '⚠ ' : ''}
|
||||||
{name}
|
{name}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user