[questions][fix] fix contribute dialog close (#476)

This commit is contained in:
Jeff Sieu
2022-10-31 16:38:56 +08:00
committed by GitHub
parent 3e0a40efeb
commit a208435dad
2 changed files with 51 additions and 44 deletions

View File

@ -30,6 +30,7 @@ export default function ContributeQuestionCard({
});
return (
<div className="w-full">
<button
className="flex w-full flex-col items-stretch justify-center gap-2 rounded-md border border-slate-300 bg-white p-4 text-left hover:bg-slate-100"
type="button"
@ -73,11 +74,12 @@ export default function ContributeQuestionCard({
Contribute
</h1>
</div>
</button>
<ContributeQuestionDialog
show={showDraftDialog}
onCancel={handleDraftDialogCancel}
onSubmit={onSubmit}
/>
</button>
</div>
);
}

View File

@ -35,7 +35,12 @@ export default function ContributeQuestionDialog({
return (
<div>
<Transition.Root as={Fragment} show={show}>
<Dialog as="div" className="relative z-10" onClose={onCancel}>
<Dialog
as="div"
className="relative z-10"
onClose={() => {
onCancel();
}}>
<Transition.Child
as={Fragment}
enter="ease-out duration-300"