Skip to content

Commit

Permalink
Merge pull request #91 from Z-100/feature/fonts-and-navbar
Browse files Browse the repository at this point in the history
Fix fonts and Navbar active tab
  • Loading branch information
Z-100 authored Apr 2, 2024
2 parents d23e18c + f899ec5 commit 1c5edfe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Binary file added public/Montserrat-Regular.ttf
Binary file not shown.
16 changes: 9 additions & 7 deletions src/components/navigation/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import React, {useState} from 'react'
import React, {useEffect, useState} from 'react'
import {routerData} from "../router";
import {Link} from "react-router-dom";
import {Link, useLocation} from "react-router-dom";

export const Navbar = () => {

const [active, setActive] = useState(routerData[0].name)
const location = useLocation();
const [url, setUrl] = useState('');
useEffect(() => {
setUrl(location.pathname);
}, [location]);

return (
<>
<div className="fixed top-0 w-full bg-dark-1 h-16">
<div className="w-[50%] ml-[25%] h-full flex gap-6 items-center justify-center">
{routerData.map(route => (
<Link key={route.name}
to={route.path}
onClick={() => setActive(route.name)}
className="">
to={route.path}>

<p className={active === route.name ? "font-bold" : "text-light-2"}>{route.name}</p>
<p className={url === route.path ? "font-bold" : "text-light-2"}>{route.name}</p>
</Link>
))}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useRef, useState} from 'react'
import React, {useState} from 'react'

export const ContactFormContainer = () => {

Expand Down
5 changes: 5 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
}
}

@font-face {
font-family: 'Montserrat';
src: url('/public/Montserrat-Regular.ttf');
}

h1 {
font-size: 2rem;
}
Expand Down

0 comments on commit 1c5edfe

Please sign in to comment.