From 4a1c52c4ba0942c9681b96980ee29ef9926e4b61 Mon Sep 17 00:00:00 2001 From: JimmyLv Date: Mon, 6 Mar 2023 14:12:24 +0800 Subject: [PATCH] feat: add alert to reminder user --- components/Header.tsx | 72 ++++++++++++++++++++++----------------- components/ui/tooltip.tsx | 31 +++++++++++++++++ package-lock.json | 1 + package.json | 1 + pages/_app.tsx | 35 ++++++++++--------- 5 files changed, 93 insertions(+), 47 deletions(-) create mode 100644 components/ui/tooltip.tsx diff --git a/components/Header.tsx b/components/Header.tsx index 034231bc..89d76028 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -3,6 +3,11 @@ import clsx from "clsx"; import Image from "next/image"; import React from "react"; import SignIn from "~/components/SignIn"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "~/components/ui/tooltip"; import { BASE_DOMAIN } from "~/utils/constants"; import Github from "../components/GitHub"; const poppins = Poppins({ weight: "800", subsets: ["latin"] }); @@ -31,37 +36,42 @@ export default function Header() {
- - - 🔥反馈 - - - 🔖 - - (书签版) - - + + + + 🔥反馈 + + + 那可太感谢啦! + + + + + alert("🔖请拖至书签栏,进入B站视频页面再点击书签哦!") + } + > + 🔖 + + (书签版) + + + + +

🔖请拖至书签栏,进入B站视频页面再点击书签哦!

+
+
+Tooltip.displayName = TooltipPrimitive.Tooltip.displayName + +const TooltipTrigger = TooltipPrimitive.Trigger + +const TooltipContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, sideOffset = 4, ...props }, ref) => ( + +)) +TooltipContent.displayName = TooltipPrimitive.Content.displayName + +export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } diff --git a/package-lock.json b/package-lock.json index 630c2c1c..851f0b3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "@radix-ui/react-dialog": "^1.0.2", "@radix-ui/react-popover": "^1.0.4", "@radix-ui/react-toast": "^1.1.2", + "@radix-ui/react-tooltip": "^1.0.4", "@supabase/auth-helpers-nextjs": "^0.5.5", "@supabase/auth-ui-react": "^0.3.3", "@supabase/auth-ui-shared": "^0.1.2", diff --git a/package.json b/package.json index 9b7e1fd5..d94f1e7b 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@radix-ui/react-dialog": "^1.0.2", "@radix-ui/react-popover": "^1.0.4", "@radix-ui/react-toast": "^1.1.2", + "@radix-ui/react-tooltip": "^1.0.4", "@supabase/auth-helpers-nextjs": "^0.5.5", "@supabase/auth-ui-react": "^0.3.3", "@supabase/auth-ui-shared": "^0.1.2", diff --git a/pages/_app.tsx b/pages/_app.tsx index 146c96c1..be156aba 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -16,6 +16,7 @@ import Footer from "../components/Footer"; import Header from "../components/Header"; import "../styles/globals.css"; import { ThemeProvider } from "next-themes"; +import { TooltipProvider } from "~/components/ui/tooltip"; const fontSans = FontSans({ subsets: ["latin"], @@ -36,22 +37,24 @@ function MyApp({ initialSession={pageProps.initialSession} > -
-
-
- - - -
-
-
- - + +
+
+
+ + + +
+
+
+ + +
);