mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 00:24:24 +01:00
Fix hotkey formatting
This commit is contained in:
@@ -52,7 +52,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button
|
||||
}: ButtonProps,
|
||||
ref,
|
||||
) {
|
||||
const hotkeyTrigger = useFormattedHotkey(hotkeyAction ?? null);
|
||||
const hotkeyTrigger = useFormattedHotkey(hotkeyAction ?? null)?.join('');
|
||||
const fullTitle = hotkeyTrigger ? `${title} ${hotkeyTrigger}` : title;
|
||||
|
||||
const classes = useMemo(
|
||||
|
||||
@@ -12,8 +12,8 @@ interface Props {
|
||||
|
||||
export function HotKey({ action, className, variant }: Props) {
|
||||
const osInfo = useOsInfo();
|
||||
const label = useFormattedHotkey(action);
|
||||
if (label === null || osInfo == null) {
|
||||
const labelParts = useFormattedHotkey(action);
|
||||
if (labelParts === null || osInfo == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ export function HotKey({ action, className, variant }: Props) {
|
||||
'text-gray-1000 text-opacity-disabled',
|
||||
)}
|
||||
>
|
||||
{label.split('').map((char, index) => (
|
||||
<div key={index} className="w-[1.1em] text-center">
|
||||
{labelParts.map((char, index) => (
|
||||
<div key={index} className="min-w-[1.1em] text-center">
|
||||
{char}
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user