From 552fe6233004e4ab98f2bd4ce1a2673484c480d1 Mon Sep 17 00:00:00 2001 From: Ruidy Nemausat Date: Thu, 5 Mar 2020 16:12:46 +0100 Subject: [PATCH] added navbar to layout --- .gitignore | 2 ++ client/src/App.tsx | 13 ++++++++++++- client/src/index.jsx | 29 +++++++++++++++++++++++++++++ client/src/pages/Layout.tsx | 7 +++++-- 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 client/src/index.jsx diff --git a/.gitignore b/.gitignore index f64aa1b..0b93d06 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ client/.env.production.local client/npm-debug.log* client/yarn-debug.log* client/yarn-error.log* + +client/src/authentication/config.json diff --git a/client/src/App.tsx b/client/src/App.tsx index 88220e3..f71b386 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,8 +1,19 @@ import React, { FC } from "react"; import Layout from "./pages/Layout"; +import { useAuth0 } from "./authentication/auth0"; const App: FC = () => { - return ; + const { loading } = useAuth0(); + + if (loading) { + return
Loading...
; + } + + return ( +
+ +
+ ); }; export default App; diff --git a/client/src/index.jsx b/client/src/index.jsx new file mode 100644 index 0000000..6668661 --- /dev/null +++ b/client/src/index.jsx @@ -0,0 +1,29 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import App from "./App"; +import * as serviceWorker from "./serviceWorker"; +import { Auth0Provider } from "./authentication/auth0"; +import config from "./authentication/config.json"; +import history from "./utils/history"; + +const onRedirectCallback = appState => { + history.push( + appState && appState.targetUrl + ? appState.targetUrl + : window.location.pathname + ); +}; + +ReactDOM.render( + + + , + document.getElementById("root") +); + +serviceWorker.unregister(); diff --git a/client/src/pages/Layout.tsx b/client/src/pages/Layout.tsx index 7cc1b3f..cf9a792 100644 --- a/client/src/pages/Layout.tsx +++ b/client/src/pages/Layout.tsx @@ -1,11 +1,14 @@ import React, { FC } from "react"; import { AppRouter } from "../utils/router"; +import { NavBar } from "../components/Navbar"; const Layout: FC = () => { return ( <> - {/* - */} +
+ +
+ {/* */} {/*