feat: allow closing dialogs by clicking backdrop
This commit is contained in:
parent
2c2b7b781d
commit
03671583cd
|
|
@ -25,8 +25,14 @@ export const CreateSessionDialog: Component<CreateSessionDialogProps> = (
|
|||
|
||||
return (
|
||||
<Show when={props.open}>
|
||||
<div class="absolute inset-0 z-50 flex items-center justify-center bg-black/20">
|
||||
<div class="bg-white rounded-lg border border-gray-200 shadow-xl w-[260px] p-4 space-y-3">
|
||||
<div
|
||||
class="absolute inset-0 z-50 flex items-center justify-center bg-black/20"
|
||||
onClick={props.onClose}
|
||||
>
|
||||
<div
|
||||
class="bg-white rounded-lg border border-gray-200 shadow-xl w-[280px] p-4 space-y-3"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-semibold text-gray-800">新建会话</h3>
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -37,8 +37,14 @@ export const InviteDialog: Component<InviteDialogProps> = (props) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<div class="absolute inset-0 z-50 flex items-center justify-center bg-black/20">
|
||||
<div class="bg-white rounded-lg border border-gray-200 shadow-xl w-[280px] p-4 space-y-3">
|
||||
<div
|
||||
class="absolute inset-0 z-50 flex items-center justify-center bg-black/20"
|
||||
onClick={props.onClose}
|
||||
>
|
||||
<div
|
||||
class="bg-white rounded-lg border border-gray-200 shadow-xl w-[280px] p-4 space-y-3"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-sm font-semibold text-gray-800">邀请玩家</h3>
|
||||
<button
|
||||
|
|
|
|||
Loading…
Reference in New Issue