aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-09 16:27:54 -0400
committerIvan Chen <ivan@tagg.id>2021-04-09 16:27:54 -0400
commitdb51757cb968564dbc1554e0f10880eb009db7bc (patch)
tree9c247b84bf6ffee90de6ebf5bac6075640b16263
parentc8d5992ca659a1984194718703dd1b036e1fb59e (diff)
tweaked animation
-rw-r--r--src/screens/chat/ChatResultsCell.tsx4
-rw-r--r--src/screens/chat/ChatResultsList.tsx16
2 files changed, 9 insertions, 11 deletions
diff --git a/src/screens/chat/ChatResultsCell.tsx b/src/screens/chat/ChatResultsCell.tsx
index 3678a2d7..d947c122 100644
--- a/src/screens/chat/ChatResultsCell.tsx
+++ b/src/screens/chat/ChatResultsCell.tsx
@@ -42,12 +42,12 @@ const ChatResultsCell: React.FC<ChatResults> = ({
const navigation = useNavigation();
const createChannelIfNotPresentAndNavigate = async () => {
try {
+ setChatModalVisible(false);
const channel = await createChannel(loggedInUser.userId, id, chatClient);
setChannel(channel);
setTimeout(() => {
- setChatModalVisible(false);
navigation.navigate('Chat');
- }, 500);
+ }, 100);
} catch (error) {
Alert.alert(ERROR_FAILED_TO_CREATE_CHANNEL);
}
diff --git a/src/screens/chat/ChatResultsList.tsx b/src/screens/chat/ChatResultsList.tsx
index 0c6d58e4..b9970772 100644
--- a/src/screens/chat/ChatResultsList.tsx
+++ b/src/screens/chat/ChatResultsList.tsx
@@ -54,15 +54,13 @@ const ChatResultsList: React.FC<ChatResultsProps> = ({
contentContainerStyle={[{paddingBottom: tabbarHeight}]}
sections={results}
keyExtractor={(item, index) => item.id + index}
- renderItem={({item}) => {
- return (
- <ChatResultsCell
- profileData={item}
- setChatModalVisible={setChatModalVisible}
- loggedInUser={loggedInUser}
- />
- );
- }}
+ renderItem={({item}) => (
+ <ChatResultsCell
+ profileData={item}
+ setChatModalVisible={setChatModalVisible}
+ loggedInUser={loggedInUser}
+ />
+ )}
stickySectionHeadersEnabled={false}
ListEmptyComponent={() => (
<View style={styles.empty}>