From 79155d4fead59addc27fa2c2cf5c72c04113ab34 Mon Sep 17 00:00:00 2001 From: apeyada Date: Tue, 26 Mar 2024 18:12:50 +0000 Subject: [PATCH] fix admin badge not crossed out when removing admin offline --- src/components/Badge.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Badge.tsx b/src/components/Badge.tsx index 635645b0035b..b23d02cd7685 100644 --- a/src/components/Badge.tsx +++ b/src/components/Badge.tsx @@ -41,6 +41,9 @@ type BadgeProps = { /** Any additional styles to pass to the left icon container. */ iconStyles?: StyleProp; + + /** Additional styles from OfflineWithFeedback applied to the row */ + style?: StyleProp; }; function Badge({ @@ -54,6 +57,7 @@ function Badge({ onPress = () => {}, icon, iconStyles = [], + style, }: BadgeProps) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); @@ -61,6 +65,8 @@ function Badge({ const textColorStyles = success || error ? styles.textWhite : undefined; const Wrapper = pressable ? PressableWithoutFeedback : View; + const isDeleted = style && Array.isArray(style) ? style.includes(styles.offlineFeedback.deleted) : false; + const wrapperStyles: (state: PressableStateCallbackType) => StyleProp = useCallback( ({pressed}) => [styles.badge, styles.ml2, StyleUtils.getBadgeColorStyle(success, error, pressed, environment === CONST.ENVIRONMENT.ADHOC), badgeStyles], [styles.badge, styles.ml2, StyleUtils, success, error, environment, badgeStyles], @@ -86,7 +92,7 @@ function Badge({ )} {text}