2021-12-09 23:51:30 +00:00
|
|
|
import classNames from "classnames";
|
2023-02-16 22:39:57 +00:00
|
|
|
import type { PropsWithChildren } from "react";
|
|
|
|
import React from "react";
|
2021-12-09 23:51:30 +00:00
|
|
|
|
2022-11-23 02:55:25 +00:00
|
|
|
import { Dialog, DialogContent } from "@calcom/ui";
|
2022-03-17 13:20:49 +00:00
|
|
|
|
2022-06-06 18:24:37 +00:00
|
|
|
export default function ModalContainer(
|
|
|
|
props: PropsWithChildren<{
|
|
|
|
wide?: boolean;
|
|
|
|
scroll?: boolean;
|
|
|
|
noPadding?: boolean;
|
|
|
|
isOpen: boolean;
|
|
|
|
onExit: () => void;
|
|
|
|
}>
|
|
|
|
) {
|
2021-12-09 23:51:30 +00:00
|
|
|
return (
|
2022-03-17 13:20:49 +00:00
|
|
|
<div className="flex min-h-screen items-end justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0">
|
|
|
|
<Dialog open={props.isOpen} onOpenChange={props.onExit}>
|
|
|
|
<DialogContent>
|
|
|
|
<div
|
|
|
|
className={classNames(
|
2023-04-05 18:14:46 +00:00
|
|
|
"bg-default inline-block w-full transform text-left align-bottom transition-all sm:align-middle",
|
2022-03-17 13:20:49 +00:00
|
|
|
{
|
|
|
|
"sm:w-full sm:max-w-lg ": !props.wide,
|
|
|
|
"sm:w-4xl sm:max-w-4xl": props.wide,
|
2022-04-19 15:50:19 +00:00
|
|
|
"overflow-auto": props.scroll,
|
2022-03-17 13:20:49 +00:00
|
|
|
"!p-0": props.noPadding,
|
|
|
|
}
|
|
|
|
)}>
|
|
|
|
{props.children}
|
|
|
|
</div>
|
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
2021-12-09 23:51:30 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|