diff options
Diffstat (limited to 'src/components/moderation/ContentHider.tsx')
-rw-r--r-- | src/components/moderation/ContentHider.tsx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/components/moderation/ContentHider.tsx b/src/components/moderation/ContentHider.tsx index 9e94a413c..549a1b9f0 100644 --- a/src/components/moderation/ContentHider.tsx +++ b/src/components/moderation/ContentHider.tsx @@ -23,20 +23,23 @@ export function ContentHider({ modui, ignoreMute, style, + activeStyle, childContainerStyle, children, -}: React.PropsWithChildren<{ +}: { testID?: string modui: ModerationUI | undefined ignoreMute?: boolean style?: StyleProp<ViewStyle> + activeStyle?: StyleProp<ViewStyle> childContainerStyle?: StyleProp<ViewStyle> -}>) { + children?: React.ReactNode | ((props: {active: boolean}) => React.ReactNode) +}) { const blur = modui?.blurs[0] if (!blur || (ignoreMute && isJustAMute(modui))) { return ( <View testID={testID} style={style}> - {children} + {typeof children === 'function' ? children({active: false}) : children} </View> ) } @@ -44,9 +47,9 @@ export function ContentHider({ <ContentHiderActive testID={testID} modui={modui} - style={style} + style={[style, activeStyle]} childContainerStyle={childContainerStyle}> - {children} + {typeof children === 'function' ? children({active: true}) : children} </ContentHiderActive> ) } |