Skip to content

Commit cddc169

Browse files
kuco23claude
andcommitted
claude:design: center 404 page and hide Earn Yield CTA on it
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 978ccc6 commit cddc169

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/assets/css/error.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
text-align: left;
1313
}
1414

15+
.error-container--centered {
16+
align-items: center;
17+
text-align: center;
18+
min-height: 60vh;
19+
justify-content: center;
20+
padding: 64px 0;
21+
}
22+
23+
.error-container--centered .error-desc { margin-left: auto; margin-right: auto; }
24+
1525
.error-status {
1626
font-family: var(--font-sans);
1727
font-variant-numeric: tabular-nums;

src/layout/root.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Outlet, useLocation, useNavigation } from 'react-router-dom'
1+
import { Outlet, useLocation, useMatches, useNavigation } from 'react-router-dom'
22
import { ToastContainer } from 'react-toastify'
33
import { useGlobalStore } from '~/utils/store/global'
44
import { useShallow } from 'zustand/react/shallow'
@@ -48,6 +48,8 @@ const NavigationPreloader = () => {
4848

4949
const RootLayout = () => {
5050
const { pathname } = useLocation()
51+
const matches = useMatches()
52+
const hideCallToAction = matches.some(m => (m.handle as { hideCallToAction?: boolean } | undefined)?.hideCallToAction)
5153
const chain = chainFromRoute(pathname)
5254
const chainId = chainToChainId(chain)
5355
const image = chainToBackgroundImage(chain)
@@ -80,7 +82,7 @@ const RootLayout = () => {
8082
{image && <div className='background-image' style={{ backgroundImage: `url("${image}")` }} />}
8183
<CookiesProvider>
8284
<Outlet />
83-
<CallToAction />
85+
{!hideCallToAction && <CallToAction />}
8486
<Footer />
8587
</CookiesProvider>
8688
</div>

src/pages/notFound.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Link } from 'react-router-dom'
33
const NotFound = () => (
44
<section className="innerpage-single-area">
55
<div className="container">
6-
<div className="error-container">
6+
<div className="error-container error-container--centered">
77
<div className="error-status">404</div>
88
<div className="error-label">Page not found</div>
99
<p className="error-desc">

src/route/router.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const router = createHashRouter([
2222
lazyRoute("/flare/validator", () => import("../pages/protocols/flare-validator/page")),
2323
lazyRoute("/flare/fsp", () => import("../pages/protocols/flare-fsp/page")),
2424
lazyRoute("/songbird/fsp", () => import("../pages/protocols/songbird-fsp/page")),
25-
{ path: "*", element: <NotFound /> }
25+
{ path: "*", element: <NotFound />, handle: { hideCallToAction: true } }
2626
]
2727
}
2828
])

0 commit comments

Comments
 (0)