Skip to content

Commit

Permalink
chore: update files
Browse files Browse the repository at this point in the history
  • Loading branch information
haru52 committed Jun 16, 2024
1 parent 21439e1 commit 9c7749d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/app/[userScreenName]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import { notFound, redirect } from "next/navigation";
import { EditForm } from "~/app/_components/[userScreenName]/edit-form";
import { getServerAuthSession } from "~/server/auth";
import { DeleteUserLink } from "~/app/_components/delete-user-link";
import type { Metadata } from "next";

const title = "プロフィールを編集";

export const metadata: Metadata = {
title,
};

export default async function Page({
params,
Expand All @@ -18,7 +25,7 @@ export default async function Page({

return (
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1 className="text-center">{user.name}のプロフィールを編集</h1>
<h1 className="text-center">{title}</h1>
<EditForm user={user} />
<DeleteUserLink />
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/[userScreenName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export const generateMetadata = async ({
params: { userScreenName: string };
}): Promise<Metadata> => {
const user = await api.user.getByScreenName(params.userScreenName);
if (user === null) return { title: "404 Not Found" };

return {
title: user?.name ?? "User",
title: `${user.name}(@${user.screenName})さん`,
};
};

Expand Down

0 comments on commit 9c7749d

Please sign in to comment.