mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 10:18:31 +02:00
Fix dialog close button
This commit is contained in:
@@ -74,16 +74,18 @@ export function Dialog({
|
|||||||
)}
|
)}
|
||||||
{description && <p id={descriptionId}>{description}</p>}
|
{description && <p id={descriptionId}>{description}</p>}
|
||||||
<div className="h-full w-full grid grid-cols-[minmax(0,1fr)]">{children}</div>
|
<div className="h-full w-full grid grid-cols-[minmax(0,1fr)]">{children}</div>
|
||||||
|
|
||||||
{/*Put close at the end so that it's the last thing to be tabbed to*/}
|
{/*Put close at the end so that it's the last thing to be tabbed to*/}
|
||||||
{!hideX && (
|
{!hideX && (
|
||||||
<IconButton
|
<div className="ml-auto absolute right-1 top-1">
|
||||||
onClick={onClose}
|
<IconButton
|
||||||
title="Close dialog"
|
onClick={onClose}
|
||||||
aria-label="Close"
|
title="Close dialog"
|
||||||
icon="x"
|
aria-label="Close"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="ml-auto absolute right-1 top-1"
|
icon="x"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ export const IconButton = forwardRef<HTMLButtonElement, Props>(function IconButt
|
|||||||
tabIndex={tabIndex ?? icon === 'empty' ? -1 : undefined}
|
tabIndex={tabIndex ?? icon === 'empty' ? -1 : undefined}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
innerClassName="flex items-center justify-center"
|
innerClassName="flex items-center justify-center"
|
||||||
|
size={size}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
className,
|
className,
|
||||||
'relative flex-shrink-0 text-gray-700 hover:text-gray-1000',
|
'relative flex-shrink-0 text-gray-700 hover:text-gray-1000',
|
||||||
@@ -57,7 +58,6 @@ export const IconButton = forwardRef<HTMLButtonElement, Props>(function IconButt
|
|||||||
size === 'sm' && 'w-8',
|
size === 'sm' && 'w-8',
|
||||||
size === 'xs' && 'w-6',
|
size === 'xs' && 'w-6',
|
||||||
)}
|
)}
|
||||||
size={size}
|
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{showBadge && (
|
{showBadge && (
|
||||||
|
|||||||
Reference in New Issue
Block a user