Fixed an issue that would caused empty dashboard shortcuts to not hide properly. (#610)

This commit is contained in:
Jas Singh
2024-12-24 02:17:08 -08:00
committed by GitHub
parent d8a59c1d18
commit a3f348c580
4 changed files with 44 additions and 8 deletions

View File

@@ -24,36 +24,60 @@ const ShortcutButton = ({ shortcut, ...props }: ShortcutButtonProps): JSX.Elemen
};
export const LeftShortcut1 = (): JSX.Element => {
if (!hasCommand(left.shortcut1)) {
return <box />;
}
return (
<ShortcutButton
shortcut={left.shortcut1}
className={`dashboard-button top-button ${hasCommand(left.shortcut1) ? 'paired' : ''}`}
className={`dashboard-button top-button ${hasCommand(left.shortcut2) ? 'paired' : ''}`}
/>
);
};
export const LeftShortcut2 = (): JSX.Element => {
if (!hasCommand(left.shortcut2)) {
return <box />;
}
return <ShortcutButton shortcut={left.shortcut2} className={`dashboard-button`} />;
};
export const LeftShortcut3 = (): JSX.Element => {
if (!hasCommand(left.shortcut3)) {
return <box />;
}
return (
<ShortcutButton
shortcut={left.shortcut3}
className={`dashboard-button top-button ${hasCommand(left.shortcut3) ? 'paired' : ''}`}
className={`dashboard-button top-button ${hasCommand(left.shortcut4) ? 'paired' : ''}`}
/>
);
};
export const LeftShortcut4 = (): JSX.Element => {
if (!hasCommand(left.shortcut4)) {
return <box />;
}
return <ShortcutButton shortcut={left.shortcut4} className={`dashboard-button `} />;
};
export const RightShortcut1 = (): JSX.Element => {
if (!hasCommand(right.shortcut1)) {
return <box />;
}
return <ShortcutButton shortcut={right.shortcut1} className={`dashboard-button top-button paired`} />;
};
export const RightShortcut3 = (): JSX.Element => {
if (!hasCommand(right.shortcut3)) {
return <box />;
}
return <ShortcutButton shortcut={right.shortcut3} className={`dashboard-button top-button paired`} />;
};