1+ "use client" ;
2+ import { observer } from "mobx-react" ;
13import Link from "next/link" ;
24import { useParams } from "next/navigation" ;
35import { Check , Settings , UserPlus } from "lucide-react" ;
6+ // plane imports
47import { Menu } from "@headlessui/react" ;
58import { EUserPermissions } from "@plane/constants" ;
69import { useTranslation } from "@plane/i18n" ;
710import { IWorkspace } from "@plane/types" ;
811import { cn , getFileURL } from "@plane/utils" ;
12+ // helpers
913import { getUserRole } from "@/helpers/user.helper" ;
14+ // plane web imports
1015import { SubscriptionPill } from "@/plane-web/components/common/subscription-pill" ;
1116
1217type TProps = {
@@ -15,11 +20,11 @@ type TProps = {
1520 handleItemClick : ( ) => void ;
1621 handleWorkspaceNavigation : ( workspace : IWorkspace ) => void ;
1722} ;
18- const SidebarDropdownItem = ( props : TProps ) => {
23+ const SidebarDropdownItem = observer ( ( props : TProps ) => {
1924 const { workspace, activeWorkspace, handleItemClick, handleWorkspaceNavigation } = props ;
20-
21- // router params
25+ // router
2226 const { workspaceSlug } = useParams ( ) ;
27+ // hooks
2328 const { t } = useTranslation ( ) ;
2429
2530 return (
@@ -43,14 +48,14 @@ const SidebarDropdownItem = (props: TProps) => {
4348 < div className = "flex items-center justify-between gap-1 rounded p-1 text-sm text-custom-sidebar-text-100 " >
4449 < div className = "flex items-center justify-start gap-2.5 w-[80%] relative" >
4550 < span
46- className = { `relative flex h-8 w-8 flex-shrink-0 items-center justify-center p-2 text-sm uppercase font-semibold ${
47- ! workspace ?. logo_url && "rounded-lg bg-custom-primary-500 text-white"
51+ className = { `relative flex h-8 w-8 flex-shrink-0 items-center justify-center p-2 text-base uppercase font-medium border-custom-border-200 ${
52+ ! workspace ?. logo_url && "rounded-md bg-custom-primary-500 text-white"
4853 } `}
4954 >
5055 { workspace ?. logo_url && workspace . logo_url !== "" ? (
5156 < img
5257 src = { getFileURL ( workspace . logo_url ) }
53- className = "absolute left-0 top-0 h-full w-full rounded-lg object-cover"
58+ className = "absolute left-0 top-0 h-full w-full rounded object-cover"
5459 alt = { t ( "workspace_logo" ) }
5560 />
5661 ) : (
@@ -79,28 +84,32 @@ const SidebarDropdownItem = (props: TProps) => {
7984 ) }
8085 </ div >
8186 { workspace . id === activeWorkspace ?. id && (
82- < div className = "mt-2 mb-1 flex gap-2" >
87+ < >
8388 { workspace ?. role > EUserPermissions . GUEST && (
84- < Link
85- href = { `/${ workspace . slug } /settings` }
86- className = "flex border border-custom-border-200 rounded-md py-1 px-2 gap-1 bg-custom-sidebar-background-100"
87- >
88- < Settings className = "h-4 w-4 text-custom-sidebar-text-100 my-auto" />
89- < span className = "text-sm font-medium my-auto" > { t ( "settings" ) } </ span >
90- </ Link >
89+ < div className = "mt-2 mb-1 flex gap-2" >
90+ < Link
91+ href = { `/${ workspace . slug } /settings` }
92+ className = "flex border border-custom-border-200 rounded-md py-1 px-2 gap-1 bg-custom-sidebar-background-100 hover:shadow-sm hover:text-custom-text-200 text-custom-text-300 hover:border-custom-border-300 "
93+ >
94+ < Settings className = "h-4 w-4 my-auto" />
95+ < span className = "text-sm font-medium my-auto" > { t ( "settings" ) } </ span >
96+ </ Link >
97+ < Link
98+ href = { `/${ workspace . slug } /settings/members` }
99+ className = "flex border border-custom-border-200 rounded-md py-1 px-2 gap-1 bg-custom-sidebar-background-100 hover:shadow-sm hover:text-custom-text-200 text-custom-text-300 hover:border-custom-border-300 "
100+ >
101+ < UserPlus className = "h-4 w-4 my-auto" />
102+ < span className = "text-sm font-medium my-auto" >
103+ { t ( "project_settings.members.invite_members.title" ) }
104+ </ span >
105+ </ Link >
106+ </ div >
91107 ) }
92- < Link
93- href = { `/${ workspace . slug } /settings/members` }
94- className = "flex border border-custom-border-200 rounded-md py-1 px-2 gap-1 bg-custom-sidebar-background-100"
95- >
96- < UserPlus className = "h-4 w-4 text-custom-sidebar-text-100 my-auto" />
97- < span className = "text-sm font-medium my-auto capitalize" > { t ( "invite" ) } </ span >
98- </ Link >
99- </ div >
108+ </ >
100109 ) }
101110 </ Menu . Item >
102111 </ Link >
103112 ) ;
104- } ;
113+ } ) ;
105114
106115export default SidebarDropdownItem ;
0 commit comments