1
+ "use client" ;
2
+ import { observer } from "mobx-react" ;
1
3
import Link from "next/link" ;
2
4
import { useParams } from "next/navigation" ;
3
5
import { Check , Settings , UserPlus } from "lucide-react" ;
6
+ // plane imports
4
7
import { Menu } from "@headlessui/react" ;
5
8
import { EUserPermissions } from "@plane/constants" ;
6
9
import { useTranslation } from "@plane/i18n" ;
7
10
import { IWorkspace } from "@plane/types" ;
8
11
import { cn , getFileURL } from "@plane/utils" ;
12
+ // helpers
9
13
import { getUserRole } from "@/helpers/user.helper" ;
14
+ // plane web imports
10
15
import { SubscriptionPill } from "@/plane-web/components/common/subscription-pill" ;
11
16
12
17
type TProps = {
@@ -15,11 +20,11 @@ type TProps = {
15
20
handleItemClick : ( ) => void ;
16
21
handleWorkspaceNavigation : ( workspace : IWorkspace ) => void ;
17
22
} ;
18
- const SidebarDropdownItem = ( props : TProps ) => {
23
+ const SidebarDropdownItem = observer ( ( props : TProps ) => {
19
24
const { workspace, activeWorkspace, handleItemClick, handleWorkspaceNavigation } = props ;
20
-
21
- // router params
25
+ // router
22
26
const { workspaceSlug } = useParams ( ) ;
27
+ // hooks
23
28
const { t } = useTranslation ( ) ;
24
29
25
30
return (
@@ -43,14 +48,14 @@ const SidebarDropdownItem = (props: TProps) => {
43
48
< div className = "flex items-center justify-between gap-1 rounded p-1 text-sm text-custom-sidebar-text-100 " >
44
49
< div className = "flex items-center justify-start gap-2.5 w-[80%] relative" >
45
50
< 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"
48
53
} `}
49
54
>
50
55
{ workspace ?. logo_url && workspace . logo_url !== "" ? (
51
56
< img
52
57
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"
54
59
alt = { t ( "workspace_logo" ) }
55
60
/>
56
61
) : (
@@ -79,28 +84,32 @@ const SidebarDropdownItem = (props: TProps) => {
79
84
) }
80
85
</ div >
81
86
{ workspace . id === activeWorkspace ?. id && (
82
- < div className = "mt-2 mb-1 flex gap-2" >
87
+ < >
83
88
{ 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 >
91
107
) }
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
+ </ >
100
109
) }
101
110
</ Menu . Item >
102
111
</ Link >
103
112
) ;
104
- } ;
113
+ } ) ;
105
114
106
115
export default SidebarDropdownItem ;
0 commit comments