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

Fix/drawer #57

Merged
merged 3 commits into from
Jan 13, 2025
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
13 changes: 10 additions & 3 deletions src/components/drawer/drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { cn } from '@/lib/utils';
import * as Dialog from '@radix-ui/react-dialog';
import { TimesIcon } from '@stash-ui/light-icons';
import * as React from 'react';
Expand All @@ -8,14 +9,20 @@ interface DrawerProps extends Dialog.DialogProps {
prefixIcon?: React.ReactNode;
hasDivider?: boolean;
footer?: React.ReactNode;
className?: string;
}

function Drawer({ children, title, description, prefixIcon, hasDivider, footer, ...props }: DrawerProps) {
function Drawer({ children, className, title, description, prefixIcon, hasDivider, footer, ...props }: DrawerProps) {
return (
<Dialog.Root {...props}>
<Dialog.Portal>
<Dialog.Overlay className="z-50 fixed inset-0 bg-[#00000011] w-screen h-screen backdrop-blur-[1px] animate-fade-in" />
<Dialog.Content className="max-w-[calc(100%-48px)] z-50 flex flex-col bg-[#FFFFFF] shadow-drawer rounded-xl md:max-w-full w-[400px] border border-border-card fixed right-6 top-6 h-[calc(100vh-48px)] data-[state=open]:animate-drawer-slide-in data-[state=closed]:animate-drawer-slide-out">
<Dialog.Overlay className=" z-50 fixed inset-0 bg-[#00000011] w-screen h-screen backdrop-blur-[1px] animate-fade-in" />
<Dialog.Content
className={cn(
'z-50 flex flex-col bg-[#FFFFFF] shadow-drawer rounded-xl w-[400px] border border-border-card fixed right-6 top-6 h-[calc(100vh-48px)] data-[state=open]:animate-drawer-slide-in data-[state=closed]:animate-drawer-slide-out',
className
)}
>
<div className="flex justify-between gap-2 p-6 pb-4">
<div className="flex gap-2">
{prefixIcon && <div className="h-fit">{prefixIcon}</div>}
Expand Down