This repository has been archived by the owner on Dec 14, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add settings dashboard component
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
- Loading branch information
1 parent
de985b4
commit 020f758
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from "react"; | ||
import i18next from "i18next"; | ||
import { Switch, Route } from "react-router-dom"; | ||
import { Container, Box } from "@material-ui/core"; | ||
import useRoutes from "../hooks/useRoutes"; | ||
import AppBar from "../AppBar"; | ||
import ContentLayoutTwoColumn from "../ContentLayoutTwoColumn"; | ||
import SettingsMenu from "../SettingsMenu"; | ||
|
||
/** | ||
* @name SettingsDashboard | ||
* @returns {React.component} a functional React component | ||
*/ | ||
export default function SettingsDashboard() { | ||
const settingsRoutes = useRoutes({ groups: ["settings"] }); | ||
return ( | ||
<ContentLayoutTwoColumn | ||
AppBarComponent={ | ||
<AppBar title={i18next.t("admin.settings.settingsLabel")} /> | ||
} | ||
PrimaryComponent={ | ||
<Box paddingX={4}> | ||
<SettingsMenu /> | ||
</Box> | ||
} | ||
DetailComponent={ | ||
<Container maxWidth="md"> | ||
<Switch> | ||
{ | ||
settingsRoutes.map((settingRoute) => ( | ||
<Route | ||
key={settingRoute.path} | ||
component={settingRoute.MainComponent} | ||
path={settingRoute.path} | ||
/> | ||
)) | ||
} | ||
</Switch> | ||
</Container> | ||
} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./SettingsDashboard"; |