fix: 'Alt' should be displayed as '⌥' on Mac
This commit is contained in:
@@ -4,7 +4,7 @@ import styled from "styled-components";
|
|||||||
import Flex from "~/components/Flex";
|
import Flex from "~/components/Flex";
|
||||||
import InputSearch from "~/components/InputSearch";
|
import InputSearch from "~/components/InputSearch";
|
||||||
import Key from "~/components/Key";
|
import Key from "~/components/Key";
|
||||||
import { metaDisplay } from "~/utils/keyboard";
|
import { metaDisplay, altDisplay } from "~/utils/keyboard";
|
||||||
|
|
||||||
function KeyboardShortcuts() {
|
function KeyboardShortcuts() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -44,7 +44,7 @@ function KeyboardShortcuts() {
|
|||||||
{
|
{
|
||||||
shortcut: (
|
shortcut: (
|
||||||
<>
|
<>
|
||||||
<Key>Ctrl</Key> + <Key>Alt</Key> + <Key>h</Key>
|
<Key>Ctrl</Key> + <Key>{altDisplay}</Key> + <Key>h</Key>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
label: t("Table of contents"),
|
label: t("Table of contents"),
|
||||||
@@ -246,7 +246,7 @@ function KeyboardShortcuts() {
|
|||||||
{
|
{
|
||||||
shortcut: (
|
shortcut: (
|
||||||
<>
|
<>
|
||||||
<Key>Alt</Key> + <Key>↑</Key>
|
<Key>{altDisplay}</Key> + <Key>↑</Key>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
label: t("Move list item up"),
|
label: t("Move list item up"),
|
||||||
@@ -254,7 +254,7 @@ function KeyboardShortcuts() {
|
|||||||
{
|
{
|
||||||
shortcut: (
|
shortcut: (
|
||||||
<>
|
<>
|
||||||
<Key>Alt</Key> + <Key>↓</Key>
|
<Key>{altDisplay}</Key> + <Key>↓</Key>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
label: t("Move list item down"),
|
label: t("Move list item down"),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { isMac } from "~/utils/browser";
|
import { isMac } from "~/utils/browser";
|
||||||
|
|
||||||
|
export const altDisplay = isMac() ? "⌥" : "Alt";
|
||||||
|
|
||||||
export const metaDisplay = isMac() ? "⌘" : "Ctrl";
|
export const metaDisplay = isMac() ? "⌘" : "Ctrl";
|
||||||
|
|
||||||
export const meta = isMac() ? "cmd" : "ctrl";
|
export const meta = isMac() ? "cmd" : "ctrl";
|
||||||
|
|||||||
Reference in New Issue
Block a user