Commit bb106cdd authored by Dherik Jenitan Devakumar's avatar Dherik Jenitan Devakumar
Browse files

(#15) Removed unused imports

parent 882bd88b
import * as React from 'react'; import * as React from 'react';
import { Modal, StyleSheet, View } from 'react-native'; import { Modal, StyleSheet, View } from 'react-native';
import { Portal, Text, Button, Provider, Title, TextInput, IconButton } from 'react-native-paper'; import { Button, Title, TextInput, IconButton } from 'react-native-paper';
import { useAppDispatch } from '../../services/hooks'; import { useAppDispatch } from '../../services/hooks';
import { loginAsUser, logOut } from './loginslice'; import { loginAsUser, logOut } from './loginslice';
import { useState } from 'react'; import { useState } from 'react';
......
import React, { useState } from "react"; import React, { useState } from "react";
import { selectUserName, selectUserIsLoggedIn } from "../../services/selectors" import { selectUserName } from "../../services/selectors"
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { import {
formatDateAsString, formatDateAsString,
...@@ -33,6 +33,9 @@ const MovieModal: React.FC<ModalProps> = ({movie, setIsModalVisible, isModalVisi ...@@ -33,6 +33,9 @@ const MovieModal: React.FC<ModalProps> = ({movie, setIsModalVisible, isModalVisi
}) })
function getReducedArray(array: Array<string>): Array<string> { function getReducedArray(array: Array<string>): Array<string> {
if (userName === undefined) {
return []
}
const temp = [...array] const temp = [...array]
const index = temp.indexOf(userName, 0); const index = temp.indexOf(userName, 0);
if (index > -1) { if (index > -1) {
......
...@@ -8,8 +8,6 @@ import { StyleSheet, SafeAreaView, FlatList, View } from "react-native"; ...@@ -8,8 +8,6 @@ import { StyleSheet, SafeAreaView, FlatList, View } from "react-native";
import { useFonts } from "@expo-google-fonts/inter"; import { useFonts } from "@expo-google-fonts/inter";
import AppLoading from 'expo-app-loading'; import AppLoading from 'expo-app-loading';
import MovieModal from "../moviedetail/MovieModal"; import MovieModal from "../moviedetail/MovieModal";
import { TouchableOpacity, TouchableWithoutFeedback } from 'react-native';
/** /**
* This is a component displaying all the movies. * This is a component displaying all the movies.
......
...@@ -5,12 +5,9 @@ import { Dispatch } from "redux"; ...@@ -5,12 +5,9 @@ import { Dispatch } from "redux";
import { setSearchQuery } from "../../pages/mainPageSlice"; import { setSearchQuery } from "../../pages/mainPageSlice";
import { logOut } from "../login/loginslice" import { logOut } from "../login/loginslice"
import { selectUserIsLoggedIn } from "../../services/selectors"; import { selectUserIsLoggedIn } from "../../services/selectors";
import { useState } from "react";
import { Appbar } from "react-native-paper"; import { Appbar } from "react-native-paper";
import { StyleSheet } from "react-native"; import { useFonts} from '@expo-google-fonts/quicksand';
import { useFonts, Quicksand_600SemiBold} from '@expo-google-fonts/quicksand';
import AppLoading from "expo-app-loading"; import AppLoading from "expo-app-loading";
import LoginModal from "../login/login";
const actionDispatch = (dispatch: Dispatch) => ({ const actionDispatch = (dispatch: Dispatch) => ({
setSearch: (query: string) => dispatch(setSearchQuery(query)), setSearch: (query: string) => dispatch(setSearchQuery(query)),
......
...@@ -2,8 +2,8 @@ import React,{ FunctionComponent, useState } from "react"; ...@@ -2,8 +2,8 @@ import React,{ FunctionComponent, useState } from "react";
import { useAppDispatch } from "../../services/hooks"; import { useAppDispatch } from "../../services/hooks";
import { Dispatch } from "redux"; import { Dispatch } from "redux";
import { setFilterGenres } from "../../pages/mainPageSlice"; import { setFilterGenres } from "../../pages/mainPageSlice";
import { FlatList, StyleSheet, Text, View } from "react-native"; import { FlatList, StyleSheet, View } from "react-native";
import { Title, Button } from "react-native-paper"; import { Title } from "react-native-paper";
import { useFonts } from "@expo-google-fonts/quicksand"; import { useFonts } from "@expo-google-fonts/quicksand";
import AppLoading from "expo-app-loading"; import AppLoading from "expo-app-loading";
import { CheckBox } from 'react-native-elements' import { CheckBox } from 'react-native-elements'
......
import React, { useState } from "react"; import React, { useState } from "react";
import { useAppDispatch } from "../../services/hooks"; import { useAppDispatch } from "../../services/hooks";
import { Dispatch } from "redux"; import { Dispatch } from "redux";
import { useSelector } from "react-redux";
import { setSearchQuery } from "../../pages/mainPageSlice"; import { setSearchQuery } from "../../pages/mainPageSlice";
import { FunctionComponent } from "react"; import { FunctionComponent } from "react";
import { View, StyleSheet } from "react-native"; import { View } from "react-native";
import { Button, Searchbar, Title } from "react-native-paper"; import { Button, Searchbar, Title } from "react-native-paper";
import { useFonts } from "@expo-google-fonts/quicksand"; import { useFonts } from "@expo-google-fonts/quicksand";
import AppLoading from "expo-app-loading"; import AppLoading from "expo-app-loading";
import FilterByGenre from "./FilterByGenre";
const actionDispatch = (dispatch: Dispatch) => ({ const actionDispatch = (dispatch: Dispatch) => ({
setSearch: (query: string) => dispatch(setSearchQuery(query)), setSearch: (query: string) => dispatch(setSearchQuery(query)),
......
import React, { FunctionComponent, useState } from "react"; import React, { FunctionComponent, useState } from "react";
import { TouchableOpacity, Text, StyleSheet, ScrollView, SafeAreaView, View } from "react-native"; import { StyleSheet, ScrollView, SafeAreaView, View } from "react-native";
import FilterByYear from "./FilterByYear"; import FilterByYear from "./FilterByYear";
import FilterGenreComp from "./FilterByGenre"; import FilterGenreComp from "./FilterByGenre";
......
...@@ -15,11 +15,10 @@ import { Dispatch } from "redux"; ...@@ -15,11 +15,10 @@ import { Dispatch } from "redux";
import { setMovies } from "./mainPageSlice"; import { setMovies } from "./mainPageSlice";
import { searchMovies } from "../services/__generated__/searchMovies"; import { searchMovies } from "../services/__generated__/searchMovies";
import { useAppDispatch } from "../services/hooks"; import { useAppDispatch } from "../services/hooks";
import { BottomScrollListener } from "react-bottom-scroll-listener";
import SortDropDown from "../components/sortdropdown"; import SortDropDown from "../components/sortdropdown";
import MovieTable from "../components/moviesview"; import MovieTable from "../components/moviesview";
import UserDisplay from "../components/userDisplay"; import UserDisplay from "../components/userDisplay";
import { Dimensions, ScrollView, StyleSheet, useWindowDimensions, View } from "react-native"; import { StyleSheet, useWindowDimensions, View } from "react-native";
import styles from "./styles"; import styles from "./styles";
import LoginModal from "../components/login/login"; import LoginModal from "../components/login/login";
import MenuDrawer from "react-native-side-drawer"; import MenuDrawer from "react-native-side-drawer";
...@@ -115,7 +114,6 @@ export const MainPage: FunctionComponent = () => { ...@@ -115,7 +114,6 @@ export const MainPage: FunctionComponent = () => {
<SortDropDown /> <SortDropDown />
</View> </View>
<View> <View>
{/* <BottomScrollListener onBottom={fetchMovies} debounce={0}/> */}
<MovieTable fetchMore={fetchMovies}/> <MovieTable fetchMore={fetchMovies}/>
</View> </View>
</View> </View>
......
import { apolloClient } from "../graphql"; import { apolloClient } from "../graphql";
import { searchMovies } from "./__generated__/searchMovies"; import { searchMovies } from "./__generated__/searchMovies";
import { removeMovieAsFavorite } from "./__generated__/removeMovieAsFavorite";
import { setMovieAsFavorite } from "./__generated__/setMovieAsFavorite";
import { GET_MOVIES_BY_SEARCH } from "./movieQueries"; import { GET_MOVIES_BY_SEARCH } from "./movieQueries";
import { SET_FAVORITE_MOVIE } from "./movieQueries"; import { SET_FAVORITE_MOVIE } from "./movieQueries";
import { REMOVE_MOVIE_AS_FAVORITE } from "./movieQueries"; import { REMOVE_MOVIE_AS_FAVORITE } from "./movieQueries";
......
/*NOT USING*/
// export enum SortBy {
// AlphabeticalAsc = "title",
// AlphabeticalDesc = "-title",
// YearAsc = "release_date",
// YearDesc = "-release_date",
// Clear = "",
// }
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