mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
ui: use symbols for shortcut keys on macOS
This commit is contained in:
@@ -141,10 +141,16 @@ export function MenuButton(props: MenuButtonProps) {
|
||||
const platform = getPlatform();
|
||||
function translateModifier(modifier: string) {
|
||||
if (platform === "Android" || platform === "iOS") return "";
|
||||
const isMacOS = platform === "macOS";
|
||||
const parts = modifier.split("-");
|
||||
return parts
|
||||
.map((p) => (p === "Mod" ? (platform === "macOS" ? "Cmd" : "Ctrl") : p))
|
||||
.join("+");
|
||||
.map((p) => {
|
||||
if (isMacOS) {
|
||||
return p === "Mod" ? "⌘" : p === "Alt" ? "⌥" : p === "Shift" ? "⇧" : p;
|
||||
}
|
||||
return p === "Mod" ? "Ctrl" : p;
|
||||
})
|
||||
.join(isMacOS ? "" : "+");
|
||||
}
|
||||
|
||||
function getPlatform() {
|
||||
|
||||
Reference in New Issue
Block a user