mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-22 13:15:41 +00:00
Extracted MobileNavItem component
This commit is contained in:
parent
a05b0006ee
commit
55a5d5fe6f
@ -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 (
|
||||
<li>
|
||||
<Popover.Button as={Link} href={href} className="block py-2">
|
||||
{children}
|
||||
</Popover.Button>
|
||||
</li>
|
||||
)
|
||||
}
|
||||
|
||||
function MobileNavigation(props: Props) {
|
||||
return (
|
||||
<Popover {...props}>
|
||||
|
13
components/MobileNavItem.tsx
Normal file
13
components/MobileNavItem.tsx
Normal file
@ -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 (
|
||||
<li>
|
||||
<Popover.Button as={Link} href={href} className="block py-2">
|
||||
{children}
|
||||
</Popover.Button>
|
||||
</li>
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user