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 15, 2024
1 parent a29dea9 commit f1db887
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 62 deletions.
6 changes: 3 additions & 3 deletions src/app/[userScreenName]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export default async function Page({
if (session.user.id !== user.id) notFound();

return (
<main className="container prose mx-auto px-4">
<h1 className="text-center">{user.name} のプロフィールを編集</h1>
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1 className="text-center">{user.name}のプロフィールを編集</h1>
<EditForm user={user} />
<DeleteUserLink />
</main>
</div>
);
}
2 changes: 1 addition & 1 deletion src/app/[userScreenName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function Page({
const socials = user.avatars.map((avatar) => avatar.social).sort(compare);
const posts = await api.post.getAllByUserId(user.id);
return (
<div className="container prose mx-auto px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<div className="not-prose avatar">
<div className="w-24 rounded-full">
<Image
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/avatars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function Avatars({
return (
<ul className="list-none pl-0">
{avatars.map((avatar) => (
<li key={avatar.id} className="mb-0 mt-1 pl-0">
<li key={avatar.id} className="mb-0 mt-0.5 pl-0">
<Avatar avatar={avatar} loginAvatarId={loginAvatarId} />
</li>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/app/_components/social-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function SocialDetail({
});

return (
<main className="container prose mx-auto px-4">
<>
<div className="not-prose avatar">
<div className="w-24 rounded-full">
<Image
Expand Down Expand Up @@ -100,6 +100,6 @@ export function SocialDetail({
</div>
)}
<Posts posts={posts} />
</main>
</>
);
}
4 changes: 2 additions & 2 deletions src/app/_components/social-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function SocialEdit({
const urlErrors = updateSocial.error?.data?.zodError?.fieldErrors.url;

return (
<main className="container prose mx-auto px-4">
<>
<h1>{social.name} を編集</h1>
<form
onSubmit={(e) => {
Expand Down Expand Up @@ -137,6 +137,6 @@ export function SocialEdit({
キャンセル
</button>
</form>
</main>
</>
);
}
2 changes: 1 addition & 1 deletion src/app/_components/users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function Users({ users }: { users: UserEntity[] }) {
return (
<ul className="list-none pl-0">
{users.map((user) => (
<li key={user.screenName} className="mb-0 mt-1 pl-0">
<li key={user.screenName} className="mb-0 mt-0.5 pl-0">
<User user={user} />
</li>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/app/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function Page() {
return (
<main className="container prose mx-auto my-6 px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1>Contact</h1>
</main>
</div>
);
}
4 changes: 2 additions & 2 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default function NotFound() {
return (
<main className="container prose mx-auto px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1>404 Not Found</h1>
</main>
</div>
);
}
31 changes: 13 additions & 18 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { getServerAuthSession } from "~/server/auth";
import { api } from "~/trpc/server";
import { Hero } from "./_components/hero";
import { redirect } from "next/navigation";
import { clsx } from "clsx";
import { Home } from "./_components/home";
import Link from "next/link";

Expand All @@ -13,24 +12,20 @@ export default async function Page() {
const avatars =
session === null ? null : await api.avatar.getMyAvatarsWithSocial();

return (
<div className={clsx({ "container prose mx-auto px-4": session !== null })}>
{session === null ? (
<Hero />
return session === null ? (
<Hero />
) : (
<div className="container prose mx-auto mb-10 mt-5 px-4">
{user !== null && avatars !== null && avatars.length >= 1 ? (
<Home user={user} avatars={avatars} />
) : (
<div className="mt-10">
{user !== null && avatars !== null && avatars.length >= 1 ? (
<Home user={user} avatars={avatars} />
) : (
<p>
まだ
<Link href="/socials" className="not-prose link-hover link">
ソーシャル
</Link>
に参加していません
</p>
)}
</div>
<p>
まだ
<Link href="/socials" className="not-prose link-hover link">
ソーシャル
</Link>
に参加していません
</p>
)}
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/app/privacy-policy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const metadata: Metadata = {

export default function Page() {
return (
<main className="container prose mx-auto my-6 px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1 className="text-center">プライバシーポリシー</h1>
<p className="text-right">2024 年 6 月 2 日</p>
<ol>
Expand All @@ -29,6 +29,6 @@ export default function Page() {
当サイトのユーザーがご自身のアカウントを削除された場合、当サイトが保有する当該のユーザー情報(個人情報)および当該ユーザーが作成したポストはすべて削除されます
</li>
</ol>
</main>
</div>
);
}
4 changes: 2 additions & 2 deletions src/app/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default async function Page({
: await api.post.searchInCurrentSocial(q);

return (
<main className="container prose mx-auto px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<Posts posts={posts} />
</main>
</div>
);
}
4 changes: 2 additions & 2 deletions src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default async function Page() {
return null;
}
return (
<main className="container prose mx-auto px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1>サインアップ</h1>
<SignupForm />
</main>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export default async function Page({
(loginAvatar) => loginAvatar.socialId === avatar.social.id,
);
return (
<main className="container prose mx-auto px-4">
<div className="container prose mx-auto px-4">
<h1>
{avatar.user.name}{avatar.user.screenName}.{avatar.social.screenName}
)さんのフォロワー
</h1>
<Avatars avatars={following} loginAvatarId={loginAvatar?.id} />
</main>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export default async function Page({
(loginAvatar) => loginAvatar.socialId === avatar.social.id,
);
return (
<main className="container prose mx-auto px-4">
<div className="container prose mx-auto px-4">
<h1>
{avatar.user.name}{avatar.user.screenName}.{avatar.social.screenName}
)さんがフォロー中
</h1>
<Avatars avatars={following} loginAvatarId={loginAvatar?.id} />
</main>
</div>
);
}
4 changes: 2 additions & 2 deletions src/app/socials/[screenName]/[avatarScreenName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default async function Page({
const posts = avatar.posts.reverse();

return (
<main className="container prose mx-auto px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<div className="not-prose avatar">
<div className="w-24 rounded-full">
<Image
Expand Down Expand Up @@ -99,6 +99,6 @@ export default async function Page({
</Link>
</p>
<Posts posts={posts} />
</main>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export default async function Page({
if (post === null) notFound();
const isAuthor = post.createdBy.userId === session.user.id;
return (
<main className="container prose mx-auto px-4 pt-5">
<div className="container prose mx-auto mb-10 mt-5 px-4 pt-5">
<PostDetailOrEdit post={post} isAuthor={isAuthor} />
</main>
</div>
);
}
6 changes: 3 additions & 3 deletions src/app/socials/[screenName]/avatars/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default async function Page({
? undefined
: loginUser.avatars.find((avatar) => avatar.socialId === social.id);
return (
<main className="container prose mx-auto px-4">
<h1>{social.name}のメンバー</h1>
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1 className="text-center">{social.name}のメンバー</h1>
<Avatars avatars={social.avatars} loginAvatarId={loginAvatar?.id} />
</main>
</div>
);
}
14 changes: 8 additions & 6 deletions src/app/socials/[screenName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ export default async function Page({
const avatar =
user === null ? null : await api.avatar.getMyAvatarBySocialId(social.id);
return (
<SocialDetailOrEdit
social={social}
user={user}
avatar={avatar}
posts={posts}
/>
<div className="container prose mx-auto mb-10 mt-5 px-4">
<SocialDetailOrEdit
social={social}
user={user}
avatar={avatar}
posts={posts}
/>
</div>
);
}
4 changes: 2 additions & 2 deletions src/app/socials/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { CreateSocialForm } from "~/app/_components/socials/create-social-form";

export default function Page() {
return (
<main className="container prose mx-auto px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1>ソーシャルを作成</h1>
<CreateSocialForm />
</main>
</div>
);
}
2 changes: 1 addition & 1 deletion src/app/socials/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default async function Page() {
const socials = await api.social.getAll();
const avatars = await api.avatar.getMyAvatars();
return (
<div className="container prose mx-auto my-10 px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1 className="text-center">ソーシャル</h1>
{session !== null && (
<Link href="/socials/new" className="btn btn-primary">
Expand Down
2 changes: 1 addition & 1 deletion src/app/terms-of-service/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const metadata: Metadata = {

export default function Page() {
return (
<div className="container prose mx-auto my-6 px-4">
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1 className="text-center">利用規約</h1>
<p className="text-right">2024 年 6 月 2 日</p>
<ol>
Expand Down
6 changes: 3 additions & 3 deletions src/app/users/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const metadata: Metadata = {
export default async function Page() {
const users = await api.user.getAll();
return (
<main className="container prose mx-auto px-4">
<h1>ユーザー</h1>
<div className="container prose mx-auto mb-10 mt-5 px-4">
<h1 className="text-center">ユーザー</h1>
<Users users={users} />
</main>
</div>
);
}

0 comments on commit f1db887

Please sign in to comment.