Skip to content
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

feat: 404 page #1082

Merged
merged 1 commit into from
Oct 11, 2024
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
2 changes: 2 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Toaster } from 'sonner'
import { useStickyState } from './hooks/useStickyState'
import MobileTabsPage from './pages/MobileTabsPage'
import Cookies from 'js-cookie'
import { lazy } from 'react'

/** Following keys will not be cached in app cache */
const NO_CACHE_KEYS = [
Expand Down Expand Up @@ -83,6 +84,7 @@ const router = createBrowserRouter(
</Route> */}
</Route>
</Route>
<Route path='*' lazy={() => import('./pages/NotFound')} />
</>
), {
basename: `/${import.meta.env.VITE_BASE_NAME}` ?? '',
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/pages/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Stack } from '@/components/layout/Stack'
import { Button, Flex, Heading, Text } from '@radix-ui/themes'
import { Link } from 'react-router-dom'

type Props = {}

const NotFoundPage = (props: Props) => {
return (
<Flex className='h-screen w-screen bg-gray-2' align='center' justify='center'>
<Stack gap='4'>
<Heading as='h1' size='5' className='text-center not-cal'>Page not found.</Heading>
<Text>You have ventured too far beyond the wall.</Text>

<Button variant='ghost' size='3' asChild className='not-cal hover:bg-transparent hover:text-accent-12'>
<Link to='/'>Go Back</Link>
</Button>
</Stack>
</Flex>
)
}

export const Component = NotFoundPage
Loading