sync: update from private repo (63a6e76)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-09 03:17:43 +00:00
parent d6d8e83867
commit 3848b5efd7
20 changed files with 386 additions and 29 deletions
+5 -3
View File
@@ -1,5 +1,6 @@
import { useEffect, useCallback, type ReactNode } from 'react';
import { createPortal } from 'react-dom';
import { useBackdropClose } from '../../lib/useBackdropClose';
interface EmbedModalProps {
open: boolean;
@@ -8,6 +9,7 @@ interface EmbedModalProps {
}
export function EmbedModal({ open, onClose, children }: EmbedModalProps) {
const backdrop = useBackdropClose(onClose);
const handleKeyDown = useCallback((e: KeyboardEvent) => {
if (e.key === 'Escape') onClose();
}, [onClose]);
@@ -28,10 +30,10 @@ export function EmbedModal({ open, onClose, children }: EmbedModalProps) {
return createPortal(
<div
className="fixed inset-0 z-50 flex items-center justify-center"
onClick={onClose}
>
{/* Backdrop */}
<div className="absolute inset-0 bg-black/50" />
{/* Backdrop — the close handler lives here (the actual clicked element),
not the transparent outer div, so target===currentTarget holds. */}
<div className="absolute inset-0 bg-black/50" {...backdrop} />
{/* Modal content */}
<div