From 76f8ff9f21bfc9bc081047ab7c528c5e2ed1a91d Mon Sep 17 00:00:00 2001 From: Presley Pizzo <1290996+presleyp@users.noreply.github.com> Date: Thu, 14 Apr 2022 13:58:53 -0400 Subject: [PATCH] feat: Add Footer to every page with nav (#1009) * Add Footer to AuthAndNav, rename * Fix in preferences layout * Remove double footer --- site/src/AppRouter.tsx | 27 ++++++++++--------- .../components/AuthAndFrame/AuthAndFrame.tsx | 21 +++++++++++++++ site/src/components/Page/AuthAndNav.tsx | 12 --------- site/src/components/Page/index.tsx | 1 - site/src/components/Preferences/Layout.tsx | 6 ++--- .../[organization]/[template]/index.tsx | 2 -- site/src/pages/templates/index.tsx | 2 -- site/src/pages/workspaces/[workspace].tsx | 3 --- 8 files changed, 38 insertions(+), 36 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 79d3d1b580..fb1ab167e0 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 0000000000..d7e61e4d64 --- /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} +