Skip to content

Commit

Permalink
drawer fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Feb 16, 2024
1 parent 1d5f261 commit 06ee305
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 8 additions & 2 deletions client/src/components/ui/drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const Drawer = ({
shouldScaleBackground = true,
...props
}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
<DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />
<DrawerPrimitive.Root
shouldScaleBackground={shouldScaleBackground}
modal={false}
direction="left"
{...props}
/>
);
Drawer.displayName = 'Drawer';

Expand All @@ -37,10 +42,11 @@ const DrawerContent = React.forwardRef<
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<DrawerPortal>
<DrawerOverlay />
<DrawerPrimitive.Content
ref={ref}
className={cn(
'fixed inset-x-0 bottom-0 left-[580px] top-0 z-10 flex h-auto w-3/5 flex-col rounded-t-[10px]',
'top-inset pointer-events-auto fixed inset-x-0 bottom-2 right-6 flex h-[calc(100vh-16px)] flex-col bg-none',
className
)}
{...props}
Expand Down
8 changes: 4 additions & 4 deletions client/src/containers/projects/detail/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ProjectDashboard() {

return (
dashboard && (
<div className="absolute bottom-0 right-4 top-0 z-50 my-2 box-content w-7/12 w-full rounded-3xl bg-neutral-50 px-6 py-8 shadow-md">
<div className="z-50 box-content h-full w-full rounded-3xl bg-neutral-50 px-6 py-8 shadow-md">
<div>
<h3 className="mb-4 text-xl font-extrabold text-gray-400">Overview</h3>
<button
Expand Down Expand Up @@ -91,19 +91,19 @@ export default function ProjectDashboard() {
</Dialog>
</div>
</div>
<div className="rounded-xl bg-white bg-white p-4 shadow-sm">
<div className="rounded-xl bg-white p-4 shadow-sm">
<div className="flex items-center justify-between">
<h3 className="text-lg text-green-800">Funding in USD</h3>
<Info className="h-5 w-5 text-green-800" />
</div>
</div>
<div className="rounded-xl bg-white bg-white p-4 shadow-sm">
<div className="rounded-xl bg-white p-4 shadow-sm">
<div className="flex items-center justify-between">
<h3 className="text-lg text-green-800">Trained people per year</h3>
<Info className="h-5 w-5 text-green-800" />
</div>
</div>
<div className="rounded-xl bg-white bg-white p-4 shadow-sm">
<div className="rounded-xl bg-white p-4 shadow-sm">
<div className="flex items-center justify-between">
<h3 className="text-xl text-green-800">Community beneficiaries</h3>
<Info className="h-5 w-5 text-green-800" />
Expand Down
2 changes: 1 addition & 1 deletion client/src/containers/projects/detail/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function ProjectDetailPanel() {
<ChevronRight className="h-4 w-4 text-yellow-900 group-hover:text-yellow-50" />
</Button>
</DrawerTrigger>
<DrawerContent>
<DrawerContent className="left-[512px] w-[calc(100vw-584px)]">
<ProjectDashboard />
</DrawerContent>
</Drawer>
Expand Down

0 comments on commit 06ee305

Please sign in to comment.