diff --git a/src/app/(home-page)/page.jsx b/src/app/(home-page)/page.jsx
index 9ef293a557..85c12528c2 100644
--- a/src/app/(home-page)/page.jsx
+++ b/src/app/(home-page)/page.jsx
@@ -24,24 +24,24 @@ const jsonLd = {
url: 'https://neon.tech/',
};
-const Homepage = () => {
- return <>
-
-
-
-
-
-
-
-
-
-
-
- >
-}
+const Homepage = () => (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
export default Homepage;
diff --git a/src/app/error.jsx b/src/app/error.jsx
new file mode 100644
index 0000000000..c9abd7836b
--- /dev/null
+++ b/src/app/error.jsx
@@ -0,0 +1,40 @@
+'use client';
+
+import PropTypes from 'prop-types';
+import { useEffect } from 'react';
+
+import Hero from 'components/pages/error/hero';
+import Layout from 'components/shared/layout';
+import SEO_DATA from 'constants/seo-data';
+
+/*
+ NOTE:
+ This page is needed to handle unexpected errors and display fallback UI.
+*/
+const ErrorPage = ({ error, reset }) => {
+ useEffect(() => {
+ // eslint-disable-next-line no-console
+ console.error(error);
+ }, [error]);
+
+ return (
+ <>
+
{SEO_DATA.error.title}
+
+
+
+
+ >
+ );
+};
+
+ErrorPage.propTypes = {
+ error: PropTypes.object,
+ reset: PropTypes.func,
+};
+
+export default ErrorPage;
diff --git a/src/app/not-found.jsx b/src/app/not-found.jsx
index d4d4c7475b..e8c97a0f86 100644
--- a/src/app/not-found.jsx
+++ b/src/app/not-found.jsx
@@ -1,4 +1,4 @@
-import Hero from 'components/pages/404/hero';
+import Hero from 'components/pages/error/hero';
import Layout from 'components/shared/layout';
import SEO_DATA from 'constants/seo-data';
@@ -12,7 +12,10 @@ const NotFoundPage = () => (
{SEO_DATA[404].title}
-
+
>
);
diff --git a/src/components/pages/404/hero/images/illustration.jpg b/src/components/pages/404/hero/images/illustration.jpg
deleted file mode 100644
index 814eb3546a..0000000000
Binary files a/src/components/pages/404/hero/images/illustration.jpg and /dev/null differ
diff --git a/src/components/pages/404/hero/hero.jsx b/src/components/pages/error/hero/hero.jsx
similarity index 54%
rename from src/components/pages/404/hero/hero.jsx
rename to src/components/pages/error/hero/hero.jsx
index d041ddc416..b8b245743a 100644
--- a/src/components/pages/404/hero/hero.jsx
+++ b/src/components/pages/error/hero/hero.jsx
@@ -12,22 +12,36 @@ import Link from 'components/shared/link';
import illustration from './images/illustration.png';
-const CTA = ({ isDocsPage = false }) =>
+const CTA = ({ isDocsPage = false, reset }) =>
isDocsPage ? (
-
- Back to home
+
+ Back to Home
) : (
-
+
+ {reset ? (
+ <>
+
+
+ Back to Home
+
+ >
+ ) : (
+
+ )}
+
);
CTA.propTypes = {
isDocsPage: PropTypes.bool,
+ reset: PropTypes.func,
};
const Skeleton = () => (
@@ -38,7 +52,7 @@ const Skeleton = () => (
);
-const Hero = () => {
+const Hero = ({ title, text, reset }) => {
const pathname = usePathname();
const [isDocsPage, setIsDocsPage] = useState(false);
const [isLoading, setIsLoading] = useState(true);
@@ -49,21 +63,22 @@ const Hero = () => {
}, [pathname]);
return (
-
-
-
-
+
+
+
+
Ooops!
-
Page not found...
+
+ {title}
-
- Sorry, the page you are looking for doesn’t exist or has been moved.
-
-
- {isLoading ?
:
}
+
{text}
+ {isLoading ?
:
}
-
+
{
);
};
+Hero.propTypes = {
+ title: PropTypes.string,
+ text: PropTypes.string,
+ reset: PropTypes.func,
+};
+
export default Hero;
diff --git a/src/components/pages/404/hero/images/illustration.png b/src/components/pages/error/hero/images/illustration.png
similarity index 100%
rename from src/components/pages/404/hero/images/illustration.png
rename to src/components/pages/error/hero/images/illustration.png
diff --git a/src/components/pages/404/hero/index.js b/src/components/pages/error/hero/index.js
similarity index 100%
rename from src/components/pages/404/hero/index.js
rename to src/components/pages/error/hero/index.js
diff --git a/src/components/shared/header/header.jsx b/src/components/shared/header/header.jsx
index 7195d7bae6..6c9d044c10 100644
--- a/src/components/shared/header/header.jsx
+++ b/src/components/shared/header/header.jsx
@@ -22,7 +22,7 @@ const themePropTypes = {
isDarkTheme: PropTypes.bool,
};
-const Navigation = async ({ isDarkTheme }) => (
+const Navigation = ({ isDarkTheme }) => (
-
+
@@ -252,7 +263,7 @@ const Header = async ({
/>
-
+
)}
@@ -280,6 +291,7 @@ Header.propTypes = {
title: PropTypes.string,
link: PropTypes.string,
}),
+ isClient: PropTypes.bool,
};
export default Header;
diff --git a/src/components/shared/layout/layout.jsx b/src/components/shared/layout/layout.jsx
index 0852a4f349..16b9bd01d9 100644
--- a/src/components/shared/layout/layout.jsx
+++ b/src/components/shared/layout/layout.jsx
@@ -22,6 +22,7 @@ const Layout = ({
isPostgresPage = false,
searchIndexName = null,
customType = null,
+ isClient = false,
}) => (
<>
@@ -40,6 +41,7 @@ const Layout = ({
withBorder={headerWithBorder}
searchIndexName={searchIndexName}
customType={customType}
+ isClient={isClient}
/>
(
isDarkTheme ? 'text-gray-new-90' : 'text-gray-new-15'
)}
>
- Is your RDS bill bloated? Cut up to 75% in compute costs with autoscaling and scale-to-zero
+ Is your RDS bill bloated? Cut up to 75% in compute costs with autoscaling and scale-to-zero
`${SITE_URL}/tickets/${handle}/edit`;
export async function middleware(req) {
try {
const { pathname } = req.nextUrl;
-
+
try {
const isLoggedIn = await checkCookie('neon_login_indicator');
if (pathname === '/' && isLoggedIn) {