chore: fix modal header on small window size on macOS [skip e2e]

This commit is contained in:
Aman Harwara
2024-01-30 18:57:38 +05:30
parent 2950aaa09a
commit 9c73a23ca0
3 changed files with 19 additions and 3 deletions

View File

@@ -13,6 +13,9 @@
.mac-desktop .app-pane {
padding-top: 25px;
}
.mac-desktop [data-dialog] [data-mobile-modal-header] {
padding-top: 25px;
}
}
@media screen and (min-width: 768px) {

View File

@@ -1,5 +1,5 @@
import { useCallback, useEffect, useState } from 'react'
import Modal from '../Modal/Modal'
import { useCallback, useEffect, useMemo, useState } from 'react'
import Modal, { ModalAction } from '../Modal/Modal'
import ModalOverlay from '../Modal/ModalOverlay'
import {
KeyboardService,
@@ -57,9 +57,21 @@ const KeyboardShortcutsModal = ({ keyboardService }: { keyboardService: Keyboard
})
}, [keyboardService])
const actions = useMemo(
(): ModalAction[] => [
{
label: 'Cancel',
onClick: close,
type: 'cancel',
mobileSlot: 'left',
},
],
[close],
)
return (
<ModalOverlay isOpen={isOpen} close={close}>
<Modal title="Keyboard shortcuts" close={close}>
<Modal title="Keyboard shortcuts" close={close} actions={actions}>
{Object.entries(items).map(
([category, items]) =>
items.length > 0 && (

View File

@@ -13,6 +13,7 @@ const MobileModalHeader = ({ className, children }: Props) => {
'grid w-full select-none grid-cols-[0.35fr_1fr_0.35fr] gap-2 text-[1.05rem] leading-6',
className,
)}
data-mobile-modal-header
>
{children}
</div>