Skip to content

Commit 6696c0a

Browse files
committed
chore: expand tooltip styling for org
1 parent 836a2d4 commit 6696c0a

File tree

1 file changed

+56
-23
lines changed

1 file changed

+56
-23
lines changed

site/src/pages/WorkspacePage/WorkspaceTopbar.tsx

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -172,30 +172,63 @@ export const WorkspaceTopbar: FC<WorkspaceProps> = ({
172172
<>
173173
<TopbarDivider />
174174

175-
<Tooltip title={`Organization: ${workspace.organization_name}`}>
176-
<span
177-
css={{
178-
display: "flex",
179-
flexFlow: "row nowrap",
180-
gap: "8px",
181-
maxWidth: "160px",
182-
textOverflow: "ellipsis",
183-
overflowX: "hidden",
184-
whiteSpace: "nowrap",
185-
cursor: "default",
186-
}}
187-
>
188-
{activeOrg && (
189-
<UserAvatar
190-
size="xs"
191-
username={activeOrg.display_name}
192-
avatarURL={activeOrg.icon}
193-
/>
194-
)}
175+
<Popover mode="hover">
176+
<PopoverTrigger>
177+
<span
178+
css={{
179+
display: "flex",
180+
flexFlow: "row nowrap",
181+
gap: "8px",
182+
maxWidth: "160px",
183+
textOverflow: "ellipsis",
184+
overflowX: "hidden",
185+
whiteSpace: "nowrap",
186+
cursor: "default",
187+
}}
188+
>
189+
{activeOrg && (
190+
<UserAvatar
191+
size="xs"
192+
username={activeOrg.display_name}
193+
avatarURL={activeOrg.icon}
194+
/>
195+
)}
195196

196-
{workspace.organization_name}
197-
</span>
198-
</Tooltip>
197+
{workspace.organization_name}
198+
</span>
199+
</PopoverTrigger>
200+
201+
<HelpTooltipContent
202+
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
203+
transformOrigin={{ vertical: "top", horizontal: "center" }}
204+
>
205+
<AvatarData
206+
title={
207+
showOrganizations ? (
208+
<Link
209+
component={RouterLink}
210+
to={`/organizations/${encodeURIComponent(workspace.organization_name)}`}
211+
css={{ color: "inherit" }}
212+
>
213+
{workspace.organization_name}
214+
</Link>
215+
) : (
216+
workspace.organization_name
217+
)
218+
}
219+
subtitle="Organization"
220+
avatar={
221+
activeOrg !== undefined && (
222+
<ExternalAvatar
223+
src={activeOrg.icon}
224+
variant="square"
225+
fitImage
226+
/>
227+
)
228+
}
229+
/>
230+
</HelpTooltipContent>
231+
</Popover>
199232
</>
200233
)}
201234

0 commit comments

Comments
 (0)