fix: sidebar and shortcut modal (#493)
* fix: shortcut modal cmd and ctrl fix * fix: sidebar collapse state ordering
This commit is contained in:
parent
031f6443a0
commit
f615f8ac0c
2 changed files with 22 additions and 9 deletions
|
|
@ -52,6 +52,7 @@ export const ShortcutsModal: React.FC<Props> = ({ isOpen, setIsOpen }) => {
|
|||
? true
|
||||
: false
|
||||
);
|
||||
const { platform } = (window.navigator as any).userAgentData;
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) setQuery("");
|
||||
|
|
@ -126,12 +127,18 @@ export const ShortcutsModal: React.FC<Props> = ({ isOpen, setIsOpen }) => {
|
|||
{shortcut.keys.split(",").map((key, index) => (
|
||||
<span key={index} className="flex items-center gap-1">
|
||||
{key === "Ctrl" ? (
|
||||
<span className="flex h-full items-center rounded-sm border border-gray-200 bg-gray-100 p-2">
|
||||
<MacCommandIcon />
|
||||
</span>
|
||||
platform === "Windows" ? (
|
||||
<kbd className="rounded-sm border border-gray-200 bg-gray-100 px-2 py-1 text-sm font-medium text-gray-800">
|
||||
{key}
|
||||
</kbd>
|
||||
) : (
|
||||
<span className="flex h-full items-center rounded-sm border border-gray-200 bg-gray-100 p-2">
|
||||
<MacCommandIcon />
|
||||
</span>
|
||||
)
|
||||
) : (
|
||||
<kbd className="rounded-sm border border-gray-200 bg-gray-100 px-2 py-1 text-sm font-medium text-gray-800">
|
||||
{key === "Ctrl" ? <MacCommandIcon /> : key}
|
||||
{key}
|
||||
</kbd>
|
||||
)}
|
||||
</span>
|
||||
|
|
@ -165,12 +172,18 @@ export const ShortcutsModal: React.FC<Props> = ({ isOpen, setIsOpen }) => {
|
|||
{keys.split(",").map((key, index) => (
|
||||
<span key={index} className="flex items-center gap-1">
|
||||
{key === "Ctrl" ? (
|
||||
<span className="flex h-full items-center rounded-sm border border-gray-200 bg-gray-100 p-2">
|
||||
<MacCommandIcon />
|
||||
</span>
|
||||
platform === "Windows" ? (
|
||||
<kbd className="rounded-sm border border-gray-200 bg-gray-100 px-2 py-1 text-sm font-medium text-gray-800">
|
||||
{key}
|
||||
</kbd>
|
||||
) : (
|
||||
<span className="flex h-full items-center rounded-sm border border-gray-200 bg-gray-100 p-2">
|
||||
<MacCommandIcon />
|
||||
</span>
|
||||
)
|
||||
) : (
|
||||
<kbd className="rounded-sm border border-gray-200 bg-gray-100 px-2 py-1 text-sm font-medium text-gray-800">
|
||||
{key === "Ctrl" ? <MacCommandIcon /> : key}
|
||||
{key}
|
||||
</kbd>
|
||||
)}
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue