-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,475 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,25 +13,26 @@ | |
"blur": "yarn dlx tsx ./processImages.ts" | ||
}, | ||
"dependencies": { | ||
"@mdx-js/loader": "^3.0.1", | ||
"@mdx-js/react": "^3.0.1", | ||
"@mdx-js/loader": "^3.1.0", | ||
"@mdx-js/react": "^3.1.0", | ||
"@next/mdx": "^15.0.0", | ||
"@radix-ui/react-avatar": "^1.1.1", | ||
"@radix-ui/react-dialog": "^1.1.2", | ||
"@radix-ui/react-dropdown-menu": "^2.1.2", | ||
"@radix-ui/react-hover-card": "^1.1.2", | ||
"@radix-ui/react-label": "^2.1.0", | ||
"@radix-ui/react-popover": "^1.1.2", | ||
"@radix-ui/react-separator": "^1.1.0", | ||
"@radix-ui/react-slot": "^1.1.0", | ||
"@radix-ui/react-switch": "^1.1.1", | ||
"@radix-ui/react-tooltip": "^1.1.3", | ||
"class-variance-authority": "^0.7.0", | ||
"clsx": "^2.1.1", | ||
"drizzle-orm": "^0.36.0", | ||
"jose": "^5.6.3", | ||
"lucide-react": "^0.427.0", | ||
"lucide-react": "^0.454.0", | ||
"next": "^15.0.2", | ||
"next-themes": "^0.3.0", | ||
"next-themes": "^0.4.1", | ||
"postgres": "^3.4.5", | ||
"react": "19.0.0-rc-7c8e5e7a-20241101", | ||
"react-dom": "19.0.0-rc-7c8e5e7a-20241101", | ||
|
@@ -41,7 +42,7 @@ | |
}, | ||
"devDependencies": { | ||
"@faker-js/faker": "^9.0.0", | ||
"@tailwindcss/postcss": "^4.0.0-alpha.17", | ||
"@tailwindcss/postcss": "^4.0.0-alpha.31", | ||
"@types/mdx": "^2.0.13", | ||
"@types/node": "^20", | ||
"@types/react": "npm:[email protected]", | ||
|
@@ -53,7 +54,7 @@ | |
"eslint-plugin-react-compiler": "19.0.0-beta-8a03594-20241020", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-tailwindcss": "^0.6.5", | ||
"tailwindcss": "^4.0.0-alpha.17", | ||
"tailwindcss": "^4.0.0-alpha.31", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.5.3" | ||
}, | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Auth from "@/components/auth"; | ||
|
||
export default async function Header() { | ||
return ( | ||
<div className="flex w-full justify-between p-4"> | ||
<h1 className="text-2xl font-bold">Forum</h1> | ||
<Auth app={"/forum"} /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { Calendar, Home, Inbox, Search, Settings } from "lucide-react"; | ||
|
||
import { | ||
Sidebar, | ||
SidebarContent, | ||
SidebarGroup, | ||
SidebarGroupContent, | ||
SidebarGroupLabel, | ||
SidebarMenu, | ||
SidebarMenuButton, | ||
SidebarMenuItem, | ||
} from "@/components/ui/sidebar"; | ||
|
||
// Menu items. | ||
const items = [ | ||
{ | ||
title: "Home", | ||
url: "#", | ||
icon: Home, | ||
}, | ||
{ | ||
title: "Inbox", | ||
url: "#", | ||
icon: Inbox, | ||
}, | ||
{ | ||
title: "Calendar", | ||
url: "#", | ||
icon: Calendar, | ||
}, | ||
{ | ||
title: "Search", | ||
url: "#", | ||
icon: Search, | ||
}, | ||
{ | ||
title: "Settings", | ||
url: "#", | ||
icon: Settings, | ||
}, | ||
]; | ||
|
||
export function SidePanel() { | ||
return ( | ||
<Sidebar> | ||
<SidebarContent> | ||
<SidebarGroup> | ||
<SidebarGroupLabel>Application</SidebarGroupLabel> | ||
<SidebarGroupContent> | ||
<SidebarMenu> | ||
{items.map((item) => ( | ||
<SidebarMenuItem key={item.title}> | ||
<SidebarMenuButton asChild> | ||
<a href={item.url}> | ||
<item.icon /> | ||
<span>{item.title}</span> | ||
</a> | ||
</SidebarMenuButton> | ||
</SidebarMenuItem> | ||
))} | ||
</SidebarMenu> | ||
</SidebarGroupContent> | ||
</SidebarGroup> | ||
</SidebarContent> | ||
</Sidebar> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"use client"; // Error components must be Client Components | ||
|
||
import { useEffect } from "react"; | ||
|
||
export default function Error({ | ||
error, | ||
reset, | ||
}: { | ||
error: Error & { digest?: string }; | ||
reset: () => void; | ||
}) { | ||
useEffect(() => { | ||
// Log the error to an error reporting service | ||
console.error(error); | ||
}, [error]); | ||
|
||
return ( | ||
<div> | ||
<h2>Something went wrong!</h2> | ||
<button | ||
onClick={ | ||
// Attempt to recover by trying to re-render the segment | ||
() => reset() | ||
} | ||
> | ||
Try again | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
export default function Home() { | ||
return null; | ||
import { dbClient } from "@/db/forum/db"; | ||
import { messages } from "@/db/forum/schema"; | ||
import { desc, isNull } from "drizzle-orm"; | ||
|
||
export default async function Home() { | ||
const posts = await dbClient() | ||
.db.select() | ||
.from(messages) | ||
.where(isNull(messages.parent_id)) | ||
.orderBy(desc(messages.createdAt)); | ||
return ( | ||
<div> | ||
{posts.map((post) => ( | ||
<div key={post.id}> | ||
{post.message} | ||
<div> | ||
<br /> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export default function Forum() { | ||
return null; | ||
import { redirect } from "next/navigation"; | ||
|
||
export default function Home() { | ||
return <main>{redirect("/home")}</main>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Template({ children }: { children: React.ReactNode }) { | ||
return <div className="animate-appear-up">{children}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.