Skip to content

Commit 15b87c9

Browse files
Accessible workspace pinning (#20024)
1 parent ecd52dc commit 15b87c9

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

components/dashboard/src/workspaces/WorkspaceEntry.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { Workspace } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb";
1616
import { GitBranchIcon, PinIcon } from "lucide-react";
1717
import { useUpdateWorkspaceMutation } from "../data/workspaces/update-workspace-mutation";
1818
import { fromWorkspaceName } from "./RenameWorkspaceModal";
19+
import { Button } from "@podkit/buttons/Button";
20+
import { cn } from "@podkit/lib/cn";
1921

2022
type Props = {
2123
info: Workspace;
@@ -112,23 +114,24 @@ export const WorkspaceEntry: FunctionComponent<Props> = ({ info, shortVersion })
112114
</Tooltip>
113115
</div>
114116
<div className="min-w-8 flex items-center">
115-
<div
116-
onClick={togglePinned}
117-
className={
118-
"group px-2 flex items-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md cursor-pointer h-8 w-8"
119-
}
120-
>
121-
<Tooltip content={workspace.metadata?.pinned ? "Unpin" : "Pin"}>
117+
<Tooltip content={workspace.metadata?.pinned ? "Unpin" : "Pin"}>
118+
<Button
119+
onClick={togglePinned}
120+
variant={"ghost"}
121+
className={
122+
"group px-2 flex items-center hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md w-8 h-8"
123+
}
124+
>
122125
<PinIcon
123-
className={
124-
"w-4 h-4 self-center " +
125-
(workspace.metadata?.pinned
126+
className={cn(
127+
"w-4 h-4 self-center",
128+
workspace.metadata?.pinned
126129
? "text-gray-600 dark:text-gray-300"
127-
: "text-gray-300 dark:text-gray-600 group-hover:text-gray-600 dark:group-hover:text-gray-300")
128-
}
130+
: "text-gray-300 dark:text-gray-600 group-hover:text-gray-600 dark:group-hover:text-gray-300",
131+
)}
129132
/>
130-
</Tooltip>
131-
</div>
133+
</Button>
134+
</Tooltip>
132135
</div>
133136
<WorkspaceEntryOverflowMenu changeMenuState={changeMenuState} info={info} />
134137
</>

0 commit comments

Comments
 (0)