diff --git a/app/views/RoomView/List/List.js b/app/views/RoomView/List/List.tsx similarity index 82% rename from app/views/RoomView/List/List.js rename to app/views/RoomView/List/List.tsx index 407dcbf10..c00703384 100644 --- a/app/views/RoomView/List/List.js +++ b/app/views/RoomView/List/List.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { FlatList, StyleSheet } from 'react-native'; import Animated from 'react-native-reanimated'; -import PropTypes from 'prop-types'; import { isIOS } from '../../../utils/deviceInfo'; import scrollPersistTaps from '../../../utils/scrollPersistTaps'; @@ -17,11 +16,16 @@ const styles = StyleSheet.create({ } }); -const List = ({ listRef, ...props }) => ( +interface IRoomListProps { + listRef: any; +} + +const List = ({ listRef, ...props }: IRoomListProps) => ( + // @ts-ignore item.id} + keyExtractor={(item: any) => item.id} contentContainerStyle={styles.contentContainer} style={styles.list} inverted @@ -35,8 +39,4 @@ const List = ({ listRef, ...props }) => ( /> ); -List.propTypes = { - listRef: PropTypes.object -}; - export default List; diff --git a/app/views/RoomView/List/NavBottomFAB.js b/app/views/RoomView/List/NavBottomFAB.tsx similarity index 84% rename from app/views/RoomView/List/NavBottomFAB.js rename to app/views/RoomView/List/NavBottomFAB.tsx index e3456c122..c7392543b 100644 --- a/app/views/RoomView/List/NavBottomFAB.js +++ b/app/views/RoomView/List/NavBottomFAB.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useState } from 'react'; import { StyleSheet, View } from 'react-native'; -import PropTypes from 'prop-types'; import Animated, { call, cond, greaterOrEq, useCode } from 'react-native-reanimated'; import { themes } from '../../../constants/colors'; @@ -30,11 +29,17 @@ const styles = StyleSheet.create({ } }); -const NavBottomFAB = ({ y, onPress, isThread }) => { +interface IRoomNavBottomFAB { + y: number; + onPress: Function; + isThread: boolean; +} + +const NavBottomFAB = ({ y, onPress, isThread }: IRoomNavBottomFAB) => { const { theme } = useTheme(); const [show, setShow] = useState(false); - const handleOnPress = useCallback(() => onPress()); - const toggle = v => setShow(v); + const handleOnPress = useCallback(() => onPress(), []); // TODO - check this + const toggle = (v: boolean) => setShow(v); useCode( () => @@ -65,10 +70,4 @@ const NavBottomFAB = ({ y, onPress, isThread }) => { ); }; -NavBottomFAB.propTypes = { - y: Animated.Value, - onPress: PropTypes.func, - isThread: PropTypes.bool -}; - export default NavBottomFAB;