-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #622 from kethesainikhil/erorr/redirect
redirect to home fixed from InHouseError page
- Loading branch information
Showing
1 changed file
with
35 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
'use client'; | ||
import Link from 'next/link'; | ||
import { useRouter } from 'next/navigation'; | ||
import { useEffect } from 'react'; | ||
export default function GlobalError() { | ||
const router = useRouter(); | ||
useEffect(() => { | ||
// Set the title dynamically | ||
document.title = '404: Page could not be found'; | ||
}, []); | ||
const handleClick = () => { | ||
document.title = | ||
'Take your development skills from 0 to 100 and join the 100xdevs community'; | ||
router.push('/'); | ||
}; | ||
return ( | ||
<html> | ||
<head> | ||
<title>404: Page could not be found</title> | ||
</head> | ||
<body> | ||
<div className="text-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 "> | ||
<h1 className="mb-4 text-6xl font-semibold text-red-500">404</h1> | ||
<p className="mb-4 text-lg dark:text-white">Oops! Page Not Found.</p> | ||
<div className="animate-bounce"> | ||
<svg | ||
className="mx-auto h-16 w-16 text-red-500" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor" | ||
> | ||
<path | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" | ||
></path> | ||
</svg> | ||
</div> | ||
<Link | ||
href="/" | ||
className="mt-2 inline-block rounded bg-blue-500 px-4 py-2 font-semibold dark:text-white hover:bg-blue-600" | ||
> | ||
{' '} | ||
Go back to Home{' '} | ||
</Link> | ||
<div className="text-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 "> | ||
<h1 className="mb-4 text-6xl font-semibold text-red-500">404</h1> | ||
<p className="mb-4 text-lg dark:text-white">Oops! Page Not Found.</p> | ||
<div className="animate-bounce"> | ||
<svg | ||
className="mx-auto h-16 w-16 text-red-500" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" | ||
></path> | ||
</svg> | ||
</div> | ||
<button onClick={handleClick}> | ||
<div className="mt-2 inline-block rounded bg-blue-500 px-4 py-2 font-semibold dark:text-white hover:bg-blue-600"> | ||
Go back to Home | ||
</div> | ||
</body> | ||
</html> | ||
</button> | ||
</div> | ||
); | ||
} |