Skip to content

Commit

Permalink
add navigation component
Browse files Browse the repository at this point in the history
  • Loading branch information
radykhovska committed Feb 28, 2025
1 parent de073c4 commit 48167ed
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
15 changes: 0 additions & 15 deletions src/components/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@
font-size: inherit;
}

.navigation__link {
display: inline-block;
outline: none;
text-decoration: none;
opacity: 0.7;
padding: 0 0.5em;
color: black;
transition: opacity 0.2s ease-in-out;
}

.navigation__link:hover,
.navigation__link:focus {
opacity: 1;
}

@media (min-width: 500px) {
.header {
text-align: left;
Expand Down
13 changes: 2 additions & 11 deletions src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import Navigation from '../Navigation/Navigation';
import './Header.css';

function Header() {
return (
<header className="header">
<h1 className="header__title">Site Name</h1>
<nav className="navigation">
<a className="navigation__link" href="#about">
About
</a>
<a className="navigation__link" href="#services">
Services
</a>
<a className="navigation__link" href="#contact">
Contact
</a>
</nav>
<Navigation />
</header>
);
}
Expand Down
14 changes: 14 additions & 0 deletions src/components/Navigation/Navigation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.navigation__link {
display: inline-block;
outline: none;
text-decoration: none;
opacity: 0.7;
padding: 0 0.5em;
color: black;
transition: opacity 0.2s ease-in-out;
}

.navigation__link:hover,
.navigation__link:focus {
opacity: 1;
}
19 changes: 19 additions & 0 deletions src/components/Navigation/Navigation.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import './Navigation.css';

function Navigation() {
return (
<nav className="navigation">
<a className="navigation__link" href="#about">
About
</a>
<a className="navigation__link" href="#services">
Services
</a>
<a className="navigation__link" href="#contact">
Contact
</a>
</nav>
);
}

export default Navigation;

0 comments on commit 48167ed

Please sign in to comment.