From 2e0a65083c889760e709787a1cb92deacafba6e1 Mon Sep 17 00:00:00 2001 From: Presley Date: Wed, 13 Apr 2022 20:55:28 +0000 Subject: [PATCH 1/3] Add Footer to AuthAndNav, rename --- site/src/AppRouter.tsx | 27 ++++++++++--------- .../components/AuthAndFrame/AuthAndFrame.tsx | 21 +++++++++++++++ site/src/components/Page/AuthAndNav.tsx | 12 --------- site/src/components/Page/index.tsx | 1 - 4 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 site/src/components/AuthAndFrame/AuthAndFrame.tsx delete mode 100644 site/src/components/Page/AuthAndNav.tsx diff --git a/site/src/AppRouter.tsx b/site/src/AppRouter.tsx index b15e06fb710e0..d80ce62ff8c3d 100644 --- a/site/src/AppRouter.tsx +++ b/site/src/AppRouter.tsx @@ -1,6 +1,7 @@ import React from "react" import { Route, Routes } from "react-router-dom" -import { AuthAndNav, RequireAuth } from "./components" +import { RequireAuth } from "./components" +import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame" import { PreferencesLayout } from "./components/Preferences/Layout" import { IndexPage } from "./pages" import { NotFoundPage } from "./pages/404" @@ -39,18 +40,18 @@ export const AppRouter: React.FC = () => ( + - + } /> + - + } /> ( + - + } /> @@ -78,25 +79,25 @@ export const AppRouter: React.FC = () => ( + - + } /> + - + } /> + - + } /> diff --git a/site/src/components/AuthAndFrame/AuthAndFrame.tsx b/site/src/components/AuthAndFrame/AuthAndFrame.tsx new file mode 100644 index 0000000000000..d7e61e4d6422e --- /dev/null +++ b/site/src/components/AuthAndFrame/AuthAndFrame.tsx @@ -0,0 +1,21 @@ +import React from "react" +import { Navbar } from "../Navbar" +import { Footer } from "../Page/Footer" +import { RequireAuth } from "../Page/RequireAuth" + +interface AuthAndFrameProps { + children: JSX.Element +} + +/** + * Wraps page in RequireAuth and renders it between Navbar and Footer + */ +export const AuthAndFrame: React.FC = ({ children }) => ( + + <> + + {children} +