fix: 'Alt' should be displayed as '⌥' on Mac

This commit is contained in:
Tom Moor
2022-02-12 09:16:17 -08:00
parent 0c716bf974
commit 289f01970f
2 changed files with 6 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ import styled from "styled-components";
import Flex from "~/components/Flex";
import InputSearch from "~/components/InputSearch";
import Key from "~/components/Key";
import { metaDisplay } from "~/utils/keyboard";
import { metaDisplay, altDisplay } from "~/utils/keyboard";
function KeyboardShortcuts() {
const { t } = useTranslation();
@@ -44,7 +44,7 @@ function KeyboardShortcuts() {
{
shortcut: (
<>
<Key>Ctrl</Key> + <Key>Alt</Key> + <Key>h</Key>
<Key>Ctrl</Key> + <Key>{altDisplay}</Key> + <Key>h</Key>
</>
),
label: t("Table of contents"),
@@ -246,7 +246,7 @@ function KeyboardShortcuts() {
{
shortcut: (
<>
<Key>Alt</Key> + <Key></Key>
<Key>{altDisplay}</Key> + <Key></Key>
</>
),
label: t("Move list item up"),
@@ -254,7 +254,7 @@ function KeyboardShortcuts() {
{
shortcut: (
<>
<Key>Alt</Key> + <Key></Key>
<Key>{altDisplay}</Key> + <Key></Key>
</>
),
label: t("Move list item down"),

View File

@@ -1,5 +1,7 @@
import { isMac } from "~/utils/browser";
export const altDisplay = isMac() ? "⌥" : "Alt";
export const metaDisplay = isMac() ? "⌘" : "Ctrl";
export const meta = isMac() ? "cmd" : "ctrl";