Display the organization image in the account view (#4953)

This commit is contained in:
Matt Rubens 2025-06-20 15:14:18 -04:00 committed by GitHub
parent 9a5f6ce7ea
commit 8370591ec0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 6 deletions

View file

@ -488,6 +488,7 @@ export class AuthService extends EventEmitter<AuthServiceEvents> {
userInfo.organizationId = organization.id
userInfo.organizationName = organization.name
userInfo.organizationRole = primaryOrgMembership.role
userInfo.organizationImageUrl = organization.image_url
}
}
} catch (error) {

View file

@ -13,6 +13,7 @@ export interface CloudUserInfo {
organizationId?: string
organizationName?: string
organizationRole?: string
organizationImageUrl?: string
}
/**

View file

@ -41,15 +41,24 @@ export const AccountView = ({ userInfo, isAuthenticated, onDone }: AccountViewPr
</div>
)}
</div>
<h2 className="text-lg font-medium text-vscode-foreground mb-1">
<h2 className="text-lg font-medium text-vscode-foreground mb-0">
{userInfo?.name || t("account:unknownUser")}
</h2>
{userInfo?.organizationName && (
<p className="text-sm text-vscode-descriptionForeground mb-1">
{userInfo.organizationName}
</p>
{userInfo?.email && (
<p className="text-sm text-vscode-descriptionForeground">{userInfo?.email}</p>
)}
{userInfo?.organizationName && (
<div className="flex items-center gap-2 text-sm text-vscode-descriptionForeground">
{userInfo.organizationImageUrl && (
<img
src={userInfo.organizationImageUrl}
alt={userInfo.organizationName}
className="w-4 h-4 rounded object-cover"
/>
)}
<span>{userInfo.organizationName}</span>
</div>
)}
<p className="text-sm text-vscode-descriptionForeground">{userInfo?.email || ""}</p>
</div>
)}
<div className="flex flex-col gap-2 mt-4">