Add admin guard to settings route, conditionally render config option

This commit is contained in:
Alex Holliday
2024-08-30 10:09:38 -07:00
parent eedf2879ee
commit 0a11de47d7
2 changed files with 38 additions and 31 deletions
+2 -1
View File
@@ -39,6 +39,7 @@ function App() {
const DetailsWithAdminProp = withAdminProp(Details);
const PageSpeedWithAdminProp = withAdminProp(PageSpeed);
const MaintenanceWithAdminProp = withAdminProp(Maintenance);
const SettingsWithAdminProp = withAdminProp(Settings);
const mode = useSelector((state) => state.ui.mode);
@@ -90,7 +91,7 @@ function App() {
/>
<Route
path="settings"
element={<ProtectedRoute Component={Settings} />}
element={<ProtectedRoute Component={SettingsWithAdminProp} />}
/>
<Route
path="account/profile"