Commit 90be0025 authored by kavusi98's avatar kavusi98
Browse files

(#15) minor changes

parent 3b35dcb1
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import { useSelector } from "react-redux";
import { selectMovies, selectUserIsLoggedIn, selectUserName } from "../../services/selectors";
import { searchMovies_getMoviesBySearch } from "../../services/__generated__/searchMovies"
import FavButton from "../favButton";
import { Card, Title } from "react-native-paper";
import { StyleSheet, SafeAreaView, FlatList, View } from "react-native";
import { StyleSheet, SafeAreaView, FlatList, View, Text } from "react-native";
import { useFonts } from "@expo-google-fonts/inter";
import AppLoading from 'expo-app-loading';
import MovieModal from "../moviedetail/MovieModal";
import { LogBox } from 'react-native';
/**
* This is a component displaying all the movies.
* We are using MUI Card components and rendering
* them based on movies fetched form the database.
* The movies are fetched form the database.
*/
interface IMovieObject {
......@@ -52,6 +53,12 @@ const MovieTable: React.FC<MovieTableProps> = ({fetchMore}) => {
return movie.favoritedByUser.includes(userName)
}
useEffect(() => {
//Flatlist needs to be in ScrollView in our case.
LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
}, [])
function handleFavorize(newValue: boolean, id: string) {
let alreadyInFavorites = favoritedInSession.filter(favoritedInSession => favoritedInSession.id === id)
......@@ -97,6 +104,7 @@ const MovieTable: React.FC<MovieTableProps> = ({fetchMore}) => {
);
};
if (!fontsLoaded) {
return <AppLoading />
} else {
......@@ -111,8 +119,9 @@ const MovieTable: React.FC<MovieTableProps> = ({fetchMore}) => {
paddingBottom:350,
}}
onEndReached={fetchMore}
/>
>
{modalMovie ? <MovieModal isModalVisible={modalVisible} setIsModalVisible={setModalVisible} movie={modalMovie}/> : null}
</FlatList>
</SafeAreaView>
)
}
......
import React, { FunctionComponent, useState } from "react";
import { StyleSheet, ScrollView, SafeAreaView, View } from "react-native";
import React, { FunctionComponent, useEffect, useState } from "react";
import { StyleSheet, ScrollView, SafeAreaView, View, LogBox } from "react-native";
import FilterByYear from "./FilterByYear";
import FilterGenreComp from "./FilterByGenre";
......@@ -18,6 +18,7 @@ interface SideBarProps {
const SideBar: FunctionComponent<SideBarProps> = ({isSideBarVisible, closeSideBar}) => {
return (
<View style={styles.animatedBox}>
<ScrollView contentContainerStyle={styles.scrollContainer}>
......@@ -37,7 +38,7 @@ const styles = StyleSheet.create({
display:'flex',
},
scrollContainer: {
paddingBottom:50,
paddingBottom:450,
}
})
export default SideBar;
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