From a19cef237da40814b81839c51d47a0e6204077de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Araya=20Jim=C3=A9nez?= Date: Thu, 26 Sep 2024 23:13:56 -0600 Subject: [PATCH 1/3] feat: create navbar component --- .../gostarkme-web/components/ui/Navbar.tsx | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 frontend/gostarkme-web/components/ui/Navbar.tsx diff --git a/frontend/gostarkme-web/components/ui/Navbar.tsx b/frontend/gostarkme-web/components/ui/Navbar.tsx new file mode 100644 index 0000000..26a2be7 --- /dev/null +++ b/frontend/gostarkme-web/components/ui/Navbar.tsx @@ -0,0 +1,41 @@ +import React from 'react'; +import Image from "next/image"; +import Link from 'next/link'; +import { LinkButton } from "../ui/LinkButton"; + +export const Navbar = () => { + const ROOT = process.env.NEXT_PUBLIC_APP_ROOT; + + return ( + + ); +}; + +export default Navbar; \ No newline at end of file From 148c9af3d41583d9cf44229767834d19be8b5f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Araya=20Jim=C3=A9nez?= Date: Thu, 26 Sep 2024 23:38:49 -0600 Subject: [PATCH 2/3] feat: add props for dynamic content and improved reusability --- .../gostarkme-web/components/ui/Navbar.tsx | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/frontend/gostarkme-web/components/ui/Navbar.tsx b/frontend/gostarkme-web/components/ui/Navbar.tsx index 26a2be7..83fa6b5 100644 --- a/frontend/gostarkme-web/components/ui/Navbar.tsx +++ b/frontend/gostarkme-web/components/ui/Navbar.tsx @@ -3,35 +3,54 @@ import Image from "next/image"; import Link from 'next/link'; import { LinkButton } from "../ui/LinkButton"; -export const Navbar = () => { - const ROOT = process.env.NEXT_PUBLIC_APP_ROOT; +interface NavItem { + label: string; + href: string; +} +interface NavbarProps { + logoSrc: string; + logoAlt: string; + title: string; + navItems: NavItem[]; + ctaButton: { + label: string; + href: string; + }; +} + +export const Navbar = ({ + logoSrc, + logoAlt, + title, + navItems, + ctaButton +}: NavbarProps) => { return ( From 5bdc2b503d71f9a64b6554fb3f1a7eac7d348cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Araya=20Jim=C3=A9nez?= Date: Fri, 27 Sep 2024 13:14:05 -0600 Subject: [PATCH 3/3] refactor: use unique keys for nav items --- frontend/gostarkme-web/components/ui/Navbar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/gostarkme-web/components/ui/Navbar.tsx b/frontend/gostarkme-web/components/ui/Navbar.tsx index 83fa6b5..7a370e7 100644 --- a/frontend/gostarkme-web/components/ui/Navbar.tsx +++ b/frontend/gostarkme-web/components/ui/Navbar.tsx @@ -41,8 +41,8 @@ export const Navbar = ({ {title}
- {navItems.map((item, index) => ( - + {navItems.map((item) => ( + {item.label} ))}