Fix RoomView's inverted list
This commit is contained in:
parent
f7f3f26ebe
commit
5711b2f08a
|
@ -1,6 +1,5 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { FlatListProps, StyleSheet } from 'react-native';
|
import { StyleSheet } from 'react-native';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
|
||||||
import Animated, { runOnJS, useAnimatedScrollHandler } from 'react-native-reanimated';
|
import Animated, { runOnJS, useAnimatedScrollHandler } from 'react-native-reanimated';
|
||||||
|
|
||||||
import { isIOS } from '../../../../lib/methods/helpers';
|
import { isIOS } from '../../../../lib/methods/helpers';
|
||||||
|
@ -8,9 +7,6 @@ import scrollPersistTaps from '../../../../lib/methods/helpers/scrollPersistTaps
|
||||||
import NavBottomFAB from './NavBottomFAB';
|
import NavBottomFAB from './NavBottomFAB';
|
||||||
import { IListProps } from '../definitions';
|
import { IListProps } from '../definitions';
|
||||||
import { SCROLL_LIMIT } from '../constants';
|
import { SCROLL_LIMIT } from '../constants';
|
||||||
import { TAnyMessageModel } from '../../../../definitions';
|
|
||||||
|
|
||||||
const AnimatedFlatList = Animated.createAnimatedComponent<FlatListProps<TAnyMessageModel>>(FlatList);
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
list: {
|
list: {
|
||||||
|
@ -36,14 +32,13 @@ export const List = ({ listRef, jumpToBottom, isThread, ...props }: IListProps)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AnimatedFlatList
|
<Animated.FlatList
|
||||||
testID='room-view-messages'
|
testID='room-view-messages'
|
||||||
// @ts-ignore createAnimatedComponent is making this fail
|
|
||||||
ref={listRef}
|
ref={listRef}
|
||||||
keyExtractor={item => item.id}
|
keyExtractor={item => item.id}
|
||||||
contentContainerStyle={styles.contentContainer}
|
contentContainerStyle={styles.contentContainer}
|
||||||
style={styles.list}
|
style={styles.list}
|
||||||
inverted={isIOS}
|
inverted
|
||||||
removeClippedSubviews={isIOS}
|
removeClippedSubviews={isIOS}
|
||||||
initialNumToRender={7}
|
initialNumToRender={7}
|
||||||
onEndReachedThreshold={0.5}
|
onEndReachedThreshold={0.5}
|
||||||
|
|
|
@ -3,6 +3,5 @@ import { ViewStyle } from 'react-native';
|
||||||
import { EDGE_DISTANCE } from '../../constants';
|
import { EDGE_DISTANCE } from '../../constants';
|
||||||
|
|
||||||
export const useNavBottomStyle = (): ViewStyle => ({
|
export const useNavBottomStyle = (): ViewStyle => ({
|
||||||
top: EDGE_DISTANCE,
|
bottom: EDGE_DISTANCE
|
||||||
scaleY: -1
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue