From 8832d8e00e67783686532cb0aa6105e121235ed2 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Thu, 9 Nov 2023 17:01:48 +0530 Subject: [PATCH] style: sidebar UI improvements (#2735) * 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 | 270 ++++++++++-------- .../workspace/sidebar-quick-action.tsx | 8 +- 3 files changed, 150 insertions(+), 132 deletions(-) diff --git a/web/components/project/sidebar-list-item.tsx b/web/components/project/sidebar-list-item.tsx index 44c248114..02014ed50 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 5e6ac2dbd..faa301eaa 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) ?? "..." - )} -
- - {!sidebarCollapsed && ( -

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

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

No workspace found!

+ activeWorkspace?.name?.charAt(0) ?? "..." )} +
+ + {!sidebarCollapsed && ( +

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

+ )} + + {!sidebarCollapsed && ( + + )} +
+
+ + + +
+ Workspace + {workspaces ? ( +
+ {workspaces.length > 0 ? ( + workspaces.map((workspace: IWorkspace) => ( + + {() => ( + + )} + + )) + ) : ( +

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 + +
+ ) : ( +
+ + + + +
+ )} +
+
+ {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 d801b2772..9ae9ccde8 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" }`} >