diff --git a/Back/moviesProject/.vs/slnx.sqlite b/Back/moviesProject/.vs/slnx.sqlite index 29b16b9b..cdece64f 100644 Binary files a/Back/moviesProject/.vs/slnx.sqlite and b/Back/moviesProject/.vs/slnx.sqlite differ diff --git a/frontend/src/components/StickyFooter.js b/frontend/src/components/StickyFooter.js index d2ba97ab..cff5cd02 100644 --- a/frontend/src/components/StickyFooter.js +++ b/frontend/src/components/StickyFooter.js @@ -1,17 +1,18 @@ import React from 'react'; -import CssBaseline from '@material-ui/core/CssBaseline'; import Typography from '@material-ui/core/Typography'; import { makeStyles } from '@material-ui/core/styles'; import Container from '@material-ui/core/Container'; import Link from '@material-ui/core/Link'; function Copyright() { + const classes = useStyles(); + return ( - + {'Copyright © '} - Imdb-Clone - {''} + IeeMDB + {' '} {new Date().getFullYear()} {'.'} @@ -29,11 +30,14 @@ const useStyles = makeStyles((theme) => ({ marginBottom: theme.spacing(2), }, footer: { - padding: theme.spacing(3, 2), + padding: theme.spacing(1, 2), marginTop: 'auto', backgroundColor: '#2b2b2a', - }, + text: { + color: '#fff' + + } })); export default function StickyFooter() { @@ -42,8 +46,7 @@ export default function StickyFooter() { return ( diff --git a/frontend/src/components/genres/genres.js b/frontend/src/components/genres/genres.js index f6b0221f..87e7d892 100644 --- a/frontend/src/components/genres/genres.js +++ b/frontend/src/components/genres/genres.js @@ -1,9 +1,8 @@ import { Chip } from "@material-ui/core"; -import axios from "axios"; import { useEffect } from "react"; import { makeStyles } from "@material-ui/core/styles"; -const useStyles = makeStyles((theme) => ({ +const useStyles = makeStyles(() => ({ root: { color: "white", background: "#9d50bb", @@ -35,7 +34,6 @@ const Genres = ({ return () => { setGenres({}); // unmounting }; - // eslint-disable-next-line }, []); return ( diff --git a/frontend/src/components/layout/Spinner.js b/frontend/src/components/layout/Spinner.js deleted file mode 100644 index c2957839..00000000 --- a/frontend/src/components/layout/Spinner.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import spinner from './spinner.gif' - -function Spinner() { - return ( -
- Loading... -
- ) -} - -export default Spinner diff --git a/frontend/src/components/layout/spinner.gif b/frontend/src/components/layout/spinner.gif deleted file mode 100644 index 0424aa4f..00000000 Binary files a/frontend/src/components/layout/spinner.gif and /dev/null differ diff --git a/frontend/src/components/likeDislike/MakeComment.js b/frontend/src/components/likeDislike/MakeComment.js index 76ab9ae6..2ad13af0 100644 --- a/frontend/src/components/likeDislike/MakeComment.js +++ b/frontend/src/components/likeDislike/MakeComment.js @@ -88,7 +88,6 @@ function MakeComment(props) { return ( <> - {console.log(comment)}
diff --git a/frontend/src/components/likeDislike/ShowComments.js b/frontend/src/components/likeDislike/ShowComments.js index 748169cb..03748c9a 100644 --- a/frontend/src/components/likeDislike/ShowComments.js +++ b/frontend/src/components/likeDislike/ShowComments.js @@ -1,17 +1,14 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; -import { Link } from 'react-router-dom'; -import Spinner from '../../layout/Spinner'; import { FetchComments, CommentLoading } from '../../redux/actions/authActions'; //material UI -import { withStyles,makeStyles } from '@material-ui/core/styles'; +import { withStyles } from '@material-ui/core/styles'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import Divider from '@material-ui/core/Divider'; import ListItemText from '@material-ui/core/ListItemText'; import ListItemAvatar from '@material-ui/core/ListItemAvatar'; -import Avatar from '@material-ui/core/Avatar'; import Typography from '@material-ui/core/Typography'; import Card from '@material-ui/core/Card'; import LinearProgress from "@material-ui/core/LinearProgress"; @@ -81,7 +78,6 @@ barCover: { borderRadius: 5, width: 80, background: "linear-gradient(45deg, #9d50bb 30%, #6e48aa 90%)", - // boxShadow: '0 3px 5px 2px rgba(255 , 175, 189, .2)' }, }); export class ShowComments extends Component { @@ -140,7 +136,6 @@ export class ShowComments extends Component { className={classes.inline} > {comment.CommentContent} - {/* Testing Comments - Real Comments Unavailable for now! */} } /> diff --git a/frontend/src/components/movies/Credits.js b/frontend/src/components/movies/Credits.js index 2c360804..1c7272a4 100644 --- a/frontend/src/components/movies/Credits.js +++ b/frontend/src/components/movies/Credits.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { fetchCredits, setLoading } from '../../redux/actions/movieActions'; -import Spinner from '../../layout/Spinner'; import png from '../../images/castMissing.png'; import Carousel from "react-elastic-carousel"; import CircularProgress from "@material-ui/core/CircularProgress"; @@ -17,42 +16,42 @@ import { Grid } from '@material-ui/core/' import LinearProgress from "@material-ui/core/LinearProgress"; import { Link } from 'react-router-dom'; -const useStyles = theme =>({ +const useStyles = theme => ({ container: { background: '#141414', - color:'#fff', + color: '#fff', display: 'flex', margin: '0 100px 0px 100px', - border: "none", + border: "none", boxShadow: "none" }, item: { background: '#141414', - color:'#fff', - textAlign : "center", - border: "none", + color: '#fff', + textAlign: "center", + border: "none", boxShadow: "none", - height:380, - width:200 + height: 380, + width: 200 }, castCharacter: { background: '#141414', - color:'#fff', + color: '#fff', fontSize: "18px" - }, - image: { + }, + image: { borderRadius: '10%', border: '3px solid #141414', height: 250 }, cast: { - fontWeight:'Bold', + fontWeight: 'Bold', fontSize: "32px", marginTop: "10px", marginBottom: "10px", - textAlign : "left", - marginLeft:125 + textAlign: "left", + marginLeft: 125 }, noimage: { borderRadius: '50%', @@ -64,17 +63,16 @@ const useStyles = theme =>({ height: '125px', width: '125px' }, - barCover:{ + barCover: { height: 10, borderRadius: 5, - width:50, - marginLeft:125, + width: 50, + marginLeft: 125, marginBottom: "20px", - background:'linear-gradient(45deg, #9d50bb 30%, #6e48aa 90%)' + background: 'linear-gradient(45deg, #9d50bb 30%, #6e48aa 90%)' }, gridList: { flexWrap: 'nowrap', - // Promote the list into his own layer on Chrome. This cost memory but helps keeping high FPS. transform: 'translateZ(0)', }, overview: { @@ -86,107 +84,105 @@ const useStyles = theme =>({ const getImage = (path) => `https://image.tmdb.org/t/p/w300/${path}`; export class Credits extends Component { - // componentDidMount() { - // this.props.fetchCredits(this.props.id); - // this.props.setLoading(); - // } - render() { - const { loading, credits } = this.props; - //material UI - const {classes} = this.props; - const breakPoints = [ - { width: 1, itemsToShow: 1 }, - { width: 550, itemsToShow: 3 }, - { width: 768, itemsToShow: 5 }, - { width: 1200, itemsToShow: 8 }, - { width: 1400, itemsToShow: 10 }, - ]; - - - let castList = - credits!= "" && - + + render() { + const { loading, credits } = this.props; + //material UI + const { classes } = this.props; + const breakPoints = [ + { width: 1, itemsToShow: 1 }, + { width: 550, itemsToShow: 3 }, + { width: 768, itemsToShow: 5 }, + { width: 1200, itemsToShow: 8 }, + { width: 1400, itemsToShow: 10 }, + ]; + + + let castList = + credits != "" && + {credits.map(castMember => ( - - - - {castMember.profile_path ? ( - - - - - - - {castMember.name} - {castMember.character} - - - ) : ( - - - - - {castMember.name} - {castMember.character} - - )} - - - - - ))} - - let contents = loading ?
: castList; - return credits!= "" ? ( -
- Cast - -
- {/* {contents} */} - {contents} -
-
- ):( -
- Cast - + + + + {castMember.profile_path ? ( + + + + + + + {castMember.name} + {castMember.character} + + + ) : ( + + + + + {castMember.name} + {castMember.character} + + )} + + + + + ))} + + let contents = loading ?
: castList; + return credits != "" ? ( +
+ Cast + +
+ {contents} +
+
+ ) : ( +
+ Cast + -
- Cast is currently unavailable -
-
- ) ; }; } - - +
+ Cast is currently unavailable +
+
+ ); + }; +} + + const mapStateToProps = state => ({ - loading: state.movie.loading, - credits: state.movie.credits - }); - - export default connect( - mapStateToProps, - { fetchCredits, setLoading } - )(withStyles(useStyles)(Credits)); \ No newline at end of file + loading: state.movie.loading, + credits: state.movie.credits +}); + +export default connect( + mapStateToProps, + { fetchCredits, setLoading } +)(withStyles(useStyles)(Credits)); \ No newline at end of file diff --git a/frontend/src/components/movies/Movie.js b/frontend/src/components/movies/Movie.js index 8326447a..186aecf6 100644 --- a/frontend/src/components/movies/Movie.js +++ b/frontend/src/components/movies/Movie.js @@ -1,15 +1,12 @@ import React, { useState } from "react"; import { fetchMovie, setLoading } from "../../redux/actions/movieActions"; import { connect } from "react-redux"; -import Spinner from "../../layout/Spinner"; import Genres from "../genres/genres"; import AuthModal from "../auth/isAuth"; import WatchlistBtn from "../watchlist/AddToWatchlist"; import Like from "../likeDislike/Like"; import { - img_500, unavailable, - unavailableLandscape, } from '../../util/config'; //material UI @@ -59,8 +56,6 @@ const useStyles = makeStyles((theme) => ({ display: "inline-block", marginLeft: 100, marginRight: 100, - // border: "none", - // boxShadow: "none", alignItems: "center", justifyContent: "center", }, @@ -100,7 +95,6 @@ const useStyles = makeStyles((theme) => ({ borderRadius: 5, width: 120, background: "linear-gradient(45deg, #9d50bb 30%, #6e48aa 90%)", - // boxShadow: '0 3px 5px 2px rgba(255 , 175, 189, .2)' }, heart: { display: "flex", @@ -110,11 +104,9 @@ const useStyles = makeStyles((theme) => ({ })); function Movie({ loading, movie, auth }) { - // const { loading, movie, auth, selectedGenres,setSelectedGenres,setGenres,genres,movieIds } = this.props; const classes = useStyles(); const [selectedGenres, setSelectedGenres] = useState([]); const [genres, setGenres] = useState([]); - console.log(movie.genres); let movieInfo = (
diff --git a/frontend/src/components/movies/Row.js b/frontend/src/components/movies/Row.js index f85b72f9..290e933e 100644 --- a/frontend/src/components/movies/Row.js +++ b/frontend/src/components/movies/Row.js @@ -2,8 +2,6 @@ import React, { useState, useEffect } from "react"; import Carousel from "react-elastic-carousel"; import axios from "axios"; import "../styles/Row.css"; -import { Link } from "react-router-dom"; -import { connect } from "react-redux"; import MovieCard from "./MovieCard"; function Row({ title, url, isLargeRow }) { diff --git a/frontend/src/components/movies/SkeletonMovie.js b/frontend/src/components/movies/SkeletonMovie.js index 6cc25718..8081f2fa 100644 --- a/frontend/src/components/movies/SkeletonMovie.js +++ b/frontend/src/components/movies/SkeletonMovie.js @@ -1,11 +1,8 @@ import React, { Component, } from 'react'; import "../styles/Row.css"; - import { Skeleton } from '@material-ui/lab'; -import { Box } from '@material-ui/core' - -const SkeletonCard = ({ isLargeRow }) => { +const SkeletonCard = () => { return ( diff --git a/frontend/src/components/movies/Trailer.js b/frontend/src/components/movies/Trailer.js index 4d16cacd..cd8d43bb 100644 --- a/frontend/src/components/movies/Trailer.js +++ b/frontend/src/components/movies/Trailer.js @@ -1,7 +1,5 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; -import { Link } from 'react-router-dom'; -import Spinner from '../../layout/Spinner'; import { fetchTrailer, setLoading } from '../../redux/actions/movieActions'; import ReactPlayer from "react-player"; import LinearProgress from "@material-ui/core/LinearProgress"; @@ -11,76 +9,72 @@ import CircularProgress from "@material-ui/core/CircularProgress"; import Grid from '@material-ui/core/Grid'; -const useStyles = theme =>({ +const useStyles = theme => ({ trailer: { - fontWeight:'Bold', + fontWeight: 'Bold', fontSize: "32px", marginTop: "30px", marginBottom: "10px", - textAlign : "left", + textAlign: "left", marginLeft: 120 }, - barCover:{ + barCover: { height: 10, borderRadius: 5, - width:50, - marginLeft:125, + width: 50, + marginLeft: 125, marginBottom: "20px", - background:'linear-gradient(45deg, #9d50bb 30%, #6e48aa 90%)' + background: 'linear-gradient(45deg, #9d50bb 30%, #6e48aa 90%)' }, videoContainer: { display: 'flex', - border: "none", + border: "none", boxShadow: "none", alignItems: 'center', justifyContent: 'center', justify: "center", - marginLeft:160, - marginBottom:30, + marginLeft: 160, + marginBottom: 30, width: 1200 }, }); export class Trailer extends Component { - // componentDidMount() { - // this.props.fetchTrailer(this.props.match.params.id); - // this.props.setLoading(); - // console.log(this.props.match.params.id); - // } + render() { const { loading, trailer } = this.props; - const {classes} = this.props; + const { classes } = this.props; let movieInfo = -
- {trailer.slice(0,1).map(video => ( - //epeidh emfanizw mono ena trailer mporw na topothetisw mesa sto map - // ta typography kai linearProgress -
- Trailer - -
- -
- -
-
-
-
- ))} -
+
+ {trailer.slice(0, 1).map(video => ( + //epeidh emfanizw mono ena trailer mporw na topothetisw mesa sto map + // ta typography kai linearProgress +
+ Trailer + +
+ +
+ +
+
+
+
+ ))} +
- let content = loading ?
: movieInfo; + let content = loading ?
: movieInfo; return
{content}
- + } } @@ -92,4 +86,4 @@ const mapStateToProps = state => ({ export default connect( mapStateToProps, { fetchTrailer, setLoading } -)(withStyles(useStyles) (Trailer)); +)(withStyles(useStyles)(Trailer)); diff --git a/frontend/src/components/navbar/AppNavbar.js b/frontend/src/components/navbar/AppNavbar.js index b98c8d3b..2bc8050d 100644 --- a/frontend/src/components/navbar/AppNavbar.js +++ b/frontend/src/components/navbar/AppNavbar.js @@ -18,8 +18,6 @@ import IconButton from "@material-ui/core/IconButton"; //Actions import Logout from "../auth/Logout"; //Components and pages -import Watchlist from "../../pages/WatchlistPage"; -import NavMovies from "./NavMovie"; import DropdownMenu from "./Dropdown"; const styles = { diff --git a/frontend/src/components/navbar/SearchBox.js b/frontend/src/components/navbar/SearchBox.js index 5e62f8bd..96ad96e7 100644 --- a/frontend/src/components/navbar/SearchBox.js +++ b/frontend/src/components/navbar/SearchBox.js @@ -49,7 +49,6 @@ const styles = { }, inputInput: { padding: "1px 1px 1px 0px", - // vertical padding + font size from searchIcon paddingLeft: "30px", transition: "width", width: "100%", @@ -60,7 +59,6 @@ class SearchBox extends Component { constructor(props) { super(props); this.state = { - // movies: props.movies, listening: false, query: "", submit: false, @@ -79,8 +77,6 @@ class SearchBox extends Component { if (!recognition.listening) { recognition.start(); recognition.onresult = (event) => { - let interimTranscript = ""; - var finalTranscript = ""; for (let i = event.resultIndex; i < event.results.length; i++) { const transcript = event.results[i][0].transcript; if (event.results[i].isFinal) finalTranscript += transcript + " "; @@ -105,8 +101,7 @@ class SearchBox extends Component { resetSubmit() { this.setState({ submit: false }); - console.log("reset"); - console.log(this.state.submit); + } render() { diff --git a/frontend/src/components/person/PersonInfo.js b/frontend/src/components/person/PersonInfo.js index 6044d818..eca9aab9 100644 --- a/frontend/src/components/person/PersonInfo.js +++ b/frontend/src/components/person/PersonInfo.js @@ -1,8 +1,7 @@ -import React, { useEffect, Component, useState } from "react"; +import React from "react"; import ModalImg from "./ModalImg"; import "../styles/PersonInfo.css"; import { unavailable } from "./Config.js"; -import PersonDetailsPage from "../../pages/PersonDetailsPage"; import { makeStyles, withStyles } from "@material-ui/core/styles"; import Table from "@material-ui/core/Table"; import TableBody from "@material-ui/core/TableBody"; @@ -48,7 +47,6 @@ const PersonInfo = (props) => { return (
- {console.log(props.credits)}
{" "} diff --git a/frontend/src/components/watchlist/AddToWatchlist.js b/frontend/src/components/watchlist/AddToWatchlist.js index 2b2b89be..735f710a 100644 --- a/frontend/src/components/watchlist/AddToWatchlist.js +++ b/frontend/src/components/watchlist/AddToWatchlist.js @@ -6,7 +6,6 @@ import "../styles/watchlist.css"; import { connect } from "react-redux"; import AuthModal from "../auth/isAuth"; import { addWatchlist, deleteWatchlist } from "../../redux/actions/authActions"; -import Axios from "axios"; export function AddToList({ auth, @@ -14,10 +13,8 @@ export function AddToList({ watchlist, addWatchlist, deleteWatchlist, - succes, }) { const [added, setAdded] = useState(false); - const [watchlistAction, setWatchlistAction] = useState(null); const [watchAction, setWactchAction] = useState(false); useEffect(() => { @@ -29,16 +26,7 @@ export function AddToList({ } }); } - // //if watchlist req status=200 and - // if(succes){ - // //if movie was in watchlist delete it - // if(added){ - // setAdded(false); - // }else{ - // setAdded(false); - // } - // } }); const onClick = () => { diff --git a/frontend/src/layout/Spinner.js b/frontend/src/layout/Spinner.js deleted file mode 100644 index c2957839..00000000 --- a/frontend/src/layout/Spinner.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' -import spinner from './spinner.gif' - -function Spinner() { - return ( -
- Loading... -
- ) -} - -export default Spinner diff --git a/frontend/src/layout/spinner.gif b/frontend/src/layout/spinner.gif deleted file mode 100644 index 0424aa4f..00000000 Binary files a/frontend/src/layout/spinner.gif and /dev/null differ diff --git a/frontend/src/pages/ChangePassword.js b/frontend/src/pages/ChangePassword.js index 55019402..65b2fba1 100644 --- a/frontend/src/pages/ChangePassword.js +++ b/frontend/src/pages/ChangePassword.js @@ -14,14 +14,8 @@ const useStyles = makeStyles((theme) => ({ }, form2: { - // position: "", width: "30%", - // height: "100%", margin: " auto", - // marginTop: theme.spacing(-10), - // marginLeft: "0px", - // // marginBottom: "5000px", - // marginRight: "800px", }, submit: { margin: theme.spacing(3, 0, 2), @@ -79,16 +73,15 @@ function ChangePassword({
{msg || newpassword !== confirmnewpassword ? ( {wrongmsg} - ) : // {changePassword} - null} + ) : + null} {change_password !== null && - msg && - newpassword == confirmnewpassword && - newpassword !== password ? ( + msg && + newpassword == confirmnewpassword && + newpassword !== password ? ( {msg} - ) : // {changePassword} - null} - {console.log(change_password)} + ) : + null} ({ })); function GenresPage() { - const [selectedGenres, setSelectedGenres] = useState([]); const [genres, setGenres] = useState([]); const [content, setContent] = useState(); const [pageText, setPageText] = useState(); @@ -83,7 +80,6 @@ function GenresPage() { setMovies(response.data.results); setTotalResults(response.data.total_results); settotalPages(response.data.total_pages); - console.log(response.data.results); }) .catch((error) => { setLoading(false); @@ -111,8 +107,8 @@ function GenresPage() { let mapping = movies ? movies.map((movie) => ( - - )) + + )) : null; let displayInfo = !loading ? ( @@ -154,11 +150,7 @@ function GenresPage() {
{displayInfo}
{totalresults > 20 && currentMovie == null ? ( - // + ({ - // genres: state.movie.fetchGenre, }); export default withRouter(connect(mapStateToProps, { fetchGenre })(GenresPage)); diff --git a/frontend/src/pages/HomePage.js b/frontend/src/pages/HomePage.js index bbfb18e5..0fae8f57 100644 --- a/frontend/src/pages/HomePage.js +++ b/frontend/src/pages/HomePage.js @@ -1,6 +1,5 @@ -import React, { useEffect } from 'react'; +import React from 'react'; import { connect } from 'react-redux'; -import MovieCard from '../components/movies/MovieCard'; import '../components/styles/HomePage.css'; import Row from '../components/movies/Row' @@ -10,15 +9,7 @@ const MovieList = ({ isAuthenticated, deleteMovies }) => { - // useEffect(() => { - // getMovies('latest?page=1'); - // }, [getMovies]); - // const handleDelete = (id) => { - // addWatchlist(id); - // }; - - const { movies } = movie; return (
diff --git a/frontend/src/pages/LanguagePage.js b/frontend/src/pages/LanguagePage.js index 844d1f8f..04e0ffc5 100644 --- a/frontend/src/pages/LanguagePage.js +++ b/frontend/src/pages/LanguagePage.js @@ -1,12 +1,8 @@ import React, { useState, useEffect } from "react"; -import Button from "@material-ui/core/Button"; import { makeStyles } from "@material-ui/core/styles"; -import withStyles from "@material-ui/core/styles/withStyles"; import CircularProgress from "@material-ui/core/CircularProgress"; import SentimentDissatisfiedSharpIcon from "@material-ui/icons/SentimentDissatisfiedSharp"; -import Menu from "@material-ui/core/Menu"; -import MenuItem from "@material-ui/core/MenuItem"; import MovieCard from "../components/movies/MovieCard"; import { StyledButton } from "../util/MyTextfield"; @@ -105,8 +101,7 @@ function LanguagePage() { setLoading(false); setCurrentMovie(response.data); - if (response.data.length == 20) { - console.log("20 it is "); + if (response.data.length === 20) { setPage(true); } else { setPage(false); @@ -121,7 +116,6 @@ function LanguagePage() { const nextPage = () => { setLoading(true); setCurrentPage(currentPage + 1); - const newmovies = currentMovie; axios .get( `https://localhost:44324/api/MovieShowcase/Search/lang?lang=${iso}&page=${currentPage}` @@ -134,7 +128,6 @@ function LanguagePage() { } setCurrentMovie([...currentMovie, ...response.data]); - console.log(currentMovie); }); }; @@ -183,7 +176,6 @@ function LanguagePage() { ) : null}
- {console.log(englishname)}
{page && currentMovie.length !== 0 ? ( diff --git a/frontend/src/pages/MoviePage.js b/frontend/src/pages/MoviePage.js index b658b719..4613de41 100644 --- a/frontend/src/pages/MoviePage.js +++ b/frontend/src/pages/MoviePage.js @@ -2,7 +2,6 @@ import React, { Component } from 'react' import { fetchMovie, fetchCredits, setLoading, fetchTrailer } from '../redux/actions/movieActions'; import { FetchComments, CommentLoading } from '../redux/actions/authActions' import { connect } from 'react-redux'; -import Spinner from '../layout/Spinner'; import Movie from '../components/movies/Movie'; import Credits from '../components/movies/Credits'; import Trailer from '../components/movies/Trailer'; @@ -65,16 +64,16 @@ const useStyles = theme => ({ }); class MoviePage extends Component { componentDidMount() { - // setTimeout(() => { + this.props.fetchMovie(this.props.match.params.id); this.props.fetchCredits(this.props.match.params.id); this.props.fetchTrailer(this.props.match.params.id); this.props.FetchComments(this.props.match.params.id); this.props.setLoading(); - // },1000) + } render() { - const { loading, movie, credits, auth, isAuthenticated } = this.props; + const { loading, movie, auth } = this.props; const { id } = this.props.match.params; const { classes } = this.props; let movieInfo = diff --git a/frontend/src/pages/MoviesType.js b/frontend/src/pages/MoviesType.js index db6c6020..2688760f 100644 --- a/frontend/src/pages/MoviesType.js +++ b/frontend/src/pages/MoviesType.js @@ -1,9 +1,8 @@ -import React, { useContext, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import MovieCard from "../components/movies/MovieCard"; import { connect } from "react-redux"; import "../components/styles/watchlist.css"; import { getMovies } from "../redux/actions/movieActions"; -import { StyledButton } from "../util/MyTextfield"; import { makeStyles } from "@material-ui/core/styles"; import ArrowBackIcon from "@material-ui/icons/ArrowBack"; import ArrowForwardIcon from "@material-ui/icons/ArrowForward"; @@ -57,16 +56,13 @@ function usePrevious(value) { export const MoviesType = ({ getMovies, movies, loading, location }) => { const classes = useStyles(); const [currentPage, setCurrentPage] = useState(1); - const [newmovies, setNewmovies] = useState([]); const movieurl = location.pathname; const prevPathName = usePrevious(movieurl); const title = movieurl.slice(1, movieurl.length); //axios request with url param pathname useEffect(() => { - if (prevPathName != movieurl) { - // setNewmovies(null); + if (prevPathName !== movieurl) { setCurrentPage(1); - // console.log("URL CHANGED"); } getMovies(movieurl, currentPage); window.history.replaceState( @@ -74,10 +70,7 @@ export const MoviesType = ({ getMovies, movies, loading, location }) => { "new page title", `${movieurl}?page=${currentPage}` ); - // if (currentPage > 1) { - // setNewmovies([...newmovies, ...movies]); - // } - // setNewmovies(movies); + }, [movieurl, currentPage]); //Load More const nextPage = () => { diff --git a/frontend/src/pages/MyAccountPage.js b/frontend/src/pages/MyAccountPage.js index 221c5a7c..6edc7421 100644 --- a/frontend/src/pages/MyAccountPage.js +++ b/frontend/src/pages/MyAccountPage.js @@ -1,10 +1,7 @@ -import React, { Component, useState, useEffect } from "react"; +import React, { useState, useEffect } from "react"; import { makeStyles } from "@material-ui/core/styles"; import MyaccountMenu from "./MyaccountMenu"; import ChangePassword from "./ChangePassword"; -import Grid from "@material-ui/core/Grid"; -import CircularProgress from "@material-ui/core/CircularProgress"; -import { MyTextField, StyledButton, StyledLink } from "../util/MyTextfield"; import { connect } from "react-redux"; const useStyles = makeStyles((theme) => ({ @@ -18,11 +15,8 @@ const useStyles = makeStyles((theme) => ({ boxSizing: "border-box", textAlign: "center", justifyContent: "center", - // height: "30px", width: "400px", - // left: "0px", display: "flex", - // marginTop: "-150px", }, heading: { display: "flex", @@ -31,7 +25,6 @@ const useStyles = makeStyles((theme) => ({ marginBottom: "1.25rem", }, body: { - // display: "grid", marginLeft: "0px", paddingLeft: "0px", width: "100%", @@ -45,11 +38,7 @@ const useStyles = makeStyles((theme) => ({ }, form2: { width: "30%", - // height: "10%", - // marginTop: theme.spacing(3), - // marginLeft: "0px", - // // marginBottom: "5000px", - // marginRight: "800px", + }, submit: { margin: theme.spacing(3, 0, 2), @@ -72,16 +61,15 @@ const useStyles = makeStyles((theme) => ({ function MyAccountPage({ user }) { const [page, setPage] = useState(1); - useEffect(() => {}, []); + useEffect(() => { }, []); const classes = useStyles(); return ( <>

{user ? user.UserName : null}

- {console.log(page)} - {page == 1 ? ( + {page === 1 ? (
@@ -98,7 +86,7 @@ function MyAccountPage({ user }) {
- ) : page == 2 ? ( + ) : page === 2 ? (
diff --git a/frontend/src/pages/MyaccountMenu.js b/frontend/src/pages/MyaccountMenu.js index 507f6a32..1b976bbb 100644 --- a/frontend/src/pages/MyaccountMenu.js +++ b/frontend/src/pages/MyaccountMenu.js @@ -1,8 +1,7 @@ -import React, { useContext, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import { makeStyles } from "@material-ui/core/styles"; import AccountBoxIcon from "@material-ui/icons/AccountBox"; import VpnKeyIcon from "@material-ui/icons/VpnKey"; -import MyAccountPage from "./MyAccountPage"; import { connect } from "react-redux"; import { Link } from "react-router-dom"; import ExitToAppIcon from "@material-ui/icons/ExitToApp"; @@ -11,9 +10,7 @@ import { Redirect } from "react-router-dom"; const useStyles = makeStyles((theme) => ({ mainDiv: { - // position: "relative", - // left: "250px", - // marginLeft: "-250px", + width: "10%", top: "91px", borderWidth: "0px", @@ -58,9 +55,7 @@ const useStyles = makeStyles((theme) => ({ alignItems: "center", }, icons: { - // viewBox: "0 0 20 20", - // widht: "1.5rem", - // height: "1.5rem", + width: "40px", height: "40px", display: "inline-block", @@ -96,7 +91,6 @@ const useStyles = makeStyles((theme) => ({ }, flexRight: { flex: "90%", - // backgroundColor: "#FFF", }, link: { textDecoration: "none", @@ -118,7 +112,6 @@ function MyaccountMenu(props) { if (!props.isAuthenticated) { setRedirect(true); } - console.log(props); }, [props.error, props.isAuthenticated]); const handlePage = () => { @@ -135,11 +128,6 @@ function MyaccountMenu(props) {
-
- {/*

- {props.user ? props.user.UserName : null} -

*/} -

@@ -208,7 +196,6 @@ function MyaccountMenu(props) {
- {/*
*/}
diff --git a/frontend/src/pages/NotFound.js b/frontend/src/pages/NotFound.js index 4328c513..de99f690 100644 --- a/frontend/src/pages/NotFound.js +++ b/frontend/src/pages/NotFound.js @@ -3,7 +3,6 @@ import { Link } from "react-router-dom" import { makeStyles } from '@material-ui/core/styles'; import Typography from "@material-ui/core/Typography"; import HelpOutlineIcon from '@material-ui/icons/HelpOutline'; -import Spinner from "../layout/Spinner"; import CircularProgress from "@material-ui/core/CircularProgress"; const useStyles = makeStyles({ @@ -50,40 +49,40 @@ const useStyles = makeStyles({ }, circular: { display: "grid", - justifyContent:"center", + justifyContent: "center", alignItems: "center", marginLeft: "30px", marginRight: "30px", marginTop: "30px", padding: "100px", width: "100", - + } }); export default function NotFound(loading) { const classes = useStyles(); const [data, setData] = useState(null); - const [wait,setWait] = useState(false); + const [wait, setWait] = useState(false); useEffect(() => { setTimeout(() => { setWait(true); setData( -
- 4 +
+ 4 4 - - Maybe this page moved? Got deleted? - Is hiding out in quarantine? Never existed in the first place? - Let's go + + Maybe this page moved? Got deleted? + Is hiding out in quarantine? Never existed in the first place? + Let's go Back to the Homepage and try from there. + component="button" + to="/">Back to the Homepage and try from there. -
) +
) }, 3000); - }, []) - return ( !wait ?
:
{data}
); + }, []) + return (!wait ?
:
{data}
); } \ No newline at end of file diff --git a/frontend/src/pages/PersonDetailsPage.js b/frontend/src/pages/PersonDetailsPage.js index 2ffb8565..27e4116f 100644 --- a/frontend/src/pages/PersonDetailsPage.js +++ b/frontend/src/pages/PersonDetailsPage.js @@ -1,11 +1,10 @@ -import React, { Component, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import PersonInfo from "../components/person/PersonInfo"; import "../components/styles/PersonInfo.css"; const PersonDetailsPage = (props) => { const [Person, setPerson] = useState([]); const [Credits, setCredits] = useState([]); - // const classes = useStyles(); useEffect(() => { const personId = props.match.params.personId; @@ -15,7 +14,6 @@ const PersonDetailsPage = (props) => { ) .then((response) => response.json()) .then((response) => { - //console.log(response); setPerson(response); }); @@ -24,7 +22,6 @@ const PersonDetailsPage = (props) => { ) .then((response) => response.json()) .then((response) => { - console.log(response); setCredits(response.cast); }); @@ -32,7 +29,6 @@ const PersonDetailsPage = (props) => { return (
- {console.log(Credits.title)} { ) .then((response) => response.json()) .then((response) => { - //console.log(response); setPersons(response.results); }); }, []); diff --git a/frontend/src/pages/SearchPage.js b/frontend/src/pages/SearchPage.js index 14c44c05..202417b1 100644 --- a/frontend/src/pages/SearchPage.js +++ b/frontend/src/pages/SearchPage.js @@ -1,24 +1,19 @@ -import React, { Component } from "react"; +import React from "react"; import { connect } from "react-redux"; import MovieCard from "../components/movies/MovieCard"; import { makeStyles } from "@material-ui/core/styles"; import { searchMovies } from "../redux/actions/movieActions"; import MicIcon from "@material-ui/icons/Mic"; import { IconButton } from "@material-ui/core"; -import { InputBase } from "@material-ui/core"; import SentimentDissatisfiedSharpIcon from "@material-ui/icons/SentimentDissatisfiedSharp"; import { Button, createMuiTheme, - Tab, - Tabs, TextField, ThemeProvider, } from "@material-ui/core"; import SearchIcon from "@material-ui/icons/Search"; import { useEffect, useState } from "react"; -import axios from "axios"; -import { NavItem } from "reactstrap"; import CircularProgress from "@material-ui/core/CircularProgress"; const useStyles = makeStyles((theme) => ({ @@ -68,8 +63,6 @@ function SearchPage(props) { }); const classes = useStyles(); const [searchText, setSearchText] = useState(""); - const [results, setResults] = useState(1); - const [listening, setListening] = useState(false); const [submit, setSubmit] = useState(false); const [submittedtext, setSubmittedtext] = useState(null); const movies = props.movies; @@ -79,14 +72,12 @@ function SearchPage(props) { if (!recognition.listening) { recognition.start(); recognition.onresult = (event) => { - let interimTranscript = ""; var finalTranscript = ""; for (let i = event.resultIndex; i < event.results.length; i++) { const transcript = event.results[i][0].transcript; if (event.results[i].isFinal) finalTranscript += transcript + " "; - else interimTranscript += transcript; + } - console.log(finalTranscript); setSearchText(finalTranscript); }; } else { @@ -116,8 +107,8 @@ function SearchPage(props) { let mapping = movies.length > 0 ? movies.map((movie) => ( - - )) + + )) : null; let displayInfo = !loading ? ( @@ -161,7 +152,7 @@ function SearchPage(props) {
{displayInfo}
- {searchText && movies.length == 0 && submittedtext && !loading ? ( + {searchText && movies.length === 0 && submittedtext && !loading ? (
No Movie with the name — {submittedtext} was found. diff --git a/frontend/src/pages/WatchlistPage.js b/frontend/src/pages/WatchlistPage.js index d416f48e..21d35d5c 100644 --- a/frontend/src/pages/WatchlistPage.js +++ b/frontend/src/pages/WatchlistPage.js @@ -1,4 +1,4 @@ -import React, { useContext, useEffect } from "react"; +import React from "react"; import MovieCard from "../components/movies/MovieCard"; import { connect } from "react-redux"; import "../components/styles/watchlist.css"; @@ -27,7 +27,7 @@ export const Watchlist = ({ watchlist, isAuthenticated }) => {
) : null} - {isAuthenticated && watchlist == 0 ? ( + {isAuthenticated && watchlist === 0 ? (



No movies in your list! Add some!

diff --git a/frontend/src/redux/actions/authActions.js b/frontend/src/redux/actions/authActions.js index 6eb45ce7..bb4425a7 100644 --- a/frontend/src/redux/actions/authActions.js +++ b/frontend/src/redux/actions/authActions.js @@ -1,5 +1,4 @@ import axios from "axios"; -import { api } from "../../util/config"; import { returnErrors } from "./errorActions"; import { USER_LOADED, @@ -57,7 +56,6 @@ export const addWatchlist = (token, movieId) => (dispatch, getState) => { }; //delete watclist export const deleteWatchlist = (movieId) => (dispatch, getState) => { - const body = JSON.stringify({ movieId: movieId }); axios .delete("/api/users/watchlist/Remove", conf(movieId)) .then((res) => diff --git a/frontend/src/redux/actions/movieActions.js b/frontend/src/redux/actions/movieActions.js index 5e85722f..977ac03a 100644 --- a/frontend/src/redux/actions/movieActions.js +++ b/frontend/src/redux/actions/movieActions.js @@ -1,12 +1,9 @@ import axios from "axios"; import { - GET_WATCHLIST, GENRES_MAP, SEARCH_MOVIES_LOADING, SEARCH_MOVIES, GET_MOVIES, - DELETE_WATCHLIST, - ADD_WATCHLIST, MOVIES_LOADING, FETCH_MOVIE, LOADING, @@ -14,7 +11,6 @@ import { FETCH_TRAILER, SEARCH_NOTFOUND, } from "./types"; -import { tokenConfig } from "./authActions"; import { returnErrors } from "./errorActions"; export const getMovies = (url, page) => (dispatch) => { diff --git a/frontend/src/redux/reducers/authReducer.js b/frontend/src/redux/reducers/authReducer.js index 5aadcd5b..6939533d 100644 --- a/frontend/src/redux/reducers/authReducer.js +++ b/frontend/src/redux/reducers/authReducer.js @@ -15,7 +15,6 @@ import { PASSWORD_FAILED, FETCH_COMMENTSTATS, FAILED_COMMENTS, - ADD_COMMENTS } from '../actions/types'; const initialState = { diff --git a/frontend/src/util/MyTextfield.js b/frontend/src/util/MyTextfield.js index a1a53e7e..eeba145a 100644 --- a/frontend/src/util/MyTextfield.js +++ b/frontend/src/util/MyTextfield.js @@ -6,8 +6,6 @@ import { Link } from 'react-router-dom'; export const MyTextField = withStyles({ root: { - // backgroundColor: '#fff', - "& .MuiFormLabel-root": { color: 'white' }, diff --git a/frontend/src/util/config.js b/frontend/src/util/config.js index 9e24491a..ede97133 100644 --- a/frontend/src/util/config.js +++ b/frontend/src/util/config.js @@ -1,4 +1,3 @@ -import axios from 'axios'; export const img_300 = "https://image.tmdb.org/t/p/w300"; export const img_500 = "https://image.tmdb.org/t/p/w500";