Skip to content

Commit

Permalink
feat: initiate sidebar feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
yashdev9274 committed May 31, 2024
1 parent 1c4c153 commit 7f1bc43
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@prisma/client": "^5.10.2",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-aspect-ratio": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
Expand Down
24 changes: 24 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion src/components/sidebar/menu-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { Sheet, SheetContent, SheetTrigger } from '../ui/sheet'
import { Button } from '../ui/button'
import { Menu } from 'lucide-react'
import clsx from 'clsx'
import { AspectRatio } from '../ui/aspect-ratio'
import Image from 'next/image'

type Props = {

Expand Down Expand Up @@ -75,7 +77,15 @@ const MenuOptions = ({
}
)}
>

<div>
<AspectRatio ratio={16 / 5} />
<Image
src={sidebarLogo}
alt="Sidebar Logo"
fill
className="rounded-md object-contain"
/>
</div>
</SheetContent>
</Sheet>
)
Expand Down
7 changes: 7 additions & 0 deletions src/components/ui/aspect-ratio.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"use client"

import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"

const AspectRatio = AspectRatioPrimitive.Root

export { AspectRatio }
6 changes: 3 additions & 3 deletions src/lib/db.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {PrismaClient} from '@prisma/client';
import { PrismaClient } from '@prisma/client';

declare global{
declare global {
var prisma: PrismaClient | undefined
}

export const db = globalThis.prisma || new PrismaClient()

if(process.env.NODE_ENV !== 'production') globalThis.prisma = db
if (process.env.NODE_ENV !== 'production') globalThis.prisma = db

0 comments on commit 7f1bc43

Please sign in to comment.