Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/web/src/components/settings/SettingsSidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
isActive={isActive}
className={
isActive
? "gap-2 px-2 py-2 text-left text-sm text-foreground"
: "gap-2 px-2 py-2 text-left text-sm text-muted-foreground hover:text-foreground/80"
? "gap-2 px-2 py-2 text-left text-xs text-foreground"
: "gap-2 px-2 py-2 text-left text-xs text-muted-foreground hover:text-foreground/80"
}
onClick={() => void navigate({ to: item.to, replace: true })}
>
Expand All @@ -68,7 +68,7 @@ export function SettingsSidebarNav({ pathname }: { pathname: string }) {
<SidebarMenuItem>
<SidebarMenuButton
size="sm"
className="gap-2 px-2 py-2 text-sm text-muted-foreground hover:bg-accent hover:text-foreground"
className="gap-2 px-2 py-2 text-xs text-muted-foreground hover:bg-accent hover:text-foreground"
onClick={() => window.history.back()}
>
<ArrowLeftIcon className="size-4" />
Expand Down
17 changes: 16 additions & 1 deletion apps/web/src/routes/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RotateCcwIcon } from "lucide-react";
import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
import { useState } from "react";
import { useEffect, useState } from "react";

import { useSettingsRestore } from "../components/settings/SettingsPanels";
import { Button } from "../components/ui/button";
Expand All @@ -13,6 +13,21 @@ function SettingsContentLayout() {
setRestoreSignal((value) => value + 1),
);

useEffect(() => {
const onKeyDown = (event: KeyboardEvent) => {
if (event.defaultPrevented) return;
if (event.key === "Escape") {
event.preventDefault();
window.history.back();
}
};

window.addEventListener("keydown", onKeyDown);
return () => {
window.removeEventListener("keydown", onKeyDown);
};
}, []);

return (
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground isolate">
<div className="flex min-h-0 min-w-0 flex-1 flex-col bg-background text-foreground">
Expand Down