diff --git a/src/app/profile/[id]/page.tsx b/src/app/profile/[id]/page.tsx index d621992..422d218 100644 --- a/src/app/profile/[id]/page.tsx +++ b/src/app/profile/[id]/page.tsx @@ -47,7 +47,7 @@ export async function generateMetadata({ params }: Props): Promise { type: "profile", title: `${user.name} (@${user.username}) - TomodachiShare`, description: `View ${user.name}'s profile on TomodachiShare. Creator of ${user._count.miis} Miis. Member since ${joinDate}.`, - images: [user.image ?? "/guest.svg"], + images: [user.image ?? "/guest.webp"], username: user.username, firstName: user.name, }, @@ -55,7 +55,7 @@ export async function generateMetadata({ params }: Props): Promise { card: "summary", title: `${user.name} (@${user.username}) - TomodachiShare`, description: `View ${user.name}'s profile on TomodachiShare. Creator of ${user._count.miis} Miis. Member since ${joinDate}.`, - images: [user.image ?? "/guest.svg"], + images: [user.image ?? "/guest.webp"], creator: user.username!, }, alternates: { diff --git a/src/components/admin/user-management.tsx b/src/components/admin/user-management.tsx index 59ae23b..ccfc4f2 100644 --- a/src/components/admin/user-management.tsx +++ b/src/components/admin/user-management.tsx @@ -2,12 +2,12 @@ "use client"; -import Image from "next/image"; import { useState } from "react"; import { Icon } from "@iconify/react"; import { Prisma, PunishmentType } from "@prisma/client"; +import ProfilePicture from "../profile-picture"; import SubmitButton from "../submit-button"; import PunishmentDeletionDialog from "./punishment-deletion-dialog"; @@ -112,7 +112,7 @@ export default function Punishments() {
- Profile picture +

{user.name}

@{user.username}

diff --git a/src/components/profile-information.tsx b/src/components/profile-information.tsx index 1d2f205..5d71176 100644 --- a/src/components/profile-information.tsx +++ b/src/components/profile-information.tsx @@ -1,10 +1,11 @@ import Link from "next/link"; -import Image from "next/image"; import { Icon } from "@iconify/react"; import { auth } from "@/lib/auth"; import { prisma } from "@/lib/prisma"; +import ProfilePicture from "./profile-picture"; + interface Props { userId?: number; page?: "settings" | "likes"; @@ -28,13 +29,7 @@ export default async function ProfileInformation({ userId, page }: Props) {
{/* Profile picture */} - profile picture + {/* User information */}
diff --git a/src/components/profile-picture.tsx b/src/components/profile-picture.tsx new file mode 100644 index 0000000..4bc11fe --- /dev/null +++ b/src/components/profile-picture.tsx @@ -0,0 +1,11 @@ +"use client"; + +import Image, { ImageProps } from "next/image"; +import { useState } from "react"; + +export default function ProfilePicture(props: Partial) { + const { src, ...rest } = props; + const [imgSrc, setImgSrc] = useState(src); + + return {"profile setImgSrc("/guest.webp")} />; +} diff --git a/src/components/report/user-form.tsx b/src/components/report/user-form.tsx index 7e5ed77..1fe90b8 100644 --- a/src/components/report/user-form.tsx +++ b/src/components/report/user-form.tsx @@ -1,11 +1,11 @@ "use client"; -import Image from "next/image"; import { redirect } from "next/navigation"; import { useState } from "react"; import { ReportReason, User } from "@prisma/client"; +import ProfilePicture from "../profile-picture"; import ReasonSelector from "./reason-selector"; import SubmitButton from "../submit-button"; @@ -43,13 +43,7 @@ export default function ReportUserForm({ user }: Props) {
- profile picture +

{user.name}

@{user.username}