import React, { useContext } from "react"; import "./styles.css"; import LandingSection from "containers/LandingSection/LandingSection"; import Login from "containers/Login/Login"; import Browse from 'containers/Browse/Browse' import { Switch, Route, Redirect } from "react-router-dom"; import { AuthenticationContext } from 'context/Authentication' import NotFoundPage from 'components/StaticPages/NotFoundPage/NotFoundPage' export default function App() { const authContext = useContext(AuthenticationContext) const checkAuthAndSetBrowseComponent = (propsObject) => { return (authContext.authenticated || localStorage.getItem('profileSelected')) ? : } return (
checkAuthAndSetBrowseComponent({ route: '/browse' })}> checkAuthAndSetBrowseComponent({ route: '/browse/tv' })}> checkAuthAndSetBrowseComponent({ route: '/browse/movies' })}> checkAuthAndSetBrowseComponent({ route: '/browse/latest' })}> checkAuthAndSetBrowseComponent({ route: '/browse/list' })}> checkAuthAndSetBrowseComponent({ route: '/search' })}>
); }