mirror of
https://github.com/responsively-org/responsively-app
synced 2024-11-10 06:44:13 +00:00
refactor: modal - title props optional
This commit is contained in:
parent
4c6d8cddc8
commit
3ea9aea784
1 changed files with 6 additions and 2 deletions
|
@ -4,7 +4,7 @@ import { Fragment } from 'react';
|
|||
interface Props {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
title: JSX.Element | string;
|
||||
title?: JSX.Element | string;
|
||||
description?: JSX.Element | string;
|
||||
children?: JSX.Element | string;
|
||||
}
|
||||
|
@ -35,7 +35,11 @@ const Modal = ({ isOpen, onClose, title, description, children }: Props) => {
|
|||
leaveFrom="opacity-100 scale-100"
|
||||
leaveTo="opacity-0 scale-95"
|
||||
>
|
||||
<Dialog.Panel className="flex w-fit min-w-[320px] flex-col gap-4 rounded bg-slate-200 p-8 text-light-normal dark:bg-slate-800 dark:text-dark-normal">
|
||||
<Dialog.Panel
|
||||
className={`flex w-fit min-w-[320px] flex-col gap-4 rounded bg-slate-200 text-light-normal dark:bg-slate-800 dark:text-dark-normal ${
|
||||
title ? 'p-8' : 'py-4 px-8'
|
||||
}`}
|
||||
>
|
||||
<div>
|
||||
<Dialog.Title className="text-xl font-medium leading-6">
|
||||
{title}
|
||||
|
|
Loading…
Reference in a new issue