From f9190251598e5a4bdb2abf5b9cc89edbb8c9004a Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 6 Dec 2019 23:42:16 -0800 Subject: [PATCH] Signin methods working with no errors. --- client/src/App/App.js | 9 ++++----- client/src/components/header/header.component.jsx | 12 ++++++------ client/src/components/header/header.container.jsx | 1 + client/src/graphql/client.js | 8 +++++++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/client/src/App/App.js b/client/src/App/App.js index 565448016..7f38a85b6 100644 --- a/client/src/App/App.js +++ b/client/src/App/App.js @@ -1,5 +1,5 @@ import React from "react"; -import { Switch, Route } from "react-router-dom"; +import { Switch, Route, Redirect } from "react-router-dom"; import firebase from "../firebase/firebase.utils"; import "./App.css"; @@ -79,18 +79,17 @@ class App extends React.Component { - {/* this.props.currentUser.email != null ? ( ) : ( - + ) } - /> */} - + /> { +export default ({ landingHeader, selectedNavItem, navItems }) => { const handleClick = e => { console.log("click ", e); // this.setState({ // current: e.key // }); }; - return ( { ))} - - - - + {!landingHeader ? ( + + + + ) : null} ); }; diff --git a/client/src/components/header/header.container.jsx b/client/src/components/header/header.container.jsx index dac8e0608..e0ec170a3 100644 --- a/client/src/components/header/header.container.jsx +++ b/client/src/components/header/header.container.jsx @@ -29,6 +29,7 @@ const HeaderContainer = ({ landingHeader }) => { const parsedNavItems = JSON.parse(data.masterdata_by_pk.value); return (
diff --git a/client/src/graphql/client.js b/client/src/graphql/client.js index 926f92cc1..f95d7b645 100644 --- a/client/src/graphql/client.js +++ b/client/src/graphql/client.js @@ -26,8 +26,14 @@ const authLink = setContext((_, { headers }) => { } }); +const middlewares = []; +if (process.env.NODE_ENV === "development") { + middlewares.push(apolloLogger); +} +middlewares.push(authLink.concat(httpLink)); + export const client = new ApolloClient({ - link: authLink.concat(httpLink), + link: ApolloLink.from(middlewares), cache: new InMemoryCache({ addTypename: false }), typeDefs, resolvers