Skip to content

Commit b8b82aa

Browse files
committed
chore: animate giphy chip
1 parent 6e71c69 commit b8b82aa

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,12 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
418418
<>
419419
<MessageInputLeadingView />
420420

421-
<AutoCompleteInput
422-
TextInputComponent={TextInputComponent}
423-
{...additionalTextInputProps}
424-
/>
421+
<Animated.View layout={LinearTransition.duration(200)}>
422+
<AutoCompleteInput
423+
TextInputComponent={TextInputComponent}
424+
{...additionalTextInputProps}
425+
/>
426+
</Animated.View>
425427
</>
426428
)}
427429

package/src/components/MessageInput/MessageInputLeadingView.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import React, { useEffect } from 'react';
2-
import { StyleSheet, View } from 'react-native';
2+
import { StyleSheet } from 'react-native';
3+
4+
import Animated, { ZoomIn, ZoomOut } from 'react-native-reanimated';
35

46
import { AttachmentManagerState } from 'stream-chat';
57

@@ -31,9 +33,13 @@ export const MessageInputLeadingView = () => {
3133
}, [textComposer, hasAttachments]);
3234

3335
return command && !hasAttachments ? (
34-
<View style={styles.giphyContainer}>
36+
<Animated.View
37+
entering={ZoomIn.duration(200)}
38+
exiting={ZoomOut.duration(200)}
39+
style={styles.giphyContainer}
40+
>
3541
<GiphyChip />
36-
</View>
42+
</Animated.View>
3743
) : null;
3844
};
3945

0 commit comments

Comments
 (0)