Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

improve dropdown ui (#471)

Ameer Al Ashhabd80b086e1c80
diff --git a/apps/web/app/dashboard/_components/DashboardInner.tsx b/apps/web/app/dashboard/_components/DashboardInner.tsx
index 617bd84c9..13e9b1fd4 100644
--- a/apps/web/app/dashboard/_components/DashboardInner.tsx
+++ b/apps/web/app/dashboard/_components/DashboardInner.tsx
@@ -8,17 +8,18 @@ import {
PopoverContent,
PopoverTrigger,
} from "@cap/ui";
-import {
- Home,
- LogOut,
- MessageSquare,
- MoreVertical,
- Settings,
-} from "lucide-react";
+import { MoreVertical } from "lucide-react";
import { useState } from "react";
import { useSharedContext } from "@/app/dashboard/_components/DynamicSharedLayout";
import { Avatar } from "@/app/s/[videoId]/_components/tabs/Activity";
+import {
+ faGear,
+ faHome,
+ faMessage,
+ faSignOut,
+} from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import clsx from "clsx";
import { signOut } from "next-auth/react";
import Link from "next/link";
@@ -85,45 +86,57 @@ const User = () => {
<CommandGroup>
<Link href="/home">
<CommandItem
- className="px-2 py-2 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
+ className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
onSelect={() => {
setMenuOpen(false);
}}
>
- <Home className="mr-2 w-4 h-4 text-gray-400 group-hover:text-gray-500" />
- <span className="text-sm text-gray-400 group-hover:text-gray-500">
+ <FontAwesomeIcon
+ icon={faHome}
+ className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
+ />
+ <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
Homepage
</span>
</CommandItem>
</Link>
<Link href="/dashboard/settings/account">
<CommandItem
- className="px-2 py-2 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
+ className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
onSelect={() => {
setMenuOpen(false);
}}
>
- <Settings className="mr-2 w-4 h-4 text-gray-400 group-hover:text-gray-500" />
- <span className="text-sm text-gray-400 group-hover:text-gray-500">
+ <FontAwesomeIcon
+ icon={faGear}
+ className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
+ />
+ <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
Settings
</span>
</CommandItem>
</Link>
<CommandItem
- className="px-2 py-2 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
+ className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
onSelect={() => window.open("https://cap.link/discord", "_blank")}
>
- <MessageSquare className="mr-2 w-4 h-4 text-gray-400 group-hover:text-gray-500" />
- <span className="text-sm text-gray-400 group-hover:text-gray-500">
+ <FontAwesomeIcon
+ icon={faMessage}
+ className="mr-2 text-gray-400 transition-colors duration-300 size-3 group-hover:text-gray-500"
+ />
+ <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
Chat Support
</span>
</CommandItem>
<CommandItem
- className="px-2 py-2 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
+ className="px-2 py-1.5 rounded-lg transition-colors duration-300 cursor-pointer hover:bg-gray-100 group"
onSelect={() => signOut()}
>
- <LogOut className="mr-2 w-4 h-4 text-gray-400 group-hover:text-gray-500" />
- <span className="text-sm text-gray-400 group-hover:text-gray-500">
+ <FontAwesomeIcon
+ icon={faSignOut}
+ className="mr-2 text-gray-400 transition-colors duration-300 size-3.5 group-hover:text-gray-500"
+ />
+ <span className="text-[13px] transition-colors duration-300 text-gray-400 group-hover:text-gray-500">
Sign Out
</span>
</CommandItem>
diff --git a/packages/ui/src/components/Popover.tsx b/packages/ui/src/components/Popover.tsx
index 6f2e22447..53ad79e88 100644
--- a/packages/ui/src/components/Popover.tsx
+++ b/packages/ui/src/components/Popover.tsx
@@ -1,7 +1,7 @@
"use client";
-import * as React from "react";
import * as PopoverPrimitive from "@radix-ui/react-popover";
+import * as React from "react";
import { classNames } from "@cap/utils";
@@ -19,7 +19,7 @@ const PopoverContent = React.forwardRef<
align={align}
sideOffset={sideOffset}
className={classNames(
- "z-50 w-72 rounded-lg border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ "z-50 w-72 rounded-lg border border-gray-200 bg-popover p-4 text-popover-foreground shadow-sm outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
className
)}
{...props}
@@ -28,4 +28,4 @@ const PopoverContent = React.forwardRef<
));
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
-export { Popover, PopoverTrigger, PopoverContent };
+export { Popover, PopoverContent, PopoverTrigger };