From 01d3e4f92da3e9255e7898e50cca2cca35d8f4be Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 9 Nov 2023 12:02:33 +0530 Subject: [PATCH] style: sidebar UI improvements * updated font weight and color as per designs. * removed background color from workspace with logo. * updated dropdown design. --- web/components/project/sidebar-list-item.tsx | 4 +- web/components/workspace/sidebar-dropdown.tsx | 258 ++++++++++-------- .../workspace/sidebar-quick-action.tsx | 8 +- 3 files changed, 144 insertions(+), 126 deletions(-) diff --git a/web/components/project/sidebar-list-item.tsx b/web/components/project/sidebar-list-item.tsx index 44c248114e3..02014ed5015 100644 --- a/web/components/project/sidebar-list-item.tsx +++ b/web/components/project/sidebar-list-item.tsx @@ -187,7 +187,7 @@ export const ProjectSidebarListItem: React.FC = observer((props) => { )} {!isCollapsed && ( -

{project.name}

+

{project.name}

)} {!isCollapsed && ( @@ -322,7 +322,7 @@ export const ProjectSidebarListItem: React.FC = observer((props) => { className={`group flex items-center rounded-md px-2 py-1.5 gap-2.5 text-xs font-medium outline-none ${ router.asPath.includes(item.href) ? "bg-custom-primary-100/10 text-custom-primary-100" - : "text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80 focus:bg-custom-sidebar-background-80" + : "text-custom-sidebar-text-300 hover:bg-custom-sidebar-background-80 focus:bg-custom-sidebar-background-80" } ${isCollapsed ? "justify-center" : ""}`} > diff --git a/web/components/workspace/sidebar-dropdown.tsx b/web/components/workspace/sidebar-dropdown.tsx index 5e6ac2dbd10..faa301eaa82 100644 --- a/web/components/workspace/sidebar-dropdown.tsx +++ b/web/components/workspace/sidebar-dropdown.tsx @@ -3,7 +3,7 @@ import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; import Link from "next/link"; import { Menu, Transition } from "@headlessui/react"; -import { Check, LogOut, Plus, Settings, UserCircle2 } from "lucide-react"; +import { Check, ChevronDown, LogOut, Plus, Settings, UserCircle2 } from "lucide-react"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // hooks @@ -90,139 +90,157 @@ export const WorkspaceSidebarDropdown = observer(() => { }; return ( -
+
- -
-
- {activeWorkspace?.logo && activeWorkspace.logo !== "" ? ( - Workspace Logo - ) : ( - activeWorkspace?.name?.charAt(0) ?? "..." - )} -
+ {({ open }) => ( + <> + +
+
+ {activeWorkspace?.logo && activeWorkspace.logo !== "" ? ( + Workspace Logo + ) : ( + activeWorkspace?.name?.charAt(0) ?? "..." + )} +
- {!sidebarCollapsed && ( -

- {activeWorkspace?.name ? activeWorkspace.name : "Loading..."} -

- )} -
-
+ {!sidebarCollapsed && ( +

+ {activeWorkspace?.name ? activeWorkspace.name : "Loading..."} +

+ )} - - -
- Workspace - {workspaces ? ( -
- {workspaces.length > 0 ? ( - workspaces.map((workspace: IWorkspace) => ( - - {() => ( -
- {workspace.id === activeWorkspace?.id && ( - - - +
+ + {workspace?.logo && workspace.logo !== "" ? ( + Workspace Logo + ) : ( + workspace?.name?.charAt(0) ?? "..." + )} + + +
+ {workspace.name} +
+
+ {workspace.id === activeWorkspace?.id && ( + + + + )} + )} - - )} + + )) + ) : ( +

No workspace found!

+ )} + { + router.push("/create-workspace"); + }} + className="flex w-full items-center gap-2 px-2 py-1 text-sm text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80" + > + + Create Workspace - )) +
) : ( -

No workspace found!

+
+ + + + +
)} +
+
+ {userLinks(workspaceSlug?.toString() ?? "", currentUser?.id ?? "").map((link, index) => ( + + + {link.name} + + + ))} +
+
{ - router.push("/create-workspace"); - }} - className="flex w-full items-center gap-2 px-2 py-1 text-sm text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80" + className="flex w-full items-center justify-start rounded px-2 py-1 text-sm text-red-600 hover:bg-custom-sidebar-background-80" + onClick={handleSignOut} > - - Create Workspace + Sign out
- ) : ( -
- - - - -
- )} -
-
- {userLinks(workspaceSlug?.toString() ?? "", currentUser?.id ?? "").map((link, index) => ( - - - {link.name} - - - ))} -
-
- - Sign out - -
- - + + + + )} {!sidebarCollapsed && ( @@ -231,7 +249,7 @@ export const WorkspaceSidebarDropdown = observer(() => { diff --git a/web/components/workspace/sidebar-quick-action.tsx b/web/components/workspace/sidebar-quick-action.tsx index d801b277203..9ae9ccde8b7 100644 --- a/web/components/workspace/sidebar-quick-action.tsx +++ b/web/components/workspace/sidebar-quick-action.tsx @@ -42,12 +42,12 @@ export const WorkspaceSidebarQuickAction = observer(() => { className={`relative flex items-center justify-between w-full rounded cursor-pointer px-2 gap-1 group ${ isSidebarCollapsed ? "px-2 hover:bg-custom-sidebar-background-80" - : "px-3 shadow border-[0.5px] border-custom-border-300" + : "px-3 shadow-custom-sidebar-shadow-2xs border-[0.5px] border-custom-border-200" }`} >