feat: Add Footer to every page with nav (#1009)

* Add Footer to AuthAndNav, rename

* Fix in preferences layout

* Remove double footer
This commit is contained in:
Presley Pizzo
2022-04-14 13:58:53 -04:00
committed by GitHub
parent 82275a81c7
commit 76f8ff9f21
8 changed files with 38 additions and 36 deletions
@@ -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<AuthAndFrameProps> = ({ children }) => (
<RequireAuth>
<>
<Navbar />
{children}
<Footer />
</>
</RequireAuth>
)
-12
View File
@@ -1,12 +0,0 @@
import React from "react"
import { Navbar } from "../Navbar"
import { RequireAuth, RequireAuthProps } from "./RequireAuth"
export const AuthAndNav: React.FC<RequireAuthProps> = ({ children }) => (
<RequireAuth>
<>
<Navbar />
{children}
</>
</RequireAuth>
)
-1
View File
@@ -1,3 +1,2 @@
export * from "./AuthAndNav"
export * from "./Footer"
export * from "./RequireAuth"
+3 -3
View File
@@ -1,7 +1,7 @@
import Box from "@material-ui/core/Box"
import React from "react"
import { Outlet } from "react-router-dom"
import { AuthAndNav } from "../Page"
import { AuthAndFrame } from "../AuthAndFrame/AuthAndFrame"
import { TabPanel } from "../TabPanel"
export const Language = {
@@ -21,7 +21,7 @@ const menuItems = [
export const PreferencesLayout: React.FC = () => {
return (
<AuthAndNav>
<AuthAndFrame>
<Box display="flex" flexDirection="column">
<Box style={{ maxWidth: "1380px", margin: "1em auto" }}>
<TabPanel title={Language.preferencesLabel} menuItems={menuItems}>
@@ -29,6 +29,6 @@ export const PreferencesLayout: React.FC = () => {
</TabPanel>
</Box>
</Box>
</AuthAndNav>
</AuthAndFrame>
)
}