mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-06 00:36:39 +00:00
added navbar to layout
This commit is contained in:
parent
1804f22098
commit
552fe62330
4 changed files with 48 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,8 +1,19 @@
|
|||
import React, { FC } from "react";
|
||||
import Layout from "./pages/Layout";
|
||||
import { useAuth0 } from "./authentication/auth0";
|
||||
|
||||
const App: FC = () => {
|
||||
return <Layout />;
|
||||
const { loading } = useAuth0();
|
||||
|
||||
if (loading) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<Layout />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
|
|
|||
29
client/src/index.jsx
Normal file
29
client/src/index.jsx
Normal file
|
|
@ -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(
|
||||
<Auth0Provider
|
||||
domain={config.domain}
|
||||
client_id={config.clientId}
|
||||
redirect_uri={window.location.origin}
|
||||
onRedirectCallback={onRedirectCallback}
|
||||
>
|
||||
<App />
|
||||
</Auth0Provider>,
|
||||
document.getElementById("root")
|
||||
);
|
||||
|
||||
serviceWorker.unregister();
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
import React, { FC } from "react";
|
||||
import { AppRouter } from "../utils/router";
|
||||
import { NavBar } from "../components/Navbar";
|
||||
|
||||
const Layout: FC = () => {
|
||||
return (
|
||||
<>
|
||||
{/* <NavBar />
|
||||
<BreadCrumb /> */}
|
||||
<header>
|
||||
<NavBar />
|
||||
</header>
|
||||
{/* <BreadCrumb /> */}
|
||||
<AppRouter />
|
||||
{/* <Footer /> */}
|
||||
</>
|
||||
|
|
|
|||
Loading…
Reference in a new issue