Fixed all firebase login issues. Added private routes. Reconfigured components and reorganized project.
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
import React from "react";
|
||||
import { Switch, Route } from "react-router";
|
||||
import { ApolloProvider } from "react-apollo";
|
||||
import { HttpLink } from "apollo-link-http";
|
||||
import ApolloClient from "apollo-client";
|
||||
import { InMemoryCache } from "apollo-cache-inmemory";
|
||||
import { resolvers, typeDefs } from "../graphql/resolvers";
|
||||
|
||||
import initialState from "../graphql/initial-state";
|
||||
//Styling imports
|
||||
import "./App.css";
|
||||
|
||||
import HeaderAppBarContainer from "../components/header-app-bar/header-app-bar.container";
|
||||
import SignIn from "../components/sign-in/sign-in.component";
|
||||
import initialState from "../graphql/initial-state";
|
||||
import JobListContainer from "../components/job-list/job-list.container";
|
||||
//Component Imports
|
||||
import SignIn from "../components/landing-components/sign-in/sign-in.component";
|
||||
import LandingPage from "../pages/landing/landing.component";
|
||||
import Manage from "../pages/manage/manage.component";
|
||||
|
||||
import PrivateRoute from "../utils/private-route";
|
||||
|
||||
//Todo: Issue with this line. Not sure why.
|
||||
const graphqlEndpoint = process.env.REACT_APP_GRAPHQL_ENDPOINT;
|
||||
|
||||
export default function App({ authState }) {
|
||||
@@ -30,14 +32,16 @@ export default function App({ authState }) {
|
||||
typeDefs
|
||||
});
|
||||
client.writeData({
|
||||
data: initialState
|
||||
data: { ...initialState, authState }
|
||||
});
|
||||
|
||||
return (
|
||||
<ApolloProvider client={client}>
|
||||
<HeaderAppBarContainer />
|
||||
{isIn ? null : <SignIn />}
|
||||
<JobListContainer />
|
||||
<Switch>
|
||||
<Route exact path="/" component={LandingPage} />
|
||||
<Route exact path="/signin" component={SignIn} />
|
||||
<PrivateRoute isAuthorized={isIn} path="/manage" component={Manage} />
|
||||
</Switch>
|
||||
</ApolloProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user