From 9b8c697f667f861b3d5008f60e0f02585e963dfd Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Wed, 14 May 2025 20:13:25 +0100 Subject: [PATCH] feat: my likes page and redesign profile page --- src/app/mii/[id]/page.tsx | 6 +- src/app/profile/[id]/page.tsx | 8 +- src/app/profile/likes/page.tsx | 48 +++++++++++ src/app/profile/settings/page.tsx | 2 +- src/components/delete-mii.tsx | 2 +- src/components/mii-list/index.tsx | 15 +++- src/components/profile-information.tsx | 97 +++++++++++++---------- src/components/profile-settings/index.tsx | 2 +- src/components/tutorial/scan.tsx | 2 +- 9 files changed, 131 insertions(+), 51 deletions(-) create mode 100644 src/app/profile/likes/page.tsx diff --git a/src/app/mii/[id]/page.tsx b/src/app/mii/[id]/page.tsx index 46d08d7..d5204cd 100644 --- a/src/app/mii/[id]/page.tsx +++ b/src/app/mii/[id]/page.tsx @@ -205,12 +205,12 @@ export default async function MiiPage({ params }: Props) { {/* Buttons */} -
+
{session && (Number(session.user.id) === mii.userId || Number(session.user.id) === Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID)) && ( <> - Edit + Edit @@ -218,7 +218,7 @@ export default async function MiiPage({ params }: Props) { - Report + Report
diff --git a/src/app/profile/[id]/page.tsx b/src/app/profile/[id]/page.tsx index 76bad7d..7d4ec84 100644 --- a/src/app/profile/[id]/page.tsx +++ b/src/app/profile/[id]/page.tsx @@ -78,9 +78,11 @@ export default async function ProfilePage({ searchParams, params }: Props) { return (
- }> - - +
+ }> + + +
); } diff --git a/src/app/profile/likes/page.tsx b/src/app/profile/likes/page.tsx new file mode 100644 index 0000000..98fa49e --- /dev/null +++ b/src/app/profile/likes/page.tsx @@ -0,0 +1,48 @@ +import { Metadata } from "next"; +import { redirect } from "next/navigation"; +import { Suspense } from "react"; + +import { auth } from "@/lib/auth"; + +import ProfileInformation from "@/components/profile-information"; +import Skeleton from "@/components/mii-list/skeleton"; +import MiiList from "@/components/mii-list"; + +interface Props { + searchParams: Promise<{ [key: string]: string | string[] | undefined }>; +} + +export const metadata: Metadata = { + title: "My Likes - TomodachiShare", + description: "View the Miis that you have liked on TomodachiShare", + robots: { + index: false, + follow: false, + }, +}; + +export default async function ProfileSettingsPage({ searchParams }: Props) { + const session = await auth(); + + if (!session) redirect("/login"); + + return ( +
+ +
+
+

My Likes

+

View every Mii you have liked on TomodachiShare.

+
+ +
+
+
+ + }> + + +
+
+ ); +} diff --git a/src/app/profile/settings/page.tsx b/src/app/profile/settings/page.tsx index 0a32a2a..0ebb56b 100644 --- a/src/app/profile/settings/page.tsx +++ b/src/app/profile/settings/page.tsx @@ -22,7 +22,7 @@ export default async function ProfileSettingsPage() { return (
- +
); diff --git a/src/components/delete-mii.tsx b/src/components/delete-mii.tsx index 18500b2..cb2f846 100644 --- a/src/components/delete-mii.tsx +++ b/src/components/delete-mii.tsx @@ -53,7 +53,7 @@ export default function DeleteMiiButton({ miiId, miiName, likes, inMiiPage }: Pr {inMiiPage ? ( ) : ( {isOpen &&