design upgrade
This commit is contained in:
@@ -34,7 +34,7 @@ const Modal = ({
|
||||
leaveFrom="opacity-100"
|
||||
leaveTo="opacity-0"
|
||||
>
|
||||
<div className="fixed inset-0 bg-opacity-75 backdrop-blur-md h-screen" />
|
||||
<div className="fixed inset-0 h-screen bg-black/40 backdrop-blur-[2px]" />
|
||||
</Transition.Child>
|
||||
|
||||
<div className="fixed inset-0 overflow-y-hidden">
|
||||
@@ -59,13 +59,13 @@ const Modal = ({
|
||||
<Dialog.Panel
|
||||
data-testid={dataTestId}
|
||||
className={clx(
|
||||
"flex flex-col justify-start w-full transform p-5 text-left align-middle transition-all max-h-[75vh] h-fit",
|
||||
"flex flex-col justify-start w-full transform p-6 sm:p-8 text-left align-middle transition-all max-h-[85vh] h-fit overflow-y-auto",
|
||||
{
|
||||
"max-w-md": size === "small",
|
||||
"max-w-xl": size === "medium",
|
||||
"max-w-3xl": size === "large",
|
||||
"bg-transparent shadow-none": search,
|
||||
"bg-white shadow-xl border rounded-rounded": !search,
|
||||
"bg-background shadow-lg border border-border rounded-2xl": !search,
|
||||
}
|
||||
)}
|
||||
>
|
||||
@@ -83,31 +83,36 @@ const Title: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
const { close } = useModal()
|
||||
|
||||
return (
|
||||
<Dialog.Title className="flex items-center justify-between">
|
||||
<div className="text-large-semi">{children}</div>
|
||||
<div>
|
||||
<button onClick={close} data-testid="close-modal-button">
|
||||
<X size={20} />
|
||||
</button>
|
||||
<Dialog.Title className="mb-6 flex items-start justify-between gap-4">
|
||||
<div className="font-display text-2xl text-foreground [&_h1]:font-display [&_h1]:text-2xl [&_h1]:font-normal [&_h2]:font-normal">
|
||||
{children}
|
||||
</div>
|
||||
<button
|
||||
onClick={close}
|
||||
data-testid="close-modal-button"
|
||||
aria-label="Zatvori"
|
||||
className="-mr-2 -mt-1 flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
|
||||
>
|
||||
<X size={18} />
|
||||
</button>
|
||||
</Dialog.Title>
|
||||
)
|
||||
}
|
||||
|
||||
const Description: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
return (
|
||||
<Dialog.Description className="flex text-small-regular text-ui-fg-base items-center justify-center pt-2 pb-4 h-full">
|
||||
<Dialog.Description className="flex text-sm text-foreground items-center justify-center pt-2 pb-4 h-full">
|
||||
{children}
|
||||
</Dialog.Description>
|
||||
)
|
||||
}
|
||||
|
||||
const Body: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
return <div className="flex justify-center">{children}</div>
|
||||
return <div className="w-full">{children}</div>
|
||||
}
|
||||
|
||||
const Footer: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
||||
return <div className="flex items-center justify-end gap-x-4">{children}</div>
|
||||
return <div className="mt-6 flex items-center justify-end gap-3 border-t border-border/70 pt-6">{children}</div>
|
||||
}
|
||||
|
||||
Modal.Title = Title
|
||||
|
||||
Reference in New Issue
Block a user