Skip to content

Commit

Permalink
Fix Name
Browse files Browse the repository at this point in the history
  • Loading branch information
vicheanath committed Aug 18, 2024
1 parent 94f2c75 commit 5ed198f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React from "react";

import { About, Footer, Header, Skills, Testimonial, Work } from "./container";
import { Navbar } from "./components";
import "./App.scss";

// App
const App: React.FC = () => {
return (
<div className="app">
Expand Down
15 changes: 7 additions & 8 deletions src/components/Navbar/Navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
justify-content: flex-start;
align-items: center;

img {
width: 90px;
height: 20px;

@media screen and (min-width: 2000px) {
width: 180px;
height: 40px;
}
a {
color: var(--secondary-color);
text-decoration: none;
font-size: 1.5rem;
font-weight: 800;
text-transform: uppercase;
font-family: var(--font-base);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Navbar = () => {
<nav className="app__navbar">
<div className="app__navbar-logo">
{/* Logo */}
<a href={`#${links.navbar_links[0]}`} title="Micael">
<a href={`#${links.navbar_links[0]}`} title="Vichea Nath">
Vichea Nath
</a>
</div>
Expand Down
34 changes: 34 additions & 0 deletions src/hooks/useWindowSize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useEffect, useState } from "react";

export const useWindowSize = () => {
// Initialize state with undefined width/height so server and client renders match
const [windowSize, setWindowSize] = useState<{
width: number | undefined;
height: number | undefined;
}>({
width: undefined,
height: undefined,
});

useEffect(() => {
// Handler to call on window resize
function handleResize() {
// Set window width/height to state
setWindowSize({
width: window.innerWidth,
height: window.innerHeight,
});
}

// Add event listener
window.addEventListener("resize", handleResize);

// Call handler right away so state gets updated with initial window size
handleResize();

// Remove event listener on cleanup
return () => window.removeEventListener("resize", handleResize);
}, []); // Empty array ensures that effect is only run on mount

return windowSize;
};

0 comments on commit 5ed198f

Please # to comment.