11import React , { lazy , Suspense } from 'react'
2- import { Route , Switch } from 'react-router-dom'
2+ import { Switch } from 'react-router-dom'
33import { useLingui } from '@lingui/react'
44import { LandingPage } from './LandingPage'
55import { Main } from './Main'
@@ -15,7 +15,8 @@ import { useUserState } from './UserState'
1515import { ErrorBoundary } from 'react-error-boundary'
1616import { ErrorFallbackMessage } from './ErrorFallbackMessage'
1717import { FloatingMenu } from './FloatingMenu'
18- import PrivateRoute from './PrivateRoute'
18+ import PrivatePage from './PrivatePage'
19+ import { Page } from './Page'
1920
2021const PageNotFound = lazy ( ( ) => import ( './PageNotFound' ) )
2122const CreateUserPage = lazy ( ( ) => import ( './CreateUserPage' ) )
@@ -119,74 +120,91 @@ export default function App() {
119120 < Main >
120121 < Suspense fallback = { < div > Loading...</ div > } >
121122 < Switch >
122- < Route exact path = "/" >
123+ < Page exact path = "/" title = { t `Home` } >
123124 < LandingPage />
124- </ Route >
125+ </ Page >
125126
126- < Route path = "/create-user/:userOrgToken?" >
127+ < Page
128+ path = "/create-user/:userOrgToken?"
129+ title = { t `Create an Account` }
130+ >
127131 < CreateUserPage />
128- </ Route >
132+ </ Page >
129133
130- < Route path = "/sign-in" component = { SignInPage } />
134+ < Page path = "/sign-in" component = { SignInPage } title = { t `Sign In` } />
131135
132- < Route
136+ < Page
133137 path = "/authenticate/:sendMethod/:authenticateToken"
134138 component = { TwoFactorAuthenticatePage }
139+ title = { t `Authenticate` }
135140 />
136141
137- < Route path = "/forgot-password" component = { ForgotPasswordPage } />
142+ < Page
143+ path = "/forgot-password"
144+ component = { ForgotPasswordPage }
145+ title = { t `Forgot Password` }
146+ />
138147
139- < Route
148+ < Page
140149 path = "/reset-password/:resetToken"
141150 component = { ResetPasswordPage }
151+ title = { t `Reset Password` }
142152 />
143153
144- < PrivateRoute path = "/organizations" exact >
154+ < PrivatePage path = "/organizations" title = { t `Organizations` } exact >
145155 < Organizations />
146- </ PrivateRoute >
156+ </ PrivatePage >
147157
148- < PrivateRoute path = "/organizations/:orgSlug" exact >
158+ < PrivatePage
159+ path = "/organizations/:orgSlug"
160+ setTitle = { false }
161+ exact
162+ >
149163 < OrganizationDetails />
150- </ PrivateRoute >
164+ </ PrivatePage >
151165
152- < PrivateRoute path = "/admin" >
166+ < PrivatePage path = "/admin" title = { t `Admin` } >
153167 < ErrorBoundary FallbackComponent = { ErrorFallbackMessage } >
154168 < AdminPage />
155169 </ ErrorBoundary >
156- </ PrivateRoute >
170+ </ PrivatePage >
157171
158- < PrivateRoute path = "/domains" exact >
172+ < PrivatePage path = "/domains" title = { t `Domains` } exact >
159173 < DomainsPage />
160- </ PrivateRoute >
174+ </ PrivatePage >
161175
162- < PrivateRoute path = "/domains/:domainSlug" exact >
176+ < PrivatePage path = "/domains/:domainSlug" setTitle = { false } exact >
163177 < DmarcGuidancePage />
164- </ PrivateRoute >
178+ </ PrivatePage >
165179
166- < PrivateRoute
180+ < PrivatePage
167181 path = "/domains/:domainSlug/dmarc-report/:period?/:year?"
182+ setTitle = { false }
168183 exact
169184 >
170185 < DmarcReportPage />
171- </ PrivateRoute >
186+ </ PrivatePage >
172187
173- < PrivateRoute path = "/dmarc-summaries" exact >
188+ < PrivatePage
189+ path = "/dmarc-summaries"
190+ title = { t `DMARC Report` }
191+ exact
192+ >
174193 < DmarcByDomainPage />
175- </ PrivateRoute >
194+ </ PrivatePage >
176195
177- < PrivateRoute path = "/user" >
196+ < PrivatePage path = "/user" title = { t `Your Account` } >
178197 < UserPage username = { currentUser . userName } />
179- </ PrivateRoute >
198+ </ PrivatePage >
180199
181- < PrivateRoute path = "/two-factor-code" >
200+ < PrivatePage
201+ path = "/two-factor-code"
202+ title = { t `Authentication QR Code` }
203+ >
182204 < QRcodePage userName = { currentUser . userName } />
183- </ PrivateRoute >
184-
185- < PrivateRoute path = "/dmarc-report/:period?/:year?" >
186- < DmarcReportPage />
187- </ PrivateRoute >
205+ </ PrivatePage >
188206
189- < Route component = { PageNotFound } />
207+ < Page component = { PageNotFound } title = "404" />
190208 </ Switch >
191209 </ Suspense >
192210 </ Main >
@@ -215,7 +233,7 @@ export default function App() {
215233 </ Link >
216234 < Link
217235 ml = { 4 }
218- href = { " https://github.com/canada-ca/tracker/issues" }
236+ href = { ' https://github.com/canada-ca/tracker/issues' }
219237 isExternal = { true }
220238 >
221239 < Trans > Report an Issue</ Trans >
0 commit comments