From a38bc37aaadb3ce9b60d4303040e280a2d9d833a Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 25 Nov 2022 16:32:08 -0300 Subject: [PATCH] animation fix and minor cleanup --- app/views/RoomView/List/List.tsx | 20 ++++++-------------- app/views/RoomView/List/index.tsx | 3 ++- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/app/views/RoomView/List/List.tsx b/app/views/RoomView/List/List.tsx index e0dcb7c2d..6cb13225f 100644 --- a/app/views/RoomView/List/List.tsx +++ b/app/views/RoomView/List/List.tsx @@ -1,40 +1,32 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { FlatListProps, StyleSheet } from 'react-native'; -// import { FlatList } from 'react-native-gesture-handler'; -import { FlashList } from '@shopify/flash-list'; +import { StyleSheet } from 'react-native'; +import { FlashList, FlashListProps } from '@shopify/flash-list'; import Animated from 'react-native-reanimated'; import scrollPersistTaps from '../../../lib/methods/helpers/scrollPersistTaps'; -const AnimatedFlatList = Animated.createAnimatedComponent(FlashList); +const AnimatedFlashList = Animated.createAnimatedComponent(FlashList); const styles = StyleSheet.create({ contentContainer: { - paddingTop: 10 + paddingTop: 4 } }); -// export type TListRef = React.RefObject FlatList }>; - -export type IListProps = FlatListProps; +export type IListProps = FlashListProps; // @ts-ignore const List = ({ listRef, ...props }: IListProps) => ( - item.id} // @ts-ignore contentContainerStyle={styles.contentContainer} - // style={styles.list} inverted estimatedItemSize={150} - // removeClippedSubviews={isIOS} - // initialNumToRender={7} onEndReachedThreshold={0.5} - // maxToRenderPerBatch={5} - // windowSize={10} {...props} {...scrollPersistTaps} /> diff --git a/app/views/RoomView/List/index.tsx b/app/views/RoomView/List/index.tsx index 463bf6dc5..7837e3732 100644 --- a/app/views/RoomView/List/index.tsx +++ b/app/views/RoomView/List/index.tsx @@ -147,7 +147,7 @@ class ListContainer extends React.Component { this.count += QUERY_SIZE; - const { rid, tmid, showMessageInMainThread, serverVersion } = this.props; + const { rid, tmid, showMessageInMainThread, serverVersion, listRef } = this.props; const db = database.active; // handle servers with version < 3.0.0 @@ -238,6 +238,7 @@ class ListContainer extends React.Component