feat: use app router for home topic

This commit is contained in:
DIYgod 2023-05-06 23:11:40 +01:00
parent bdea09ae7d
commit 3ffe814abd
No known key found for this signature in database
3 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,31 @@
import { HomeFeed } from "~/components/home/HomeFeed"
import { HomeSidebar } from "~/components/home/HomeSidebar"
import topics from "../../../../../data/topics.json"
function Topic({
params,
}: {
params: {
topic: string
}
}) {
const info = topics.find((t) => t.name === params.topic)
return (
<section className="pt-24">
<div className="max-w-screen-lg px-5 mx-auto flex">
<div className="flex-1 min-w-[300px]">
<h2 className="text-3xl font-bold">Topic: {params.topic}</h2>
<p className="text-zinc-400 mt-4">{info?.description}</p>
<div className="mt-10">
<HomeFeed type="topic" noteIds={info?.notes} />
</div>
</div>
<HomeSidebar />
</div>
</section>
)
}
export default Topic

View File

@ -259,7 +259,7 @@ export const HomeFeed: React.FC<{
return (
<>
<Tabs items={tabs} className="border-none text-lg"></Tabs>
{!type && <Tabs items={tabs} className="border-none text-lg"></Tabs>}
<div className="space-y-10">
{hasFiltering && (
<div className="flex items-center text-zinc-500">