chore: 样式更新

This commit is contained in:
DDMeaqua 2024-09-10 12:01:51 +08:00
parent 61245e3d7e
commit e578c5f3ad
2 changed files with 18 additions and 12 deletions

View File

@ -656,26 +656,22 @@
.shortcut-key-grid { .shortcut-key-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 16px; gap: 16px;
} }
.shortcut-key-item { .shortcut-key-item {
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
align-items: center;
overflow: hidden; overflow: hidden;
border: var(--border-in-light);
border-radius: 10px;
padding: 10px; padding: 10px;
background-color: var(--white); background-color: var(--white);
box-shadow: var(--card-shadow);
transition: background-color 0.3s ease, box-shadow 0.3s ease;
} }
.shortcut-key-title { .shortcut-key-title {
font-size: 14px; font-size: 14px;
color: var(--black); color: var(--black);
margin-bottom: 8px;
} }
.shortcut-key-keys { .shortcut-key-keys {

View File

@ -830,15 +830,25 @@ export function DeleteImageButton(props: { deleteImage: () => void }) {
} }
export function ShortcutKeyModal(props: { onClose: () => void }) { export function ShortcutKeyModal(props: { onClose: () => void }) {
const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0;
const shortcuts = [ 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.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, 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 ( return (
<div className="modal-mask"> <div className="modal-mask">
@ -1424,7 +1434,7 @@ function _Chat() {
setAttachImages(images); setAttachImages(images);
} }
// 快捷键 // 快捷键 shortcut keys
const [showShortcutKeyModal, setShowShortcutKeyModal] = useState(false); const [showShortcutKeyModal, setShowShortcutKeyModal] = useState(false);
useEffect(() => { useEffect(() => {