From 55a5d5fe6fcc6d1056cbe2ad761dd10afc7b9447 Mon Sep 17 00:00:00 2001 From: r-freeman Date: Tue, 14 Feb 2023 21:34:07 +0000 Subject: [PATCH] Extracted MobileNavItem component --- components/Header.tsx | 20 +++++--------------- components/MobileNavItem.tsx | 13 +++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 components/MobileNavItem.tsx diff --git a/components/Header.tsx b/components/Header.tsx index e3413da..3b1784c 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -5,24 +5,14 @@ import {Fragment, useEffect, useRef} from 'react' import {Popover, Transition} from '@headlessui/react' import clsx from 'clsx' import {Container} from './Container' -import {CloseIcon} from '@/components/icons/CloseIcon' -import {ChevronDownIcon} from '@/components/icons/ChevronDownIcon' -import {MoonIcon} from '@/components/icons/MoonIcon' -import {SunIcon} from '@/components/icons/SunIcon' +import {MobileNavItem} from './MobileNavItem' +import {CloseIcon} from './icons/CloseIcon' +import {ChevronDownIcon} from './icons/ChevronDownIcon' +import {MoonIcon} from './icons/MoonIcon' +import {SunIcon} from './icons/SunIcon' import avatar from '@/public/static/images/avatar.jpg' import type {Props} from 'types' - -function MobileNavItem({href, children}: { href: string } & Props) { - return ( -
  • - - {children} - -
  • - ) -} - function MobileNavigation(props: Props) { return ( diff --git a/components/MobileNavItem.tsx b/components/MobileNavItem.tsx new file mode 100644 index 0000000..9c0a1ed --- /dev/null +++ b/components/MobileNavItem.tsx @@ -0,0 +1,13 @@ +import {Props} from '@/types'; +import {Popover} from '@headlessui/react' +import Link from 'next/link' + +export function MobileNavItem({href, children}: { href: string } & Props) { + return ( +
  • + + {children} + +
  • + ) +} \ No newline at end of file