Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
feat: add settings dashboard component
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
  • Loading branch information
mikemurray committed Apr 7, 2020
1 parent de985b4 commit 020f758
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions package/src/SettingsDashboard/SettingsDashboard.js
@@ -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>
}
/>
);
}
1 change: 1 addition & 0 deletions package/src/SettingsDashboard/index.js
@@ -0,0 +1 @@
export { default } from "./SettingsDashboard";

0 comments on commit 020f758

Please sign in to comment.