Skip to content

Commit d3434ae

Browse files
committed
Hide the shortcut key at the button layer
1 parent eed126c commit d3434ae

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ export function ButtonContent(props: ButtonContentPropsType) {
204204
const textColorClassName = variation.textColor;
205205

206206
const renderShortcutKey = () =>
207-
shortcut && (
207+
shortcut &&
208+
!hideShortcutKey && (
208209
<ShortcutKey
209210
className={cn(shortcutClassName)}
210211
shortcut={shortcut}
211212
variant={variation.shortcutVariant ?? "medium"}
212-
hideShortcutKey={hideShortcutKey}
213213
/>
214214
);
215215

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,17 @@ type ShortcutKeyProps = {
3333
shortcut: ShortcutKeyDefinition;
3434
variant: ShortcutKeyVariant;
3535
className?: string;
36-
hideShortcutKey?: boolean;
3736
};
3837

39-
export function ShortcutKey({
40-
shortcut,
41-
variant,
42-
className,
43-
hideShortcutKey = false,
44-
}: ShortcutKeyProps) {
38+
export function ShortcutKey({ shortcut, variant, className }: ShortcutKeyProps) {
4539
const { platform } = useOperatingSystem();
4640
const isMac = platform === "mac";
4741
let relevantShortcut = "mac" in shortcut ? (isMac ? shortcut.mac : shortcut.windows) : shortcut;
4842
const modifiers = relevantShortcut.modifiers ?? [];
4943
const character = relevantShortcut.key ? keyString(relevantShortcut.key, isMac, variant) : null;
5044

5145
return (
52-
<span className={cn(variants[variant], hideShortcutKey && "hidden", className)}>
46+
<span className={cn(variants[variant], className)}>
5347
{modifiers.map((k) => (
5448
<span key={k}>
5549
<span>{modifierString(k, isMac, variant)}</span>

0 commit comments

Comments
 (0)