Skip to content

Commit 3f7ddf0

Browse files
committed
fix: remove props from backdrop override
1 parent eea5f9a commit 3f7ddf0

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

examples/SampleApp/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
useOverlayContext,
1818
useTheme,
1919
} from 'stream-chat-react-native';
20-
import type { MessageOverlayBackgroundProps } from 'stream-chat-react-native';
2120

2221
import { getMessaging } from '@react-native-firebase/messaging';
2322
import notifee, { EventType } from '@notifee/react-native';
@@ -99,7 +98,7 @@ const Drawer = createDrawerNavigator();
9998
const Stack = createNativeStackNavigator<StackNavigatorParamList>();
10099
const UserSelectorStack = createNativeStackNavigator<UserSelectorParamList>();
101100

102-
const MessageOverlayBlurBackground = ({ style }: MessageOverlayBackgroundProps) => {
101+
const MessageOverlayBlurBackground = () => {
103102
const {
104103
theme: { semantics },
105104
} = useTheme();
@@ -116,7 +115,7 @@ const MessageOverlayBlurBackground = ({ style }: MessageOverlayBackgroundProps)
116115
downsampleFactor={isIOS ? undefined : 12}
117116
pointerEvents='none'
118117
reducedTransparencyFallbackColor='rgba(0, 0, 0, 0.8)'
119-
style={[styles.messageOverlayBlurBackground, style]}
118+
style={styles.messageOverlayBlurBackground}
120119
/>
121120
<View
122121
style={[

package/src/contexts/overlayContext/MessageOverlayHostLayer.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
Platform,
44
Pressable,
55
StyleSheet,
6-
useColorScheme,
76
useWindowDimensions,
87
View,
98
} from 'react-native';
@@ -20,7 +19,6 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
2019
import { PortalHost } from 'react-native-teleport';
2120

2221
import { ClosingPortalHostsLayer } from './ClosingPortalHostsLayer';
23-
import type { MessageOverlayBackgroundProps } from './OverlayContext';
2422

2523
import {
2624
closeOverlay,
@@ -33,13 +31,13 @@ import { useTheme } from '../themeContext/ThemeContext';
3331

3432
const DURATION = 300;
3533

36-
const DefaultMessageOverlayBackground = ({ style }: MessageOverlayBackgroundProps) => {
34+
const DefaultMessageOverlayBackground = () => {
3735
const {
3836
theme: { semantics },
3937
} = useTheme();
4038

4139
return (
42-
<View pointerEvents='none' style={[StyleSheet.absoluteFillObject, style]}>
40+
<View pointerEvents='none' style={StyleSheet.absoluteFillObject}>
4341
<View
4442
pointerEvents='none'
4543
style={[
@@ -54,7 +52,7 @@ const DefaultMessageOverlayBackground = ({ style }: MessageOverlayBackgroundProp
5452
};
5553

5654
type MessageOverlayHostLayerProps = {
57-
BackgroundComponent?: React.ComponentType<MessageOverlayBackgroundProps>;
55+
BackgroundComponent?: React.ComponentType;
5856
};
5957

6058
export const MessageOverlayHostLayer = ({ BackgroundComponent }: MessageOverlayHostLayerProps) => {
@@ -271,7 +269,7 @@ export const MessageOverlayHostLayer = ({ BackgroundComponent }: MessageOverlayH
271269
pointerEvents='none'
272270
style={[StyleSheet.absoluteFillObject, backdropStyle]}
273271
>
274-
<OverlayBackground overlayOpacity={backdrop} style={StyleSheet.absoluteFillObject} />
272+
<OverlayBackground />
275273
</Animated.View>
276274
) : null}
277275

package/src/contexts/overlayContext/OverlayContext.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useContext } from 'react';
22

3-
import { StyleProp, ViewStyle } from 'react-native';
43
import { SharedValue } from 'react-native-reanimated';
54

65
import type { Streami18n } from '../../utils/i18n/Streami18n';
@@ -12,10 +11,6 @@ import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
1211
import { isTestEnvironment } from '../utils/isTestEnvironment';
1312

1413
export type Overlay = 'alert' | 'gallery' | 'none';
15-
export type MessageOverlayBackgroundProps = {
16-
overlayOpacity: SharedValue<number>;
17-
style?: StyleProp<ViewStyle>;
18-
};
1914

2015
export type OverlayContextValue = {
2116
overlay: Overlay;
@@ -33,9 +28,8 @@ export type OverlayProviderProps = ImageGalleryProviderProps & {
3328
i18nInstance?: Streami18n;
3429
/**
3530
* Custom backdrop component rendered behind overlay content in `MessageOverlayHostLayer`.
36-
* Receives a shared opacity value that should be used for its visibility animation.
3731
*/
38-
MessageOverlayBackground?: React.ComponentType<MessageOverlayBackgroundProps>;
32+
MessageOverlayBackground?: React.ComponentType;
3933
value?: Partial<OverlayContextValue>;
4034
};
4135

0 commit comments

Comments
 (0)