File tree 8 files changed +38
-36
lines changed
[organization]/[template]
8 files changed +38
-36
lines changed Original file line number Diff line number Diff line change 1
1
import React from "react"
2
2
import { Route , Routes } from "react-router-dom"
3
- import { AuthAndNav , RequireAuth } from "./components"
3
+ import { RequireAuth } from "./components"
4
+ import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame"
4
5
import { PreferencesLayout } from "./components/Preferences/Layout"
5
6
import { IndexPage } from "./pages"
6
7
import { NotFoundPage } from "./pages/404"
@@ -39,18 +40,18 @@ export const AppRouter: React.FC = () => (
39
40
< Route
40
41
index
41
42
element = {
42
- < AuthAndNav >
43
+ < AuthAndFrame >
43
44
< TemplatesPage />
44
- </ AuthAndNav >
45
+ </ AuthAndFrame >
45
46
}
46
47
/>
47
48
< Route path = ":organization/:template" >
48
49
< Route
49
50
index
50
51
element = {
51
- < AuthAndNav >
52
+ < AuthAndFrame >
52
53
< TemplatePage />
53
- </ AuthAndNav >
54
+ </ AuthAndFrame >
54
55
}
55
56
/>
56
57
< Route
@@ -68,35 +69,35 @@ export const AppRouter: React.FC = () => (
68
69
< Route
69
70
path = ":workspace"
70
71
element = {
71
- < AuthAndNav >
72
+ < AuthAndFrame >
72
73
< WorkspacePage />
73
- </ AuthAndNav >
74
+ </ AuthAndFrame >
74
75
}
75
76
/>
76
77
</ Route >
77
78
78
79
< Route
79
80
path = "users"
80
81
element = {
81
- < AuthAndNav >
82
+ < AuthAndFrame >
82
83
< UsersPage />
83
- </ AuthAndNav >
84
+ </ AuthAndFrame >
84
85
}
85
86
/>
86
87
< Route
87
88
path = "orgs"
88
89
element = {
89
- < AuthAndNav >
90
+ < AuthAndFrame >
90
91
< OrganizationsPage />
91
- </ AuthAndNav >
92
+ </ AuthAndFrame >
92
93
}
93
94
/>
94
95
< Route
95
96
path = "settings"
96
97
element = {
97
- < AuthAndNav >
98
+ < AuthAndFrame >
98
99
< SettingsPage />
99
- </ AuthAndNav >
100
+ </ AuthAndFrame >
100
101
}
101
102
/>
102
103
Original file line number Diff line number Diff line change
1
+ import React from "react"
2
+ import { Navbar } from "../Navbar"
3
+ import { Footer } from "../Page/Footer"
4
+ import { RequireAuth } from "../Page/RequireAuth"
5
+
6
+ interface AuthAndFrameProps {
7
+ children : JSX . Element
8
+ }
9
+
10
+ /**
11
+ * Wraps page in RequireAuth and renders it between Navbar and Footer
12
+ */
13
+ export const AuthAndFrame : React . FC < AuthAndFrameProps > = ( { children } ) => (
14
+ < RequireAuth >
15
+ < >
16
+ < Navbar />
17
+ { children }
18
+ < Footer />
19
+ </ >
20
+ </ RequireAuth >
21
+ )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- export * from "./AuthAndNav"
2
1
export * from "./Footer"
3
2
export * from "./RequireAuth"
Original file line number Diff line number Diff line change 1
1
import Box from "@material-ui/core/Box"
2
2
import React from "react"
3
3
import { Outlet } from "react-router-dom"
4
- import { AuthAndNav } from "../Page "
4
+ import { AuthAndFrame } from "../AuthAndFrame/AuthAndFrame "
5
5
import { TabPanel } from "../TabPanel"
6
6
7
7
export const Language = {
@@ -21,14 +21,14 @@ const menuItems = [
21
21
22
22
export const PreferencesLayout : React . FC = ( ) => {
23
23
return (
24
- < AuthAndNav >
24
+ < AuthAndFrame >
25
25
< Box display = "flex" flexDirection = "column" >
26
26
< Box style = { { maxWidth : "1380px" , margin : "1em auto" } } >
27
27
< TabPanel title = { Language . preferencesLabel } menuItems = { menuItems } >
28
28
< Outlet />
29
29
</ TabPanel >
30
30
</ Box >
31
31
</ Box >
32
- </ AuthAndNav >
32
+ </ AuthAndFrame >
33
33
)
34
34
}
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import { EmptyState } from "../../../../components/EmptyState"
8
8
import { ErrorSummary } from "../../../../components/ErrorSummary"
9
9
import { Header } from "../../../../components/Header"
10
10
import { FullScreenLoader } from "../../../../components/Loader/FullScreenLoader"
11
- import { Footer } from "../../../../components/Page"
12
11
import { Column , Table } from "../../../../components/Table"
13
12
import { unsafeSWRArgument } from "../../../../util"
14
13
import { firstOrItem } from "../../../../util/array"
@@ -98,7 +97,6 @@ export const TemplatePage: React.FC = () => {
98
97
< Paper style = { { maxWidth : "1380px" , margin : "1em auto" , width : "100%" } } >
99
98
< Table { ...tableProps } />
100
99
</ Paper >
101
- < Footer />
102
100
</ div >
103
101
)
104
102
}
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import { CodeExample } from "../../components/CodeExample/CodeExample"
9
9
import { ErrorSummary } from "../../components/ErrorSummary"
10
10
import { Header } from "../../components/Header"
11
11
import { FullScreenLoader } from "../../components/Loader/FullScreenLoader"
12
- import { Footer } from "../../components/Page"
13
12
import { Column , Table } from "../../components/Table"
14
13
15
14
export const TemplatesPage : React . FC = ( ) => {
@@ -74,7 +73,6 @@ export const TemplatesPage: React.FC = () => {
74
73
< Paper style = { { maxWidth : "1380px" , margin : "1em auto" , width : "100%" } } >
75
74
< Table { ...tableProps } />
76
75
</ Paper >
77
- < Footer />
78
76
</ div >
79
77
)
80
78
}
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import useSWR from "swr"
5
5
import * as Types from "../../api/types"
6
6
import { ErrorSummary } from "../../components/ErrorSummary"
7
7
import { FullScreenLoader } from "../../components/Loader/FullScreenLoader"
8
- import { Footer } from "../../components/Page"
9
8
import { Workspace } from "../../components/Workspace"
10
9
import { unsafeSWRArgument } from "../../util"
11
10
import { firstOrItem } from "../../util/array"
@@ -50,8 +49,6 @@ export const WorkspacePage: React.FC = () => {
50
49
< div className = { styles . inner } >
51
50
< Workspace organization = { organization } template = { template } workspace = { workspace } />
52
51
</ div >
53
-
54
- < Footer />
55
52
</ div >
56
53
)
57
54
}
You can’t perform that action at this time.
0 commit comments