diff --git a/apps/app/components/ui/avatar.tsx b/apps/app/components/ui/avatar.tsx index 93ef49252..5bc94bfcf 100644 --- a/apps/app/components/ui/avatar.tsx +++ b/apps/app/components/ui/avatar.tsx @@ -15,15 +15,25 @@ import { WORKSPACE_MEMBERS } from "constants/fetch-keys"; type AvatarProps = { user?: Partial | Partial | IUser | IUserLite | undefined | null; index?: number; + height?: string; + width?: string; + fontSize?: string }; -export const Avatar: React.FC = ({ user, index }) => ( -
+export const Avatar: React.FC = ({ user, index, height="20px", width="20px", fontSize="12px" }) => ( +
{user && user.avatar && user.avatar !== "" ? (
= ({ user, index }) => ( />
) : ( -
+
{user?.first_name && user.first_name !== "" ? user.first_name.charAt(0) : user?.email?.charAt(0)} diff --git a/apps/app/components/workspace/sidebar-dropdown.tsx b/apps/app/components/workspace/sidebar-dropdown.tsx index 5a98ad12e..c50ecd258 100644 --- a/apps/app/components/workspace/sidebar-dropdown.tsx +++ b/apps/app/components/workspace/sidebar-dropdown.tsx @@ -12,7 +12,7 @@ import useWorkspaces from "hooks/use-workspaces"; import userService from "services/user.service"; import authenticationService from "services/authentication.service"; // components -import { Loader } from "components/ui"; +import { Avatar, Loader } from "components/ui"; // types import { IWorkspace } from "types"; @@ -72,44 +72,48 @@ export const WorkspaceSidebarDropdown = () => { return (
- - -
-
- {activeWorkspace?.logo && activeWorkspace.logo !== "" ? ( - Workspace Logo - ) : ( - activeWorkspace?.name?.charAt(0) ?? "..." + +
+ +
+
+ {activeWorkspace?.logo && activeWorkspace.logo !== "" ? ( + Workspace Logo + ) : ( + activeWorkspace?.name?.charAt(0) ?? "..." + )} +
+ + {!sidebarCollapse && ( +

+ {activeWorkspace?.name + ? activeWorkspace.name.length > 17 + ? `${activeWorkspace.name.substring(0, 17)}...` + : activeWorkspace.name + : "Loading..."} +

)}
- {!sidebarCollapse && ( -

- {activeWorkspace?.name - ? activeWorkspace.name.length > 17 - ? `${activeWorkspace.name.substring(0, 17)}...` - : activeWorkspace.name - : "Loading..."} -

- )} -
+ + {!sidebarCollapse && ( -
-
+ + +
+ +
+
+ )} - +
{ const { collapsed: sidebarCollapse } = useTheme(); return ( -
-
- {workspaceLinks(workspaceSlug as string).map((link, index) => ( - - + {workspaceLinks(workspaceSlug as string).map((link, index) => ( + + + - - - ))} -
+ link.href === router.asPath ? "text-gray-900" : "text-gray-600" + } h-5 w-5 flex-shrink-0 group-hover:text-gray-900`} + aria-hidden="true" + /> + {!sidebarCollapse && link.name} + + + ))}
); }; diff --git a/apps/app/layouts/app-layout/app-sidebar.tsx b/apps/app/layouts/app-layout/app-sidebar.tsx index ff64ea3ba..1c5f0b2b0 100644 --- a/apps/app/layouts/app-layout/app-sidebar.tsx +++ b/apps/app/layouts/app-layout/app-sidebar.tsx @@ -25,10 +25,8 @@ const Sidebar: React.FC = ({ toggleSidebar, setToggleSidebar }) => } flex h-full flex-col bg-white duration-300 md:relative`} >
-
-
- -
+
+