forked from b00tc4mp/isdi-bootcamp-202405
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement not found page when accessing unknown paths b00tc4mp#84
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
staff/marti-herms/project/V-HUB/app/images/space_invaders_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useLocation, useNavigate } from 'react-router-dom' | ||
import { AiOutlineRollback as GoBackIcon } from 'react-icons/ai' | ||
|
||
import Container from '../library/Container' | ||
import Image from '../library/Image' | ||
import Paragraph from '../library/Paragraph' | ||
import Button from '../library/Button' | ||
|
||
export default function NotFoundError() { | ||
const location = useLocation() | ||
const navigate = useNavigate() | ||
|
||
const handleGoBack = () => { | ||
const canGoBack = location.key !== 'default' | ||
const href = canGoBack ? -1 : '/' | ||
|
||
navigate(href) | ||
} | ||
|
||
return <Container className='flex flex-col justify-center items-center gap-4 w-full h-[87vh]' > | ||
<Paragraph className='dark:text-white text-4xl font-bold'>ERROR! ERROR!</Paragraph> | ||
<Image src='../../images/space_invaders_icon.svg' className='w-[60%] h-auto dark:invert' /> | ||
<Paragraph className='dark:text-white text-4xl font-bold'>PAGE NOT FOUND</Paragraph> | ||
<Button className='bg-blue-500 rounded p-2' onClick={handleGoBack}><GoBackIcon className='w-16 h-16 dark:text-white' /></Button> | ||
</Container> | ||
} |
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