|
1 | 1 | 'use client' |
2 | 2 |
|
3 | 3 | import { useEffect, useState } from 'react' |
4 | | -import Link from 'next/link' |
| 4 | +import { useRouter } from 'next/navigation' |
5 | 5 | import { Button } from '@/components/ui/button' |
6 | 6 | import { useBrandConfig } from '@/lib/branding/branding' |
7 | | -import AuthBackground from '@/app/(auth)/components/auth-background' |
8 | 7 | import Nav from '@/app/(landing)/components/nav/nav' |
9 | | - |
10 | | -function isColorDark(hexColor: string): boolean { |
11 | | - const hex = hexColor.replace('#', '') |
12 | | - const r = Number.parseInt(hex.substring(0, 2), 16) |
13 | | - const g = Number.parseInt(hex.substring(2, 4), 16) |
14 | | - const b = Number.parseInt(hex.substring(4, 6), 16) |
15 | | - const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255 |
16 | | - return luminance < 0.5 |
17 | | -} |
| 8 | +import { inter } from '@/app/fonts/inter' |
| 9 | +import { soehne } from '@/app/fonts/soehne/soehne' |
18 | 10 |
|
19 | 11 | export default function NotFound() { |
20 | 12 | const [buttonClass, setButtonClass] = useState('auth-button-gradient') |
21 | 13 | const brandConfig = useBrandConfig() |
| 14 | + const router = useRouter() |
22 | 15 |
|
23 | 16 | useEffect(() => { |
24 | | - const rootStyle = getComputedStyle(document.documentElement) |
25 | | - const brandBackground = rootStyle.getPropertyValue('--brand-background-hex').trim() |
26 | | - |
27 | | - if (brandBackground && isColorDark(brandBackground)) { |
28 | | - document.body.classList.add('auth-dark-bg') |
29 | | - } else { |
30 | | - document.body.classList.remove('auth-dark-bg') |
| 17 | + const root = document.documentElement |
| 18 | + const hadDark = root.classList.contains('dark') |
| 19 | + const hadLight = root.classList.contains('light') |
| 20 | + root.classList.add('light') |
| 21 | + root.classList.remove('dark') |
| 22 | + return () => { |
| 23 | + if (!hadLight) root.classList.remove('light') |
| 24 | + if (hadDark) root.classList.add('dark') |
31 | 25 | } |
32 | 26 | }, []) |
33 | 27 |
|
@@ -55,36 +49,46 @@ export default function NotFound() { |
55 | 49 | }, []) |
56 | 50 |
|
57 | 51 | return ( |
58 | | - <AuthBackground> |
59 | | - <main className='relative flex min-h-screen flex-col font-geist-sans text-foreground'> |
60 | | - {/* Header */} |
61 | | - <Nav hideAuthButtons={true} variant='auth' /> |
| 52 | + <div className='min-h-screen bg-white'> |
| 53 | + <Nav variant='auth' /> |
| 54 | + <div className='flex min-h-[calc(100vh-120px)] items-center justify-center px-4'> |
| 55 | + <div className='w-full max-w-[410px]'> |
| 56 | + <div className='flex flex-col items-center justify-center'> |
| 57 | + <div className='space-y-1 text-center'> |
| 58 | + <h1 |
| 59 | + className={`${soehne.className} font-medium text-[32px] text-black tracking-tight`} |
| 60 | + > |
| 61 | + Page Not Found |
| 62 | + </h1> |
| 63 | + <p className={`${inter.className} font-[380] text-[16px] text-muted-foreground`}> |
| 64 | + The page you’re looking for doesn’t exist or has been moved. |
| 65 | + </p> |
| 66 | + </div> |
62 | 67 |
|
63 | | - {/* Content */} |
64 | | - <div className='relative z-30 flex flex-1 items-center justify-center px-4 pb-24'> |
65 | | - <div className='text-center'> |
66 | | - <div className='mb-4 font-bold text-8xl text-foreground'>404</div> |
67 | | - <div className='mb-8'> |
| 68 | + <div className='mt-8 w-full space-y-3'> |
68 | 69 | <Button |
69 | | - asChild |
| 70 | + type='button' |
| 71 | + onClick={() => router.push('/')} |
70 | 72 | className={`${buttonClass} flex w-full items-center justify-center gap-2 rounded-[10px] border font-medium text-[15px] text-white transition-all duration-200`} |
71 | 73 | > |
72 | | - <Link href='/'>Back to Workspace</Link> |
| 74 | + Return to Home |
73 | 75 | </Button> |
74 | 76 | </div> |
75 | 77 |
|
76 | | - <div className='text-center text-muted-foreground text-sm'> |
| 78 | + <div |
| 79 | + className={`${inter.className} auth-text-muted fixed right-0 bottom-0 left-0 z-50 pb-8 text-center font-[340] text-[13px] leading-relaxed`} |
| 80 | + > |
77 | 81 | Need help?{' '} |
78 | 82 | <a |
79 | 83 | href={`mailto:${brandConfig.supportEmail}`} |
80 | | - className='underline-offset-4 transition hover:underline' |
| 84 | + className='auth-link underline-offset-4 transition hover:underline' |
81 | 85 | > |
82 | 86 | Contact support |
83 | 87 | </a> |
84 | 88 | </div> |
85 | 89 | </div> |
86 | 90 | </div> |
87 | | - </main> |
88 | | - </AuthBackground> |
| 91 | + </div> |
| 92 | + </div> |
89 | 93 | ) |
90 | 94 | } |
0 commit comments