Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
81 changes: 81 additions & 0 deletions src/app/error.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
.container {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
padding: 2rem;
text-align: center;
background: var(--background);
}

.card {
width: 100%;
max-width: 460px;
padding: 2rem;
border-radius: 18px;
background: var(--background);
border: 1px solid #e5e7eb;
box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.title {
margin: 0 0 1rem;
font-size: 1.75rem;
line-height: 1.1;
color: var(--foreground);
}

.description {
margin: 0 0 1.75rem;
color: #475569;
line-height: 1.75;
}

.button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 44px;
padding: 0.9rem 1.25rem;
border: none;
border-radius: 10px;
background-color: #2563eb;
color: #ffffff;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s ease;
}

.button:hover:not(:disabled) {
background-color: #1d4ed8;
}

.button:focus-visible {
outline: 3px solid #2563eb;
outline-offset: 2px;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

@media (prefers-color-scheme: dark) {
.card {
border-color: #444;
box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.description {
color: #aaa;
}

.button {
background-color: #3b82f6;
}

.button:hover:not(:disabled) {
background-color: #60a5fa;
}

.button:focus-visible {
outline-color: #60a5fa;
}
}
24 changes: 24 additions & 0 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import style from "./error.module.css";
Comment thread
rotarymars marked this conversation as resolved.

interface ErrorProps {
error: Error & { digest?: string };
reset: () => void;
}

export default function ErrorPage({ error, reset }: ErrorProps) {

Check warning on line 10 in src/app/error.tsx

View workflow job for this annotation

GitHub Actions / Lint Check

'error' is defined but never used

Check warning on line 10 in src/app/error.tsx

View workflow job for this annotation

GitHub Actions / Lint Check

'error' is defined but never used

Check warning on line 10 in src/app/error.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'error' is defined but never used
Comment thread
rotarymars marked this conversation as resolved.
return (
<div className={style.container}>
<div className={style.card}>
<h1 className={style.title}>エラーが発生しました</h1>
<p className={style.description}>
予期せぬエラーが発生しました。しばらくしてからもう一度お試しください。
</p>
<button type="button" className={style.button} onClick={reset}>
再読み込み
</button>
</div>
</div>
);
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
Expand Down
Loading