-
Notifications
You must be signed in to change notification settings - Fork 1
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 #12 from ITurres/feature/404-NotFoundPage-and-hash…
…router-migration Issue #7 🎫: 404 not found page (component) and HashRouter migration
- Loading branch information
Showing
13 changed files
with
162 additions
and
39 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
This file was deleted.
Oops, something went wrong.
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
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
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
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,68 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import FloatingAstronaut from '../animations/FloatingAstronaut.tsx'; | ||
|
||
import '../../styles/pages/NotFoundPage.scss'; | ||
|
||
type NotFoundPageProps = { | ||
fromPath: string; | ||
}; | ||
|
||
const AstronautStyleProps = { | ||
animationSpeed: 45, | ||
maxWidth: 50, | ||
move: { | ||
fromTop: 200, | ||
toTop: 270, | ||
fromLeft: -50, | ||
toLeft: 100, | ||
fromRight: 0, | ||
toRight: 0, | ||
}, | ||
rotation: { | ||
rotate: -130, | ||
}, | ||
}; | ||
|
||
const NotFoundPage: React.FC<NotFoundPageProps> = ({ fromPath }) => { | ||
const isWildCardAtAccessPage = fromPath === '/'; | ||
|
||
const pathTo = isWildCardAtAccessPage ? '/' : '/homepage'; | ||
|
||
return ( | ||
<main className="not-found-page"> | ||
<FloatingAstronaut | ||
animationSpeed={AstronautStyleProps.animationSpeed} | ||
maxWidth={AstronautStyleProps.maxWidth} | ||
move={AstronautStyleProps.move} | ||
rotation={AstronautStyleProps.rotation} | ||
/> | ||
|
||
<header> | ||
<h2 className="text-hue-rotate"> | ||
<span>🚀</span> | ||
Oops! It looks like you've drifted off course! | ||
<span>🌌</span> | ||
</h2> | ||
<p> | ||
Houston, we have a problem... The page you're searching for seems | ||
to have floated away into the cosmic abyss. Our astronauts are out | ||
there on a mission to find it, but in the meantime, why not explore | ||
some of the other stellar destinations on the portfolio? | ||
</p> | ||
<Link | ||
to={pathTo} | ||
rel="noreferrer noopener" | ||
className="my-btn not-found-page-btn text-hue-rotate static-shadow" | ||
> | ||
{isWildCardAtAccessPage | ||
? 'Go back to the Access Page' | ||
: 'Go back to the Home Page'} | ||
</Link> | ||
</header> | ||
</main> | ||
); | ||
}; | ||
|
||
export default NotFoundPage; |
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
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,58 @@ | ||
@use '../variables/colors' as colors; | ||
@use '../variables/fonts' as fonts; | ||
|
||
$color1: colors.$color1; | ||
$color2-hover: colors.$color2-hover; | ||
$font-family-regular: fonts.$font-family-regular; | ||
|
||
.not-found-page { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
|
||
header { | ||
text-align: center; | ||
padding: 0.5rem; | ||
|
||
h2 { | ||
font-size: 1.2em; | ||
font-weight: 900; | ||
margin-bottom: 1rem; | ||
color: $color1; | ||
|
||
span { | ||
font-size: 1.5rem; | ||
} | ||
} | ||
|
||
p { | ||
font-family: 'Jura', sans-serif; | ||
font-size: 1.1rem; | ||
padding-bottom: 2rem; | ||
max-width: 500px; | ||
margin: 0 auto; | ||
} | ||
} | ||
} | ||
|
||
.not-found-page-btn { | ||
text-decoration: none; | ||
font-size: 0.8rem; | ||
font-family: $font-family-regular; | ||
background-color: transparent; | ||
border-radius: 0.5rem; | ||
color: $color2-hover; | ||
border: 1px solid $color2-hover; | ||
margin-top: 4rem; | ||
padding: 0.9rem 2rem; | ||
transition: all 0.3s ease; | ||
|
||
&:hover { | ||
box-shadow: 0 0 200px $color2-hover; | ||
} | ||
|
||
&:focus { | ||
box-shadow: 0 0 10px $color2-hover; | ||
} | ||
} |