diff --git a/components/Header.tsx b/components/Header.tsx index b9edc8d..4d5d1b6 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -1,4 +1,3 @@ -import Image from 'next/image' import Link from 'next/link' import {usePathname} from 'next/navigation' import {Fragment, useEffect, useRef} from 'react' @@ -6,11 +5,11 @@ import {Popover, Transition} from '@headlessui/react' import clsx from 'clsx' import {Container} from './Container' import {MobileNavItem} from './ui/MobileNavItem' +import {Avatar, AvatarContainer} from './ui/Avatar' 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 MobileNavigation(props: Props) { @@ -152,40 +151,6 @@ function clamp(num: number, a: number, b: number) { return Math.min(Math.max(num, min), max) } -function AvatarContainer({className, ...props}: { style?: Object } & Props) { - return ( -
- ) -} - -function Avatar({large = false, className, ...props}: { large?: boolean, style?: Object } & Props) { - return ( - - - - ) -} - export function Header() { const isHomePage = usePathname() === '/' diff --git a/components/ui/Avatar.tsx b/components/ui/Avatar.tsx new file mode 100644 index 0000000..6320932 --- /dev/null +++ b/components/ui/Avatar.tsx @@ -0,0 +1,39 @@ +import {Props} from '@/types' +import clsx from 'clsx' +import Link from 'next/link' +import Image from 'next/image' +import avatar from '@/public/static/images/avatar.jpg' + +export function AvatarContainer({className, ...props}: { style?: Object } & Props) { + return ( +
+ ) +} + +export function Avatar({large = false, className, ...props}: { large?: boolean, style?: Object } & Props) { + return ( + + + + ) +} \ No newline at end of file