Skip to content

Commit 4956ebb

Browse files
committed
chore: add org display to workspace topbar
1 parent f90f088 commit 4956ebb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

site/src/pages/WorkspacePage/WorkspaceTopbar.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
116116
linkToTemplate(workspace.organization_name, workspace.template_name),
117117
);
118118

119+
// Organization logic
120+
const { organizations, showOrganizations } = useDashboard();
121+
const matchedOrganization = organizations.find(
122+
(o) => o.id === workspace.organization_id,
123+
);
124+
119125
return (
120126
<Topbar css={{ gridArea: "topbar" }}>
121127
<Tooltip title="Back to workspaces">
@@ -146,6 +152,24 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
146152
<span>{workspace.owner_name}</span>
147153
</Tooltip>
148154

155+
{showOrganizations && (
156+
<>
157+
<TopbarDivider />
158+
159+
{matchedOrganization && (
160+
<UserAvatar
161+
size="xs"
162+
username={matchedOrganization.display_name}
163+
avatarURL={matchedOrganization.icon}
164+
/>
165+
)}
166+
167+
<Tooltip title="Organization">
168+
<span>{workspace.organization_name}</span>
169+
</Tooltip>
170+
</>
171+
)}
172+
149173
<TopbarDivider />
150174

151175
<Popover mode="hover">

0 commit comments

Comments
 (0)