From f3702a4d99b8ff3c8b42f26059de7f646386abc7 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 15 Jun 2023 15:08:33 +0800 Subject: [PATCH] feat: header popover Signed-off-by: Innei --- .../layout/header/HeaderContent.tsx | 98 ++++++++++++++----- src/components/layout/header/config.ts | 2 +- .../ui/float-popover/FloatPopover.tsx | 17 ++-- .../ui/theme-switcher/ThemeSwitcher.tsx | 4 +- src/styles/tailwindcss.css | 2 +- 5 files changed, 88 insertions(+), 35 deletions(-) diff --git a/src/components/layout/header/HeaderContent.tsx b/src/components/layout/header/HeaderContent.tsx index 04edab5f38..eab51f5656 100644 --- a/src/components/layout/header/HeaderContent.tsx +++ b/src/components/layout/header/HeaderContent.tsx @@ -1,10 +1,11 @@ 'use client' -import React from 'react' +import React, { useMemo } from 'react' import { motion, useMotionValue } from 'framer-motion' import Link from 'next/link' import { usePathname } from 'next/navigation' +import { FloatPopover } from '~/components/ui/float-popover' import { OnlyLg } from '~/components/ui/viewport' import { usePageScrollDirection } from '~/providers/root/page-scroll-info-provider' import { clsxm } from '~/utils/helper' @@ -34,10 +35,12 @@ const AnimatedMenu: Component = ({ children }) => { return (
{children}
@@ -61,6 +64,8 @@ function ForDesktop({ [mouseX, mouseY, radius], ) + const pathname = usePathname() + return (