Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors and loading #50

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions src/components/App/App.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import {useState} from 'react';
import {Routes, Route, Link} from 'react-router-dom';
import {Routes, Route} from 'react-router-dom';
import Menu from '../Menu/Menu';
import Nav from '../Nav/Nav';
import Home from '../Home/Home';
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 ?
<nav className='menu'>
<span class='material-symbols-rounded' id='menu__exit' onClick={() => setIsOpen(!isOpen)}>
close
</span>
<div className='top-nav__buttons menu__buttons'>
<Link to='/' onClick={() => setIsOpen(!isOpen)}className='menu__button'>Home</Link>
<Link to='/about' onClick={() => setIsOpen(!isOpen)} className='menu__button'>About</Link>
<Link to='/portfolio' onClick={() => setIsOpen(!isOpen)} className='menu__button'>Portfolio</Link>
<Link to='/contact' onClick={() => setIsOpen(!isOpen)} className='menu__button'>Contact</Link>
</div>
</nav>
{isOpen ?
<Menu isOpen={isOpen} setIsOpen={setIsOpen} />
:
<>
<Nav isOpen={isOpen} setIsOpen={setIsOpen} />
Expand All @@ -34,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
19 changes: 0 additions & 19 deletions src/components/App/_App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,6 @@ button:hover,
font-size: 3rem;
}

.menu {
display: flex;
flex-direction: column;
position: relative;
z-index: 1;
margin: 3rem;
}

#menu__exit {
align-self: flex-end;
}

.menu__buttons {
@include center-column;
}

.menu__button {
margin: 1rem;
}
@keyframes button-fade {
to {
@include button-hover;
Expand Down
3 changes: 0 additions & 3 deletions src/components/BurgerNav/_BurgerNav.scss

This file was deleted.

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;
}
19 changes: 19 additions & 0 deletions src/components/Menu/Menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {Link} from 'react-router-dom';

const Menu = ({isOpen, setIsOpen}) => {
return (
<nav className='menu'>
<span class='material-symbols-rounded' id='menu__exit' onClick={() => setIsOpen(!isOpen)}>
close
</span>
<div className='top-nav__buttons menu__buttons'>
<Link to='/' onClick={() => setIsOpen(!isOpen)}className='menu__button'>Home</Link>
<Link to='/about' onClick={() => setIsOpen(!isOpen)} className='menu__button'>About</Link>
<Link to='/portfolio' onClick={() => setIsOpen(!isOpen)} className='menu__button'>Portfolio</Link>
<Link to='/contact' onClick={() => setIsOpen(!isOpen)} className='menu__button'>Contact</Link>
</div>
</nav>
)
}

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

.menu {
display: flex;
flex-direction: column;
position: relative;
z-index: 1;
margin: 3rem;
}

#menu__exit {
align-self: flex-end;
}

.menu__buttons {
@include center-column;
}

.menu__button {
margin: 1rem;
}
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';
36 changes: 14 additions & 22 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.