Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

Commit

Permalink
Move theme settings in the account
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin Guidée <[email protected]>
  • Loading branch information
quentinguidee committed Feb 19, 2024
1 parent 5258e07 commit 1b30f15
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ContainerLogs from "./apps/Containers/pages/ContainerLogs/ContainerLogs";
import ContainerEnv from "./apps/Containers/pages/ContainerEnv/ContainerEnv";
import ContainerHome from "./apps/Containers/pages/ContainerHome/ContainerHome";
import SettingsApp from "./apps/AdminSettings/SettingsApp/SettingsApp";
import SettingsTheme from "./apps/AdminSettings/SettingsTheme/SettingsTheme";
import { Fragment, useContext } from "react";
import { ThemeContext } from "./main";
import classNames from "classnames";
Expand Down Expand Up @@ -49,6 +48,7 @@ import AccountSecurity from "./apps/Auth/pages/Account/AccountSecurity";
import useUser from "./apps/Auth/hooks/useUser";
import AccountEmails from "./apps/Auth/pages/Account/AccountEmails";
import { getAuthToken } from "./backend/server";
import AccountTheme from "./apps/Auth/pages/Account/AccountTheme";

const queryClient = new QueryClient();

Expand Down Expand Up @@ -109,6 +109,10 @@ function AllRoutes() {
path="/account/emails"
element={<AccountEmails />}
/>
<Route
path="/account/theme"
element={<AccountTheme />}
/>
</Route>
<Route
path="/"
Expand Down Expand Up @@ -189,10 +193,6 @@ function AllRoutes() {
/>
</Route>
<Route path="/admin" element={<SettingsApp />}>
<Route
path="/admin/theme"
element={<SettingsTheme />}
/>
<Route
path="/admin/notifications"
element={<SettingsNotifications />}
Expand Down
8 changes: 0 additions & 8 deletions src/apps/AdminSettings/SettingsApp/SettingsApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ import {
Info,
ListChecks,
Notification,
Palette,
} from "@phosphor-icons/react";

export default function SettingsApp() {
useTitle("Settings");

let sidebar = useSidebar(
<Sidebar>
<Sidebar.Group title="Settings">
<Sidebar.Item
label="Theme"
icon={<Palette />}
link={l("/admin/theme")}
/>
</Sidebar.Group>
<Sidebar.Group title="Administration">
<Sidebar.Item
label="Notifications"
Expand Down
8 changes: 8 additions & 0 deletions src/apps/Auth/pages/Account/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import PageWithSidebar from "../../../../components/PageWithSidebar/PageWithSide
import { useSidebar } from "../../../../hooks/useSidebar";
import { MaterialIcon, Sidebar, useTitle } from "@vertex-center/components";
import l from "../../../../components/NavLink/navlink";
import { Palette } from "@phosphor-icons/react";

export default function Account() {
useTitle("My Account");
Expand All @@ -25,6 +26,13 @@ export default function Account() {
link={l("/account/emails")}
/>
</Sidebar.Group>
<Sidebar.Group title="Appearance">
<Sidebar.Item
label="Theme"
icon={<Palette />}
link={l("/account/theme")}
/>
</Sidebar.Group>
</Sidebar>
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useContext } from "react";
import { Button, Title } from "@vertex-center/components";
import { Vertical } from "../../../components/Layouts/Layouts";
import { ThemeContext } from "../../../main";
import { themes } from "../../../models/theme";
import Content from "../../../components/Content/Content";
import { Button, Title, Vertical } from "@vertex-center/components";
import { ThemeContext } from "../../../../main";
import { themes } from "../../../../models/theme";
import Content from "../../../../components/Content/Content";
import { RadioButton } from "@phosphor-icons/react";

export default function SettingsTheme() {
export default function AccountTheme() {
const { theme, setTheme } = useContext(ThemeContext);

return (
Expand Down

0 comments on commit 1b30f15

Please sign in to comment.