-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
67 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 |
---|---|---|
@@ -1,5 +1,37 @@ | ||
import "./styles.sass"; | ||
import Icon from "@mdi/react"; | ||
import { mdiAccountCircleOutline, mdiClockStarFourPointsOutline } from "@mdi/js"; | ||
import SettingsNavigation from "./components/SettingsNavigation"; | ||
import { Navigate, useLocation } from "react-router-dom"; | ||
import Account from "@/pages/Settings/pages/Account"; | ||
import Sessions from "@/pages/Settings/pages/Sessions"; | ||
|
||
export const Settings = () => { | ||
const location = useLocation(); | ||
|
||
const pages = [ | ||
{ title: "Account", icon: mdiAccountCircleOutline, content: <Account /> }, | ||
{ title: "Sessions", icon: mdiClockStarFourPointsOutline, content: <Sessions /> } | ||
]; | ||
|
||
const currentPage = pages.find(page => location.pathname.endsWith(page.title.toLowerCase())); | ||
|
||
if (!currentPage) return <Navigate to="/settings/account" />; | ||
|
||
return ( | ||
<div className="settings-page"> | ||
<SettingsNavigation pages={pages} /> | ||
<div className="settings-content"> | ||
<div className="settings-header"> | ||
<Icon path={currentPage.icon} /> | ||
<h1>{currentPage.title}</h1> | ||
</div> | ||
<hr/> | ||
|
||
<div className="settings-content-inner"> | ||
{currentPage.content} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
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,35 @@ | ||
@import "@/common/styles/colors" | ||
|
||
.settings-page | ||
display: grid | ||
grid-template-columns: 18rem 1fr | ||
|
||
|
||
.settings-content | ||
padding: 1rem 2rem | ||
|
||
hr | ||
background-color: $gray | ||
width: 100% | ||
height: 3px | ||
border: none | ||
border-radius: 5px | ||
|
||
.settings-content-inner | ||
width: 80% | ||
overflow-x: hidden | ||
overflow-y: scroll | ||
|
||
.settings-header | ||
display: flex | ||
align-items: center | ||
padding-bottom: 0.5rem | ||
gap: 1rem | ||
|
||
svg | ||
width: 2.5rem | ||
height: 2.5rem | ||
|
||
h1 | ||
margin: 0 | ||
font-size: 24pt |