| author | |
| committer | |
| log | c426452239e06417ec8e231b7883f9c2292df63c |
| tree | 34a2fe26c761c070ffc38e0645ee689b73e16319 |
| parent | 73b2f255a9c81f1efaa4133bee581d071abe6841 |
| signature | Signed by PGP key B5690EEEBB952194 |
2 files changed, 19 insertions(+), 4 deletions(-)
apps/web/src/components/settings/SettingsSidebarNav.tsx+3-3| ... | ... | @@ -41,8 +41,8 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) { |
| 41 | 41 | isActive={isActive} |
| 42 | 42 | className={ |
| 43 | 43 | isActive |
| 44 | ? "gap-2 px-2 py-2 text-left text-sm text-foreground" | |
| 45 | : "gap-2 px-2 py-2 text-left text-sm text-muted-foreground hover:text-foreground/80" | |
| 44 | ? "gap-2 px-2 py-2 text-left text-xs text-foreground" | |
| 45 | : "gap-2 px-2 py-2 text-left text-xs text-muted-foreground hover:text-foreground/80" | |
| 46 | 46 | } |
| 47 | 47 | onClick={() => void navigate({ to: item.to, replace: true })} |
| 48 | 48 | > |
| ... | ... | @@ -68,7 +68,7 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) { |
| 68 | 68 | <SidebarMenuItem> |
| 69 | 69 | <SidebarMenuButton |
| 70 | 70 | size="sm" |
| 71 | className="gap-2 px-2 py-2 text-sm text-muted-foreground hover:bg-accent hover:text-foreground" | |
| 71 | className="gap-2 px-2 py-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground" | |
| 72 | 72 | onClick={() => window.history.back()} |
| 73 | 73 | > |
| 74 | 74 | <ArrowLeftIcon className="size-4" /> |
apps/web/src/routes/settings.tsx+16-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | import { RotateCcwIcon } from "lucide-react"; |
| 2 | 2 | import { Outlet, createFileRoute, redirect } from "@tanstack/react-router"; |
| 3 | import { useState } from "react"; | |
| 3 | import { useEffect, useState } from "react"; | |
| 4 | 4 | |
| 5 | 5 | import { useSettingsRestore } from "../components/settings/SettingsPanels"; |
| 6 | 6 | import { Button } from "../components/ui/button"; |
| ... | ... | @@ -13,6 +13,21 @@ function SettingsContentLayout() { |
| 13 | 13 | setRestoreSignal((value) => value + 1), |
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | useEffect(() => { | |
| 17 | const onKeyDown = (event: KeyboardEvent) => { | |
| 18 | if (event.defaultPrevented) return; | |
| 19 | if (event.key === "Escape") { | |
| 20 | event.preventDefault(); | |
| 21 | window.history.back(); | |
| 22 | } | |
| 23 | }; | |
| 24 | ||
| 25 | window.addEventListener("keydown", onKeyDown); | |
| 26 | return () => { | |
| 27 | window.removeEventListener("keydown", onKeyDown); | |
| 28 | }; | |
| 29 | }, []); | |
| 30 | ||
| 16 | 31 | return ( |
| 17 | 32 | <SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate"> |
| 18 | 33 | <div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground"> |