Decouple admin from public max-w-7xl via (site) route group.
Local Build and Deploy / deploy (push) Successful in 54s
Local Build and Deploy / deploy (push) Successful in 54s
Public chrome and width live only under (site). /admin and /client inherit the root layout alone, so housekeeping width is no longer tied to the public template. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
a1dc7ff0a7
commit
367f69a439
60 files changed
+29
-30
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import GuestView from "@/components/home/guest-view";
|
||||
import UserView from "@/components/home/user-view";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function HomePage() {
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user) {
|
||||
return <GuestView />;
|
||||
}
|
||||
|
||||
const dbUser = await prisma.user
|
||||
.findUnique({
|
||||
where: { id: Number(session.user.id) },
|
||||
select: { username: true, look: true },
|
||||
})
|
||||
.catch(() => null);
|
||||
|
||||
if (!dbUser) {
|
||||
return <p className="py-8 text-center text-gray-500">User not found.</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
<UserView
|
||||
userId={Number(session.user.id)}
|
||||
username={dbUser.username}
|
||||
look={dbUser.look}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user