Skip to content

Commit

Permalink
Style error page for wrong urls
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelsoae committed Dec 29, 2023
1 parent adb4790 commit 84bb167
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/App/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import About from '../About/About';
import Contact from '../Contact/Contact';
import Portfolio from '../Portfolio/Portfolio';
import Footer from '../Footer/Footer';
import Error from '../Error/Error';

const App = () => {
const [isOpen, setIsOpen] = useState(false);

return (
<div className='app'>
{isOpen ?
{isOpen ?
<Menu isOpen={isOpen} setIsOpen={setIsOpen} />
:
<>
Expand All @@ -25,7 +26,7 @@ const App = () => {
<Route path='/about' element={<About />} />
<Route path='/contact' element={<Contact />} />
<Route path='/portfolio' element={<Portfolio />} />
<Route path='/error' />
<Route path='/*' element={<Error />} />
</Routes>
</div>
</main>
Expand Down
13 changes: 13 additions & 0 deletions src/components/Error/Error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {Link} from 'react-router-dom';

const Error = () => {
return (
<div className='contact'>
<h1 className='page-header'>Sorry...</h1>
<p>The page you are looking for does not exist.</p>
<Link to='/' className='redirect'>Go Home</Link>
</div>
)
}

export default Error;
13 changes: 13 additions & 0 deletions src/components/Error/_Error.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@use '../../styles/variables' as *;
@use '../../styles/mixins' as *;

.redirect {
color: $primary-accent-color;
@include body-font;
margin: 3rem;
text-decoration: none;
}

.redirect:hover {
@include inline-link-hover;
}
4 changes: 2 additions & 2 deletions src/styles/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@use '../components/Contact/Contact';
@use '../components/Home/Home';
@use '../components/Nav/Nav';
@use '../components/BurgerNav/BurgerNav';
@use '../components/TopNav/TopNav';
@use '../components/Portfolio/Portfolio';
@use '../components/Project/Project';
@use '../components/Footer/Footer';
@use '../components/Footer/Footer';
@use '../components/Error/Error';
14 changes: 14 additions & 0 deletions src/styles/output.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/styles/output.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 84bb167

Please sign in to comment.