Skip to content

Commit

Permalink
Add navigation to header using new useNav hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Corofides committed Nov 8, 2023
1 parent 7a6838c commit 22d9364
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/SiteHeader/SiteHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import React from 'react';
import useSettings from '../Hooks/useSettings';
import './SiteHeader.scss';
import { css } from 'glamor';
import useNav from "../Hooks/useNav";

export default () => {

const {settings} = useSettings();
const {getNavForPosition, loading} = useNav();

const headerRule = css({
"background-color": settings['brand-primary-bg'],
Expand Down Expand Up @@ -39,7 +41,13 @@ export default () => {
{settings.site_name}
</a>
</h1>
<nav />
<nav>
{getNavForPosition("main").map((item) => {
return (
<a href={process.env.REACT_APP_SITE_URL + "#" + item.location}>{item.label}</a>
)
})}
</nav>
</div>
</header>
)
Expand Down
2 changes: 1 addition & 1 deletion src/SiteHeader/SiteHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nav {

padding: 8px;
text-decoration: none;
color: $glimmering-silver;
color: #ffffff;

&:last-of-type {
padding-right: 0;
Expand Down

0 comments on commit 22d9364

Please sign in to comment.