Merge branch 'develop' into translation

This commit is contained in:
Fernando Videira
2024-06-11 15:02:14 +01:00
8 changed files with 42 additions and 7 deletions
+17 -2
View File
@@ -26,6 +26,11 @@ export default () => {
{ title: t("navbar.contact"), path: "Contact" },
];
const handleNavigation = (path: string) => {
const element = document.getElementById(path);
element?.scrollIntoView({ behavior: "smooth" });
};
return (
<nav
className={`${
@@ -36,7 +41,13 @@ export default () => {
>
<div className="items-center px-4 max-w-screen-xl mx-auto md:flex md:px-8">
<div className="flex items-center justify-between py-3 md:py-5 md:block">
<a href="/">
<a
href="Top"
onClick={(e) => {
e.preventDefault(); // Prevent the default anchor tag behavior
window.scrollTo({ top: 0, behavior: "smooth" }); // Scroll to the top of the page
}}
>
<img src={Logo} width={60} height={60} alt="logo" />
</a>
<div className="md:hidden">
@@ -68,7 +79,11 @@ export default () => {
<a
href={item.path}
className="block py-2 md:py-0 md:px-4 text-xl font-medium"
onClick={() => setState(false)}
onClick={(e) => {
e.preventDefault(); // Prevent the default anchor tag behavior
setState(false); // Close the navigation
handleNavigation(item.path); // Navigate to the section
}}
>
{item.title}
</a>