Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d2cce8e
refactor: EngineerとDeveloperの表記をEngineerで統一。
tanahiro2010 Mar 28, 2026
642c609
style: interface順にメンバーデータのキーをソート
tanahiro2010 Mar 28, 2026
7466654
refactor: 各ページコンポーネントの名前を適切に修正
tanahiro2010 Mar 28, 2026
f021cd0
Merge branch 'main' into main
yuito-it Mar 28, 2026
b146332
feat: メンバーのロールとデータ構造を定義する形を追加
Mar 28, 2026
ae86af4
Merge branch 'gakuseiBOT:main' into main
tanahiro2010 Mar 28, 2026
dab68f7
feat: MemberData型を使用してBioCardコンポーネントのプロパティを定義
Mar 28, 2026
40ef3aa
feat: MemberData型を使用してメンバー情報を簡素化し、BioCardコンポーネントにプロパティを展開
Mar 28, 2026
686acb5
fix: 不要なReactインポートを削除
Mar 28, 2026
3e239c0
fix: アナウンスのURLを正しいドメインに修正
Mar 28, 2026
4a40f98
feat: UpdateDetailPageProps型を定義し、メタデータ生成関数を追加
Mar 28, 2026
dba4c4e
fix: 不要なReactインポートを削除
Mar 28, 2026
115a24c
Update src/app/member/page.tsx
tanahiro2010 Mar 28, 2026
51b3e5f
Update src/type/member.ts
tanahiro2010 Mar 28, 2026
5349c21
fix: 不要なインポートを削除
Mar 28, 2026
dc8412d
fix: 不要なインポート、未使用の変数を削除し、引数名を修正
Mar 28, 2026
29b093a
fix: generateMetadata関数でアップデートが見つからない場合の処理を追加
Mar 28, 2026
51deaa8
feat: メタデータを定義し、ページタイトルと説明を追加
Mar 28, 2026
2ad5ba7
feat: Viewport設定を追加し、Metadataインポートを修正
Mar 28, 2026
aa30e65
refactor: 不要なHeadインポートとviewportメタタグを削除
Mar 28, 2026
57ae79b
fix: 他のページのメタデータと競合しないように、templateを削除
Mar 28, 2026
70f6201
feat: Headerと同様に、FooterもコンポーネントとしてLayoutから切り出し
Mar 29, 2026
7f13384
feat: HeaderとFooterコンポーネントを見つけやすいようにlayoutディレクトリに移動
Mar 29, 2026
25e951d
fix: HeaderとFooterのインポートパスを修正
Mar 29, 2026
63dd8f0
refactor: 投稿取得処理と最近の投稿取得処理をPromise.allでまとめる
tanahiro2010 Mar 29, 2026
1fc3d99
fix: どちらも関数は非同期でなかったため、通常取得に修正
tanahiro2010 Mar 29, 2026
4ca662b
fix: 非同期ではなかったので、awaitを削除
tanahiro2010 Mar 29, 2026
9dacd85
refactor: index.module.cssをスタイル用ディレクトリに移動
tanahiro2010 Mar 29, 2026
9287c27
fix: ファイル移動に伴い、スタイルのインポートパスを修正
tanahiro2010 Mar 29, 2026
0ac257c
refactor: globals.cssをスタイル用ディレクトリに移動
tanahiro2010 Mar 29, 2026
1a140b4
fix: ファイルの移動に伴い、スタイルのインポートパスを修正
tanahiro2010 Mar 29, 2026
85f74d5
refactor: useCallbackを使用してformattedDateとformattedTypeを最適化
tanahiro2010 Mar 29, 2026
97e7f15
refactor: useMemoを使用してスライド設定を最適化
tanahiro2010 Mar 29, 2026
7a46734
refactor: TypeScriptの型定義を改善し、型の一貫性を向上
tanahiro2010 Mar 29, 2026
31e7d85
Merge branch 'gakuseiBOT:main' into main
tanahiro2010 Apr 1, 2026
2ab4e14
Apply suggestions from code review
tanahiro2010 Jul 24, 2026
5646cae
fix: updateがなかった時のエラーハンドリングを追加
tanahiro2010 Jul 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/announce/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function generateMetadata({ params }: PostPageProps): Promise<Metad
title: post.title,
description: post.description || '詳細はこの記事をご覧ください。',
type: 'article',
url: `https://announce/${slug}`,
url: `https://gakuseibot.com/announce/${slug}`,
},
};
}
Expand Down
1 change: 0 additions & 1 deletion src/app/announce/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { NextPage } from 'next';
import React from 'react';
import { Metadata } from 'next';
import PostList from '@/components/PostList';
import { getAllPosts } from '@/lib/posts';
Expand Down
1 change: 0 additions & 1 deletion src/app/howto/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { NextPage } from 'next';
import React from 'react';
import { Metadata } from 'next';
import CmdCard from '@/components/cmdCard';

Expand Down
24 changes: 4 additions & 20 deletions src/app/member/page.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
import { NextPage } from 'next';
import React from 'react';
import { Metadata } from 'next';
import { MemberData } from '@/type/member';
import BioCard from '@/components/bioCard';

export const metadata: Metadata = {
title: '開発者紹介 - gakuseiBotコミュニティ',
description: 'gakuseiBOTの開発を支えるメンバーたちをご紹介します。',
};

interface MemberData {
name: string;
avatar?: string;
text: string;
homepage?: string;
twitter?: string;
github?: string;
role: "Owner" | "Engineer" | "Adviser" | "Moderator" | "Creator";
}

const MEMBER_DATA: MemberData[] = [
{
name: "aki._.yama",
Expand Down Expand Up @@ -121,16 +111,10 @@ const Member: NextPage = () => {
id="members"
className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2 p-20 justify-items-center items-center mx-auto max-w-7xl"
>
{ MEMBER_DATA.map((member, index) => (
{ MEMBER_DATA.map((member) => (
<BioCard
key={index}
avatar={member.avatar}
name={member.name}
role={member.role}
text={member.text}
homepage={member.homepage}
github={member.github}
twitter={member.twitter}
key={member.name}
{...member}
/>
))}
</section>
Expand Down
1 change: 0 additions & 1 deletion src/app/sponsor/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { NextPage } from 'next';
import React from 'react';
import { Metadata } from 'next';
import ReactMarkdown from 'react-markdown';

Expand Down
15 changes: 14 additions & 1 deletion src/app/updates/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@ import html from 'remark-html';
import Link from 'next/link';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';

export default async function UpdateDetailPage(props: { params: Promise<{ slug: string }> }) {
type UpdateDetailPageProps = {
params: Promise<{ slug: string }>;
}

export async function generateMetadata(props: UpdateDetailPageProps) {
const { slug } = await props.params;
const update = updates.find((u) => u.slug === slug);

return {
title: `${update?.title} - ${update?.date}`,
}
Comment thread
tanahiro2010 marked this conversation as resolved.
}
Comment on lines +16 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

update が見つからない場合のエラーハンドリングが欠けています。

slug に一致する更新情報が存在しない場合、updateundefined となり、タイトルが "undefined - undefined" になります。メインページコンポーネント(29行目)では notFound() を呼び出していますが、generateMetadata では同様の処理がありません。

🛠️ 修正案
 export async function generateMetadata(props: UpdateDetailPageProps) {
   const { slug } = await props.params;
   const update = updates.find((u) => u.slug === slug);
 
+  if (!update) {
+    return {
+      title: '更新情報が見つかりません',
+    };
+  }
+
   return {
-    title: `${update?.title} - ${update?.date}`,
+    title: `${update.title} - ${update.date}`,
   }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/updates/`[slug]/page.tsx around lines 16 - 23, generateMetadata
currently assumes updates.find(...) returns a value and produces "undefined -
undefined" when not found; update the function (generateMetadata) to check the
result of updates.find(...) (variable update) and call notFound() from
next/navigation when update is falsy, mirroring the main page behavior, and
ensure notFound is imported if not already present; alternatively provide a safe
fallback title only if you intentionally want metadata without 404, but the
preferred fix is to call notFound() when update is undefined.


export default async function UpdateDetailPage(props: UpdateDetailPageProps) {
const { slug } = await props.params;

const update = updates.find((u) => u.slug === slug);
Expand Down
12 changes: 2 additions & 10 deletions src/components/bioCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use client';
import * as React from 'react';
import Avatar from '@mui/joy/Avatar';
import Chip from '@mui/joy/Chip';
import Box from '@mui/joy/Box';
Expand All @@ -10,6 +9,7 @@ import Typography from '@mui/joy/Typography';
import LanguageIcon from '@mui/icons-material/Language';
import TwitterIcon from '@mui/icons-material/Twitter';
import GitHubIcon from '@mui/icons-material/GitHub';
import { MemberData } from '@/type/member';

export default function BioCard({
text,
Expand All @@ -19,15 +19,7 @@ export default function BioCard({
twitter,
github,
role,
}: {
text: string;
name: string;
avatar?: string;
homepage?: string;
twitter?: string;
github?: string;
role: string;
}) {
}: MemberData) {
return (
<Card sx={{ width: 320, maxWidth: '100%', boxShadow: 'lg' }}>
<CardContent sx={{ alignItems: 'center', textAlign: 'center' }}>
Expand Down
4 changes: 2 additions & 2 deletions src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { MouseEvent, ComponentPropsWithoutRef, JSX, Ref, forwardRef } from 'react'; // MouseEvent を追加
import { MouseEvent, ComponentPropsWithoutRef, JSX, forwardRef } from 'react'; // MouseEvent を追加
const styles = {
commonDesign: 'border-b text-black px-4 py-2 leading-none m-2',
linkDisabled: 'opacity-50 cursor-not-allowed leading-none',
Expand All @@ -25,7 +25,7 @@
* @returns {JSX.Element} - The rendered button component.
*/
// eslint-disable-next-line react/display-name
export const Button = forwardRef<HTMLButtonElement, Props<AS>>((props, ref) => {
export const Button = forwardRef<HTMLButtonElement, Props<AS>>((props, _) => {

Check warning on line 28 in src/components/button.tsx

View workflow job for this annotation

GitHub Actions / lint

'_' is defined but never used
Comment thread
tanahiro2010 marked this conversation as resolved.
Outdated
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
const router = useRouter();
const handleClick = (e: MouseEvent<HTMLButtonElement>, href: string) => {
e.preventDefault();
Expand All @@ -44,7 +44,7 @@
}*/

const buttonAttributes = props as ButtonProps;
const { disabled, ...linkAttributes } = props as unknown as CustomLinkProps;

Check warning on line 47 in src/components/button.tsx

View workflow job for this annotation

GitHub Actions / lint

'linkAttributes' is assigned a value but never used
return (
<>
<button
Expand Down
1 change: 0 additions & 1 deletion src/components/hamburger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { useState } from 'react';
import Link from 'next/link';
import NavLinks from '@/components/NavLinks';
import Image from 'next/image';

/**
* Hamburger component.
Expand Down
11 changes: 11 additions & 0 deletions src/type/member.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type MemberRole = 'Owner' | 'Engineer' | 'Adviser' | 'Moderator' | 'Creator';

export interface MemberData {
name: string;
avatar?: string;
text: string;
homepage?: string;
twitter?: string;
github?: string;
role: MemberRole;
}
Loading