Skip to content

Commit ea3973f

Browse files
committed
refactor(site): simplify workspace topbar
1 parent cf17fab commit ea3973f

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

site/src/pages/WorkspacePage/WorkspaceTopbar/WorkspaceTopbar.tsx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
} from "components/FullPageLayout/Topbar";
1212
import Tooltip from "@mui/material/Tooltip";
1313
import ArrowBackOutlined from "@mui/icons-material/ArrowBackOutlined";
14-
import PersonOutlineOutlined from "@mui/icons-material/PersonOutlineOutlined";
1514
import { WorkspaceOutdatedTooltipContent } from "components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip";
1615
import { Popover, PopoverTrigger } from "components/Popover/Popover";
1716
import ScheduleOutlined from "@mui/icons-material/ScheduleOutlined";
@@ -30,6 +29,7 @@ import Link from "@mui/material/Link";
3029
import { useDashboard } from "components/Dashboard/DashboardProvider";
3130
import { displayDormantDeletion } from "utils/dormant";
3231
import DeleteOutline from "@mui/icons-material/DeleteOutline";
32+
import PersonOutline from "@mui/icons-material/PersonOutline";
3333

3434
export type WorkspaceError =
3535
| "getBuildsError"
@@ -120,16 +120,26 @@ export const WorkspaceTopbar = (props: WorkspaceProps) => {
120120
}}
121121
>
122122
<TopbarData>
123-
<TopbarAvatar src={workspace.template_icon} />
124-
<span css={{ fontWeight: 500 }}>{workspace.name}</span>
123+
<TopbarIcon>
124+
<PersonOutline />
125+
</TopbarIcon>
126+
<Tooltip title="Owner">
127+
<span>{workspace.owner_name}</span>
128+
</Tooltip>
125129
<TopbarDivider />
126-
<Link
127-
component={RouterLink}
128-
to={`/templates/${workspace.template_name}`}
129-
css={{ color: "inherit" }}
130+
<Tooltip
131+
title={workspace.template_display_name ?? workspace.template_name}
130132
>
131-
{workspace.template_display_name ?? workspace.template_name}
132-
</Link>
133+
<Link
134+
component={RouterLink}
135+
to={`/templates/${workspace.template_name}`}
136+
css={{ color: "inherit" }}
137+
>
138+
<TopbarAvatar src={workspace.template_icon} />
139+
</Link>
140+
</Tooltip>
141+
142+
<span css={{ fontWeight: 500 }}>{workspace.name}</span>
133143

134144
{workspace.outdated ? (
135145
<Popover mode="hover">
@@ -165,15 +175,6 @@ export const WorkspaceTopbar = (props: WorkspaceProps) => {
165175
)}
166176
</TopbarData>
167177

168-
<TopbarData>
169-
<Tooltip title="Owner">
170-
<TopbarIcon>
171-
<PersonOutlineOutlined aria-label="Owner" />
172-
</TopbarIcon>
173-
</Tooltip>
174-
<span>{workspace.owner_name}</span>
175-
</TopbarData>
176-
177178
{shouldDisplayDormantData && (
178179
<TopbarData>
179180
<TopbarIcon>

0 commit comments

Comments
 (0)