From 4fad685ec81c2715ee82c84e12990acfb9e83153 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 10 Mar 2023 12:32:29 +0530 Subject: [PATCH] style: workspace dropdown (#416) * style: workspace dropdown * style: workspace dropdown hover fix --- .../components/workspace/sidebar-dropdown.tsx | 164 ++++++++++-------- 1 file changed, 88 insertions(+), 76 deletions(-) diff --git a/apps/app/components/workspace/sidebar-dropdown.tsx b/apps/app/components/workspace/sidebar-dropdown.tsx index f7392f1d2..5a98ad12e 100644 --- a/apps/app/components/workspace/sidebar-dropdown.tsx +++ b/apps/app/components/workspace/sidebar-dropdown.tsx @@ -3,7 +3,7 @@ import { Menu, Transition } from "@headlessui/react"; import { useRouter } from "next/router"; import Image from "next/image"; import Link from "next/link"; -import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; +import { CheckIcon, ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; // hooks import useUser from "hooks/use-user"; import useTheme from "hooks/use-theme"; @@ -20,13 +20,17 @@ import { IWorkspace } from "types"; // Static Data const userLinks = (workspaceSlug: string) => [ { - name: "My Profile", - href: `/${workspaceSlug}/me/profile`, + name: "Workspace Settings", + href: `/${workspaceSlug}/settings`, }, { name: "Workspace Invites", href: "/invitations", }, + { + name: "My Profile", + href: `/${workspaceSlug}/me/profile`, + }, ]; export const WorkspaceSidebarDropdown = () => { @@ -116,28 +120,29 @@ export const WorkspaceSidebarDropdown = () => { leaveFrom="transform opacity-100 scale-100" leaveTo="transform opacity-0 scale-95" > - -
-
- - {user?.email} - -
-
- {workspaces ? ( - <> - {workspaces.length > 0 ? ( - workspaces.map((workspace) => ( - - {({ active }) => ( - - )} - - )) - ) : ( -

No workspace found!

- )} - { - router.push("/create-workspace"); - }} - className="flex w-full items-center gap-2 rounded px-2 py-1 text-left text-xs hover:bg-gray-100" - > - - Create Workspace - - - ) : ( -
- - - - -
- )} -
-
- {userLinks(workspaceSlug as string).map((link, index) => ( - - - - {link.name} - - + +
{workspace.name}
+
+ + + + + )} + + )) + ) : ( +

No workspace found!

+ )} + { + router.push("/create-workspace"); + }} + className="flex w-full items-center gap-1 text-sm text-gray-600" + > + + Create Workspace - ))} +
+ ) : ( +
+ + + + +
+ )} + +
+ {userLinks(workspaceSlug as string).map((link, index) => ( - Sign out + + {link.name} + -
+ ))} + +
+ + Sign out +