File tree Expand file tree Collapse file tree 4 files changed +35
-26
lines changed Expand file tree Collapse file tree 4 files changed +35
-26
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"
You can’t perform that action at this time.
0 commit comments