File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
app/dashboard/company/[slug] Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -164,13 +164,15 @@ export default function CompanySlugDashboardPage() {
164164 </ p >
165165 </ div >
166166 </ div >
167- < div className = "pt-4" >
168- < Button asChild variant = "outline" >
169- < Link href = { `/dashboard/company/${ currentCompany . slug } /settings` } >
170- Edit Company Profile
171- </ Link >
172- </ Button >
173- </ div >
167+ { userRole && [ 'owner' , 'admin' ] . includes ( userRole ) && (
168+ < div className = "pt-4" >
169+ < Button asChild variant = "outline" >
170+ < Link href = { `/dashboard/company/${ currentCompany . slug } /settings` } >
171+ Edit Company Profile
172+ </ Link >
173+ </ Button >
174+ </ div >
175+ ) }
174176 </ CardContent >
175177 </ Card >
176178 </ div >
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export function CompanySidebar({
7070 const toggleCollapsed = ( ) => setCollapsed ( ! collapsed )
7171 const pathname = usePathname ( )
7272 const { navigateTo } = useSafeNavigation ( )
73- const { currentCompany, userCompanies, switchCompany } = useCompanyContext ( )
73+ const { currentCompany, userCompanies, userRole , switchCompany } = useCompanyContext ( )
7474
7575 return (
7676 < SidebarProvider >
@@ -164,7 +164,7 @@ export function CompanySidebar({
164164 { name }
165165 </ span >
166166 < span className = "truncate text-xs text-purple-300" >
167- { currentCompany ?. name }
167+ { userRole ? ` ${ userRole . charAt ( 0 ) . toUpperCase ( ) + userRole . slice ( 1 ) } • ${ currentCompany ?. name } ` : currentCompany ?. name }
168168 </ span >
169169 </ div >
170170 < ChevronDown className = "size-4 text-zinc-400" />
@@ -420,7 +420,7 @@ export function CompanySidebar({
420420 { name }
421421 </ span >
422422 < span className = "truncate text-xs text-purple-300" >
423- { currentCompany ?. name }
423+ { userRole ? ` ${ userRole . charAt ( 0 ) . toUpperCase ( ) + userRole . slice ( 1 ) } • ${ currentCompany ?. name } ` : currentCompany ?. name }
424424 </ span >
425425 </ div >
426426 < ChevronDown className = "ml-auto size-4 text-zinc-400 flex-shrink-0" />
You can’t perform that action at this time.
0 commit comments