Skip to content

Commit

Permalink
feat: added issues option on menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Shashivadan committed Sep 2, 2024
1 parent 27f9a48 commit 8687b73
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"problemMatcher": [],
"label": "npm: start",
"detail": "next start",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
4 changes: 4 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ model Post {
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
visibility Visibility @default(PUBLIC)
likes Like[]
@@index([authorId])
}

model Like {
Expand All @@ -82,4 +84,6 @@ model Like {
userId String
post Post @relation(fields: [postId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@index([postId , userId])
}
2 changes: 1 addition & 1 deletion src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {deletePost , savePost } from "./post"
export { deletePost, savePost } from "./post";
8 changes: 4 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default async function Home() {
}
})

if (posts.length === 0) {
return <div className="text-center">No posts yet.</div>;
}
if (posts.length === 0) {
return <div className="text-center">No posts yet.</div>;
}

return (
<main className="">
Expand All @@ -48,4 +48,4 @@ export default async function Home() {
</main>
);

}
}
4 changes: 2 additions & 2 deletions src/components/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
Expand All @@ -26,7 +25,7 @@ export default function Menu({ user }: MenuProp) {
if (!user) {
return (
<Button
type="button"
type="button"
className=" bg-zinc-900 hover:bg-zinc-800/50 rounded-[6px] border-solid border-[1px] border-zinc-800 text-sm md:h-10 "
asChild
>
Expand Down Expand Up @@ -68,6 +67,7 @@ export default function Menu({ user }: MenuProp) {
<Link href="/me/settings">Settings</Link>
</DropdownMenuItem>
<DropdownMenuSeparator className="bg-zinc-800" />
<DropdownMenuItem asChild><Link href={"https://github.com/Shashivadan/blogx/issues/new"}>Report a issue</Link></DropdownMenuItem>
<DropdownMenuItem onClick={() => signOut()}>Log out</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand Down

0 comments on commit 8687b73

Please sign in to comment.