Add React shortcut manager and editor

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-11-13 17:29:08 +08:00
parent cbd2690993
commit e87a455e21
5 changed files with 121 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import React, { useState } from "react";
export function UtilityMenus({ onPreferences }: { onPreferences: () => void }) {
export function UtilityMenus({ onPreferences, onShortcuts }: { onPreferences: () => void; onShortcuts: () => void }) {
const [open, setOpen] = useState("");
return <div className="utility-menus">
<style>{`
@@ -16,6 +16,7 @@ export function UtilityMenus({ onPreferences }: { onPreferences: () => void }) {
onClick={() => setOpen(previous => previous === "Tools" ? "" : "Tools")}>Tools
{open === "Tools" && <div className="dropdown" role="menu" aria-label="Tools">
<button type="button" onClick={() => { setOpen(""); onPreferences(); }}>Preferences…</button>
<button type="button" onClick={() => { setOpen(""); onShortcuts(); }}>Customize shortcuts…</button>
<a href="/help.html" target="_blank" rel="noopener">Help / documentation</a>
<span>Customize / Units calculator: P3</span>
</div>}