1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-25 22:09:36 +02:00
flame/client/src/components/Settings/Settings.tsx

62 lines
1.9 KiB
TypeScript
Raw Normal View History

2021-10-04 17:07:02 +02:00
//
import { NavLink, Link, Switch, Route } from 'react-router-dom';
2021-05-07 18:30:06 +02:00
2021-10-04 17:07:02 +02:00
// Typescript
import { Route as SettingsRoute } from '../../interfaces';
2021-05-09 19:02:50 +02:00
2021-10-04 17:07:02 +02:00
// CSS
import classes from './Settings.module.css';
2021-10-04 17:07:02 +02:00
// Components
2021-05-07 18:30:06 +02:00
import Themer from '../Themer/Themer';
import WeatherSettings from './WeatherSettings/WeatherSettings';
import OtherSettings from './OtherSettings/OtherSettings';
import AppDetails from './AppDetails/AppDetails';
import StyleSettings from './StyleSettings/StyleSettings';
2021-10-04 17:07:02 +02:00
import SearchSettings from './SearchSettings/SearchSettings';
// UI
import { Container } from '../UI/Layout/Layout';
import Headline from '../UI/Headlines/Headline/Headline';
// Data
import { routes } from './settings.json';
2021-05-07 18:30:06 +02:00
const Settings = (): JSX.Element => {
2021-05-07 18:30:06 +02:00
return (
2021-05-09 19:02:50 +02:00
<Container>
2021-10-04 17:07:02 +02:00
<Headline title="Settings" subtitle={<Link to="/">Go back</Link>} />
2021-05-09 19:02:50 +02:00
<div className={classes.Settings}>
2021-10-04 17:07:02 +02:00
{/* NAVIGATION MENU */}
2021-05-09 19:02:50 +02:00
<nav className={classes.SettingsNav}>
2021-10-04 17:07:02 +02:00
{routes.map(({ name, dest }: SettingsRoute, idx) => (
<NavLink
className={classes.SettingsNavLink}
activeClassName={classes.SettingsNavLinkActive}
exact
to={dest}
key={idx}
>
{name}
</NavLink>
))}
2021-05-09 19:02:50 +02:00
</nav>
2021-10-04 17:07:02 +02:00
{/* ROUTES */}
2021-05-09 19:02:50 +02:00
<section className={classes.SettingsContent}>
<Switch>
2021-10-04 17:07:02 +02:00
<Route exact path="/settings" component={Themer} />
<Route path="/settings/weather" component={WeatherSettings} />
<Route path="/settings/search" component={SearchSettings} />
<Route path="/settings/other" component={OtherSettings} />
<Route path="/settings/css" component={StyleSettings} />
<Route path="/settings/app" component={AppDetails} />
2021-05-09 19:02:50 +02:00
</Switch>
</section>
</div>
</Container>
2021-10-04 17:07:02 +02:00
);
};
2021-05-07 18:30:06 +02:00
2021-10-04 17:07:02 +02:00
export default Settings;