Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: Remove width and height from dialog parent element #58

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/components/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export interface DialogProps {
title?: string;
onClose?: (submitted: boolean) => void;
isCloseable?: boolean;
height?: number;
width?: number;
className?: string;
children: React.ReactNode;
footer?: React.ReactNode | null;
Expand All @@ -27,18 +25,12 @@ export const Dialog = ({
footer,
footerPosition = "end",
onClose,
height,
width,
title,
hasBackground = true,
position = "center",
}: DialogProps): JSX.Element | null => {
const handleClose = (submitted = false) => {
if (!isCloseable) {
return;
}

if (onClose) {
if (isCloseable && onClose) {
onClose(submitted);
}
};
Expand Down Expand Up @@ -82,9 +74,7 @@ export const Dialog = ({
>
<HeadlessDialog.Panel
className={classNames(
"flex transform flex-col overflow-y-auto rounded-md bg-neutral-0 shadow-lg transition-all",
height ? `h-[${height}px]` : "max-h-full",
width ? `w-[${width}px]` : "w-[592px]",
"flex w-[736px] transform flex-col overflow-y-auto rounded-md bg-neutral-0 shadow-lg transition-all",
!footer && "pb-8",
className
)}
Expand Down
Loading