-
Notifications
You must be signed in to change notification settings - Fork 34
Redesign database error page with improved UI #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Fixed wrong copyright notice to match the licence
Enhanced the database error page with a new layout and styling, including a reload button for user convenience.
WalkthroughAdds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
pages/db-error.tsx (2)
1-11: Consider using theuseRouterhook for modern Next.js patterns.The current implementation uses the legacy
Routerimport. While functional, Next.js recommends using theuseRouter()hook for better compatibility with React's rules of hooks and future Next.js versions.Apply this diff to modernize the routing approach:
-import { useEffect } from "react"; -import Router from "next/router"; +import { useEffect } from "react"; +import { useRouter } from "next/router"; export default function DatabaseErrorPage() { + const router = useRouter(); const isDbConfigured = process.env.NEXT_PUBLIC_DATABASE_CHECK === "true"; useEffect(() => { if (isDbConfigured) { - Router.replace("/"); + router.replace("/"); } - }, [isDbConfigured]); + }, [isDbConfigured, router]);
31-132: Consider using CSS custom properties for better maintainability.The styling uses hardcoded color values throughout. Using CSS custom properties would make it easier to maintain color consistency and adjust the theme in the future.
Example refactor with CSS variables:
<style jsx>{` + .db-container { + --color-bg-gradient-start: #18181b; + --color-bg-gradient-mid: #09090b; + --color-bg-gradient-end: #18181b; + --color-card-bg: rgba(24, 24, 27, 0.55); + --color-card-border: rgba(63, 63, 70, 0.8); + --color-title: #ff2b55; + --color-text: #d4d4d8; + --color-code-bg: rgba(63, 63, 70, 0.7); + --color-code-border: rgba(82, 82, 91, 0.7); + --color-code-text: #e4e4e7; + --color-btn-bg: #ff2b55; + } + .db-container { height: 100vh; display: flex; justify-content: center; align-items: center; padding: 24px; font-family: system-ui, sans-serif; - background: linear-gradient(to bottom, #18181b, #09090b, #18181b); + background: linear-gradient(to bottom, var(--color-bg-gradient-start), var(--color-bg-gradient-mid), var(--color-bg-gradient-end)); } .db-card { width: 100%; max-width: 480px; padding: 40px 36px; text-align: center; border-radius: 20px; - background: rgba(24, 24, 27, 0.55); - border: 1px solid rgba(63, 63, 70, 0.8); + background: var(--color-card-bg); + border: 1px solid var(--color-card-border); backdrop-filter: blur(12px); box-shadow: 0 0 40px rgba(0, 0, 0, 0.4); }
Summary by CodeRabbit
New Features
Style
Chores
✏️ Tip: You can customize this high-level summary in your review settings.