From 606e1294293008fdc16e5760789b20ca27f25da3 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 5 Nov 2023 03:16:22 +0000 Subject: [PATCH] add tooltip to friends button --- src/components/Navbar.tsx | 109 +++++++++++++++++++--------------- src/components/ui/Tooltip.tsx | 2 +- 2 files changed, 62 insertions(+), 49 deletions(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 1c90fcb..c4f6394 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -11,6 +11,7 @@ import { import { GlobeAltIcon } from "@heroicons/react/24/outline"; import Link from "next/link"; import Avatar from "./Avatar"; +import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/Tooltip"; import { Card } from "./ui/card"; import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover"; @@ -23,18 +24,59 @@ interface ButtonProps { function NavbarButton({ text, icon, href, ariaLabel }: ButtonProps) { return ( -
- - <> - {icon} -

{text}

- -
-
+ + <> + {icon} +

{text}

+ +
+ ); +} + +function FriendsButton() { + const settingsStore = useStore(useSettingsStore, (state) => state); + + return ( + + + } + /> + + + {settingsStore?.friends.length == 0 ? ( +

No friends, add someone!

+ ) : ( + settingsStore?.friends.map((friend) => { + return ( + +
+ +
+

#{friend.rank}

+

{friend.name}

+
+
+ + ); + }) + )} +
+
); } @@ -59,42 +101,13 @@ export default function Navbar() { /> )} - - - } - /> - - - {settingsStore?.friends.length == 0 ? ( -

No friends, add someone!

- ) : ( - settingsStore?.friends.map((friend) => { - return ( - -
- -
-

#{friend.rank}

-

{friend.name}

-
-
- - ); - }) - )} -
-
+ + + + + Click to view your friends + +