From e157a3698efda2bb938dfa609953ee213c6ded30 Mon Sep 17 00:00:00 2001 From: Awalhossain Date: Fri, 27 Sep 2024 11:03:57 +0600 Subject: [PATCH] refactor: Update NavMenu component to improve code organization and fix import order --- src/components/shared/NavMenu.tsx | 52 ++++++++++++++++--------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/components/shared/NavMenu.tsx b/src/components/shared/NavMenu.tsx index db2277a..f8cf52a 100644 --- a/src/components/shared/NavMenu.tsx +++ b/src/components/shared/NavMenu.tsx @@ -1,10 +1,10 @@ import React, { useState } from 'react'; import { Link } from '../../types/Link'; +import ThemeToggle from '../config/ThemeToggle'; import { Route, routes } from '../constants/routes'; -import HyperLink from './HyperLink'; import ContactForm from '../elements/ContacForm'; -import ThemeToggle from '../config/ThemeToggle'; +import HyperLink from './HyperLink'; const NavMenu = (): React.ReactElement => { const [isModalOpen, setIsModalOpen] = useState(false); @@ -21,38 +21,40 @@ const NavMenu = (): React.ReactElement => { // If this is the 'Contact' link, add an onClick handler const extraProps = route.name === 'Contact' ? { onClick: handleContactClick } : {}; + console.log('extraProps', url, extraProps, routes); + return ( <> -
  • - - {route.name} - -
  • +
  • + + {route.name} + +
  • - + ); }); return ( <> - - { - isModalOpen && ( - - ) - } + + { + isModalOpen && ( + + ) + } ); };