Skip to content

Commit 14adb73

Browse files
committed
Adds a new enter shortcut key
1 parent 6cb76ca commit 14adb73

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export function KeyboardEnterIcon({ className }: { className?: string }) {
2+
return (
3+
<svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4+
<path
5+
d="M12 5H18C19.6569 5 21 6.34315 21 8V13C21 14.6569 19.6569 16 18 16H8"
6+
stroke="currentColor"
7+
strokeWidth="2"
8+
/>
9+
<path d="M2 16L8 12L8 20L2 16Z" fill="currentColor" />
10+
</svg>
11+
);
12+
}

apps/webapp/app/components/primitives/ShortcutKey.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { KeyboardWindowsIcon } from "~/assets/icons/KeyboardWindowsIcon";
66
import { type Modifier, type Shortcut } from "~/hooks/useShortcutKeys";
77
import { cn } from "~/utils/cn";
88
import { useOperatingSystem } from "./OperatingSystemProvider";
9+
import { KeyboardEnterIcon } from "~/assets/icons/KeyboardEnterIcon";
910

1011
const medium =
1112
"text-[0.75rem] font-medium min-w-[17px] rounded-[2px] tabular-nums px-1 ml-1 -mr-0.5 flex items-center gap-x-1.5 border border-dimmed/40 text-text-dimmed group-hover:text-text-bright/80 group-hover:border-dimmed/60 transition uppercase";
@@ -60,7 +61,11 @@ function keyString(key: string, isMac: boolean, variant: "small" | "medium" | "m
6061

6162
switch (key) {
6263
case "enter":
63-
return isMac ? "↵" : <span className="capitalize">Enter</span>;
64+
return isMac ? (
65+
<KeyboardEnterIcon className={className} />
66+
) : (
67+
<span className="capitalize">Enter</span>
68+
);
6469
case "esc":
6570
return <span className="capitalize">Esc</span>;
6671
case "del":

0 commit comments

Comments
 (0)