Skip to content

Commit 9493a7b

Browse files
committed
fix: reanimated warnings and expo layout
1 parent f28a769 commit 9493a7b

File tree

2 files changed

+11
-21
lines changed
  • examples/ExpoMessaging/app/channel/[cid]
  • package/src/components/MessageInput/components/InputButtons

2 files changed

+11
-21
lines changed

examples/ExpoMessaging/app/channel/[cid]/index.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ import {
44
Channel,
55
MessageInput,
66
useChatContext,
7-
MessageFlashList,
87
ThreadContextValue,
8+
MessageList,
99
} from 'stream-chat-expo';
1010
import { Stack, useLocalSearchParams, useRouter } from 'expo-router';
1111
import { AuthProgressLoader } from '../../../components/AuthProgressLoader';
1212
import { AppContext } from '../../../context/AppContext';
1313
import { useHeaderHeight } from '@react-navigation/elements';
1414
import InputButtons from '../../../components/InputButtons';
1515
import { MessageLocation } from '../../../components/LocationSharing/MessageLocation';
16-
import { SafeAreaView } from 'react-native-safe-area-context';
17-
import { StyleSheet } from 'react-native';
16+
import { Platform, StyleSheet, View } from 'react-native';
1817

1918
export default function ChannelScreen() {
2019
const { client } = useChatContext();
@@ -67,26 +66,27 @@ export default function ChannelScreen() {
6766
}
6867

6968
return (
70-
<SafeAreaView edges={['bottom']} style={styles.container}>
69+
<View style={styles.container}>
70+
<Stack.Screen
71+
options={{ title: 'Channel Screen', contentStyle: { backgroundColor: 'white' } }}
72+
/>
7173
<Channel
7274
audioRecordingEnabled={true}
7375
channel={channel}
7476
onPressMessage={onPressMessage}
75-
keyboardVerticalOffset={headerHeight}
77+
keyboardVerticalOffset={Platform.OS === 'ios' ? headerHeight : undefined}
7678
MessageLocation={MessageLocation}
7779
thread={thread}
7880
>
79-
<Stack.Screen options={{ title: 'Channel Screen' }} />
80-
81-
<MessageFlashList
81+
<MessageList
8282
onThreadSelect={(thread: ThreadContextValue['thread']) => {
8383
setThread(thread);
8484
router.push(`/channel/${channel.cid}/thread/${thread?.cid ?? ''}`);
8585
}}
8686
/>
8787
<MessageInput InputButtons={InputButtons} />
8888
</Channel>
89-
</SafeAreaView>
89+
</View>
9090
);
9191
}
9292

package/src/components/MessageInput/components/InputButtons/index.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import React, { useEffect } from 'react';
22
import { StyleSheet } from 'react-native';
33

4-
import Animated, {
5-
useAnimatedStyle,
6-
useSharedValue,
7-
withTiming,
8-
ZoomIn,
9-
ZoomOut,
10-
} from 'react-native-reanimated';
4+
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
115

126
import { OwnCapabilitiesContextValue } from '../../../../contexts';
137
import {
@@ -60,11 +54,7 @@ export const InputButtonsWithContext = (props: InputButtonsWithContextProps) =>
6054
}
6155

6256
return hasAttachmentUploadCapabilities ? (
63-
<Animated.View
64-
entering={ZoomIn.duration(200)}
65-
exiting={ZoomOut.duration(200)}
66-
style={[styles.attachButtonContainer, attachButtonContainer, animatedStyle]}
67-
>
57+
<Animated.View style={[styles.attachButtonContainer, attachButtonContainer, animatedStyle]}>
6858
<AttachButton />
6959
</Animated.View>
7060
) : null;

0 commit comments

Comments
 (0)