Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add Footer to every page with nav#1009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
presleyp merged 3 commits intomainfromfooter/presleyp/977
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletionssite/src/AppRouter.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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"
Expand DownExpand Up@@ -39,18 +40,18 @@ export const AppRouter: React.FC = () => (
<Route
index
element={
<AuthAndNav>
<AuthAndFrame>
<TemplatesPage />
</AuthAndNav>
</AuthAndFrame>
}
/>
<Route path=":organization/:template">
<Route
index
element={
<AuthAndNav>
<AuthAndFrame>
<TemplatePage />
</AuthAndNav>
</AuthAndFrame>
}
/>
<Route
Expand All@@ -68,35 +69,35 @@ export const AppRouter: React.FC = () => (
<Route
path=":workspace"
element={
<AuthAndNav>
<AuthAndFrame>
<WorkspacePage />
</AuthAndNav>
</AuthAndFrame>
}
/>
</Route>

<Route
path="users"
element={
<AuthAndNav>
<AuthAndFrame>
<UsersPage />
</AuthAndNav>
</AuthAndFrame>
}
/>
<Route
path="orgs"
element={
<AuthAndNav>
<AuthAndFrame>
<OrganizationsPage />
</AuthAndNav>
</AuthAndFrame>
}
/>
<Route
path="settings"
element={
<AuthAndNav>
<AuthAndFrame>
<SettingsPage />
</AuthAndNav>
</AuthAndFrame>
}
/>

Expand Down
21 changes: 21 additions & 0 deletionssite/src/components/AuthAndFrame/AuthAndFrame.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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 changes: 0 additions & 12 deletionssite/src/components/Page/AuthAndNav.tsx
View file
Open in desktop

This file was deleted.

1 change: 0 additions & 1 deletionsite/src/components/Page/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
export*from"./AuthAndNav"
export*from"./Footer"
export*from"./RequireAuth"
6 changes: 3 additions & 3 deletionssite/src/components/Preferences/Layout.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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 = {
Expand All@@ -21,14 +21,14 @@ 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}>
<Outlet />
</TabPanel>
</Box>
</Box>
</AuthAndNav>
</AuthAndFrame>
)
}
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,6 @@ import { EmptyState } from "../../../../components/EmptyState"
import{ErrorSummary}from"../../../../components/ErrorSummary"
import{Header}from"../../../../components/Header"
import{FullScreenLoader}from"../../../../components/Loader/FullScreenLoader"
import{Footer}from"../../../../components/Page"
import{Column,Table}from"../../../../components/Table"
import{unsafeSWRArgument}from"../../../../util"
import{firstOrItem}from"../../../../util/array"
Expand DownExpand Up@@ -98,7 +97,6 @@ export const TemplatePage: React.FC = () => {
<Paperstyle={{maxWidth:"1380px",margin:"1em auto",width:"100%"}}>
<Table{...tableProps}/>
</Paper>
<Footer/>
</div>
)
}
Expand Down
2 changes: 0 additions & 2 deletionssite/src/pages/templates/index.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,6 @@ import { CodeExample } from "../../components/CodeExample/CodeExample"
import { ErrorSummary } from "../../components/ErrorSummary"
import { Header } from "../../components/Header"
import { FullScreenLoader } from "../../components/Loader/FullScreenLoader"
import { Footer } from "../../components/Page"
import { Column, Table } from "../../components/Table"

export const TemplatesPage: React.FC = () => {
Expand DownExpand Up@@ -74,7 +73,6 @@ export const TemplatesPage: React.FC = () => {
<Paper style={{ maxWidth: "1380px", margin: "1em auto", width: "100%" }}>
<Table {...tableProps} />
</Paper>
<Footer />
</div>
)
}
Expand Down
3 changes: 0 additions & 3 deletionssite/src/pages/workspaces/[workspace].tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@ import useSWR from "swr"
import * as Types from "../../api/types"
import { ErrorSummary } from "../../components/ErrorSummary"
import { FullScreenLoader } from "../../components/Loader/FullScreenLoader"
import { Footer } from "../../components/Page"
import { Workspace } from "../../components/Workspace"
import { unsafeSWRArgument } from "../../util"
import { firstOrItem } from "../../util/array"
Expand DownExpand Up@@ -50,8 +49,6 @@ export const WorkspacePage: React.FC = () => {
<div className={styles.inner}>
<Workspace organization={organization} template={template} workspace={workspace} />
</div>

<Footer />
</div>
)
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp