From e578c5f3ade565bc179ac2b639fa4d64b7d12a05 Mon Sep 17 00:00:00 2001 From: DDMeaqua Date: Tue, 10 Sep 2024 12:01:51 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/chat.module.scss | 10 +++------- app/components/chat.tsx | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app/components/chat.module.scss b/app/components/chat.module.scss index 5145188ec53..73542fc67f1 100644 --- a/app/components/chat.module.scss +++ b/app/components/chat.module.scss @@ -656,26 +656,22 @@ .shortcut-key-grid { display: grid; - grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 16px; } .shortcut-key-item { display: flex; - flex-direction: column; + justify-content: space-between; + align-items: center; overflow: hidden; - border: var(--border-in-light); - border-radius: 10px; padding: 10px; background-color: var(--white); - box-shadow: var(--card-shadow); - transition: background-color 0.3s ease, box-shadow 0.3s ease; } .shortcut-key-title { font-size: 14px; color: var(--black); - margin-bottom: 8px; } .shortcut-key-keys { diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 085292585fc..a91c8af7e4d 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -830,15 +830,25 @@ export function DeleteImageButton(props: { deleteImage: () => void }) { } export function ShortcutKeyModal(props: { onClose: () => void }) { + const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0; const shortcuts = [ - { title: Locale.Chat.ShortcutKey.newChat, keys: ["⌘", "Shift", "o"] }, + { + title: Locale.Chat.ShortcutKey.newChat, + keys: isMac ? ["⌘", "Shift", "O"] : ["Ctrl", "Shift", "O"], + }, { title: Locale.Chat.ShortcutKey.focusInput, keys: ["Shift", "Esc"] }, - { title: Locale.Chat.ShortcutKey.copyLastCode, keys: ["⌘", "Shift", ";"] }, + { + title: Locale.Chat.ShortcutKey.copyLastCode, + keys: isMac ? ["⌘", "Shift", ";"] : ["Ctrl", "Shift", ";"], + }, { title: Locale.Chat.ShortcutKey.copyLastMessage, - keys: ["⌘", "Shift", "c"], + keys: isMac ? ["⌘", "Shift", "C"] : ["Ctrl", "Shift", "C"], + }, + { + title: Locale.Chat.ShortcutKey.showShortcutKey, + keys: isMac ? ["⌘", "/"] : ["Ctrl", "/"], }, - { title: Locale.Chat.ShortcutKey.showShortcutKey, keys: ["⌘", "/"] }, ]; return (
@@ -1424,7 +1434,7 @@ function _Chat() { setAttachImages(images); } - // 快捷键 + // 快捷键 shortcut keys const [showShortcutKeyModal, setShowShortcutKeyModal] = useState(false); useEffect(() => {