close thread spotlight on bg click
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
Martti Malmi 2023-12-06 16:57:52 +02:00
parent d20543d7a3
commit ae1b762771

View File

@ -9,12 +9,17 @@ import { NostrLink } from "@snort/system";
export function SpotlightThreadModal(props: { thread: NostrLink; onClose?: () => void; onBack?: () => void }) {
const onClose = () => props.onClose?.();
const onBack = () => props.onBack?.();
const onClickBg = (e: React.MouseEvent) => {
if (e.target === e.currentTarget) {
onClose();
}
}
return (
<Modal id="thread-overlay" onClose={onClose} bodyClassName={"flex flex-1"}>
<ThreadContextWrapper link={props.thread}>
<div className="flex flex-row h-screen w-screen">
<div className="flex w-full md:w-2/3 items-center justify-center overflow-hidden">
<div className="flex w-full md:w-2/3 items-center justify-center overflow-hidden" onClick={onClickBg}>
<SpotlightFromThread onClose={onClose} />
</div>
<div className="hidden md:flex w-1/3 min-w-[400px] flex-shrink-0 overflow-y-auto bg-bg-color">