Commit 6e0eef5b authored by Dherik Jenitan Devakumar's avatar Dherik Jenitan Devakumar
Browse files

(#14) Attempted to detect bottom scroll with flatlist

parent 9a0ea8b2
......@@ -18,11 +18,15 @@ import { TouchableOpacity, TouchableWithoutFeedback } from 'react-native';
*/
interface IMovieObject {
item: searchMovies_getMoviesBySearch;
item: searchMovies_getMoviesBySearch;
}
interface MovieTableProps {
fetchMore: () => void;
}
const MovieTable: React.FC = () => {
const MovieTable: React.FC<MovieTableProps> = ({fetchMore}) => {
const movies = useSelector(selectMovies);
const isLoggedIn = useSelector(selectUserIsLoggedIn);
const userName = useSelector(selectUserName)
......@@ -84,6 +88,7 @@ const MovieTable: React.FC = () => {
contentContainerStyle={{
paddingBottom:20,
}}
onEndReached={fetchMore}
/>
<MovieModal isModalVisible={modalVisible} setIsModalVisible={setModalVisible} movie={modalMovie}/>
</SafeAreaView>
......
......@@ -116,7 +116,7 @@ export const MainPage: FunctionComponent = () => {
</View>
<View>
{/* <BottomScrollListener onBottom={fetchMovies} debounce={0}/> */}
<MovieTable/>
<MovieTable fetchMore={fetchMovies}/>
</View>
</View>
</MenuDrawer>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment