mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
refactor: profile components
why did I do it like that???
This commit is contained in:
parent
09c2448116
commit
c4a8e82313
3 changed files with 14 additions and 18 deletions
|
|
@ -77,8 +77,8 @@ export default async function ProfilePage({ params }: Props) {
|
|||
|
||||
return (
|
||||
<div>
|
||||
<ProfileInformation user={user} createdAt={user.createdAt} />
|
||||
<MiiList isLoggedIn={session?.user != null} userId={user?.id} sessionUserId={Number(session?.user.id ?? -1)} />
|
||||
<ProfileInformation userId={user.id} />
|
||||
<MiiList isLoggedIn={session?.user != null} userId={user.id} sessionUserId={Number(session?.user.id ?? -1)} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import { Metadata } from "next";
|
|||
import { redirect } from "next/navigation";
|
||||
|
||||
import { auth } from "@/lib/auth";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
import ProfileSettings from "@/components/profile-settings";
|
||||
import ProfileInformation from "@/components/profile-information";
|
||||
|
|
@ -21,11 +20,9 @@ export default async function ProfileSettingsPage() {
|
|||
|
||||
if (!session) redirect("/login");
|
||||
|
||||
const userExtra = await prisma.user.findUnique({ where: { id: Number(session.user.id) } });
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ProfileInformation createdAt={userExtra!.createdAt} inSettings />
|
||||
<ProfileInformation inSettings />
|
||||
<ProfileSettings />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue