From aa85f227297695f09fe5030ab63796ff089bef08 Mon Sep 17 00:00:00 2001 From: Rahim Rahman Date: Tue, 5 Nov 2024 06:25:34 -0700 Subject: [PATCH] fix(MM-61209): mention badge incorrect theme color (#8312) * fix(MM-61209): mention badge incorrect theme color * removed expect-error with proper typing --- app/components/badge/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/components/badge/index.tsx b/app/components/badge/index.tsx index 84ec359cd..5bd92b491 100644 --- a/app/components/badge/index.tsx +++ b/app/components/badge/index.tsx @@ -22,7 +22,7 @@ type Props = { }; export default function Badge({ - borderColor, + borderColor: borderColorProp, color, visible = true, type = 'Normal', @@ -60,9 +60,13 @@ export default function Badge({ return null; } - // @ts-expect-error: backgroundColor definitely exists - const {backgroundColor = rest.backgroundColor || theme.mentionBg, ...restStyle} = - StyleSheet.flatten(style) || {}; + const { + backgroundColor = rest.backgroundColor || theme.mentionBg, + borderColor: styleBorderColor, + ...restStyle + } = (StyleSheet.flatten(style) || {}) as TextStyle; + + const borderColor = borderColorProp || styleBorderColor || theme.mentionBg; const textColor = color || theme.mentionColor; let lineHeight = Platform.select({android: 21, ios: 16.5}); let fontSize = 12;