Skip to content

Commit 669cad5

Browse files
Fix changes dropdown alignment (#20023)
1 parent a14d908 commit 669cad5

File tree

4 files changed

+20
-25
lines changed

4 files changed

+20
-25
lines changed

components/dashboard/src/components/PendingChangesDropdown.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
import ContextMenu, { ContextMenuEntry } from "./ContextMenu";
88
import CaretDown from "../icons/CaretDown.svg";
99
import { WorkspaceGitStatus } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb";
10+
import { cn } from "@podkit/lib/cn";
1011

11-
export default function PendingChangesDropdown({ gitStatus }: { gitStatus?: WorkspaceGitStatus }) {
12+
type Props = {
13+
gitStatus?: WorkspaceGitStatus;
14+
className?: string;
15+
};
16+
export default function PendingChangesDropdown({ gitStatus, className }: Props) {
1217
const headingStyle = "text-gray-500 dark:text-gray-400 text-left";
1318
const itemStyle = "text-gray-400 dark:text-gray-500 text-left -mt-5";
1419
const menuEntries: ContextMenuEntry[] = [];
@@ -42,9 +47,9 @@ export default function PendingChangesDropdown({ gitStatus }: { gitStatus?: Work
4247
return (
4348
<ContextMenu
4449
menuEntries={menuEntries}
45-
customClasses="w-64 max-h-48 overflow-y-scroll overflow-x-clip mx-auto left-0 right-0"
50+
customClasses={"w-64 max-h-48 overflow-y-scroll overflow-x-clip mx-auto left-0 right-0"}
4651
>
47-
<p className="flex items-center text-gitpod-red">
52+
<p className={cn("flex items-center text-gitpod-red", className)}>
4853
<span>
4954
{totalChanges} Change{totalChanges === 1 ? "" : "s"}
5055
</span>

components/dashboard/src/start/StartWorkspace.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,10 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps,
722722
</a>
723723
</div>
724724
</div>
725-
<PendingChangesDropdown gitStatus={this.state.workspace.status.gitStatus} />
725+
<PendingChangesDropdown
726+
gitStatus={this.state.workspace.status.gitStatus}
727+
className="justify-center"
728+
/>
726729
<div className="mt-10 justify-center flex space-x-2">
727730
<a target="_parent" href={gitpodHostUrl.asWorkspacePage().toString()}>
728731
<Button variant="secondary">Go to Dashboard</Button>

components/dashboard/src/workspaces/WorkspacesSearchBar.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
*/
66

77
import { FunctionComponent } from "react";
8-
import { Link } from "react-router-dom";
98
import { StartWorkspaceModalKeyBinding } from "../App";
109
import DropDown from "../components/DropDown";
1110
import search from "../icons/search.svg";
12-
import { Button } from "@podkit/buttons/Button";
11+
import { LinkButton } from "@podkit/buttons/LinkButton";
1312

1413
type WorkspacesSearchBarProps = {
1514
searchTerm: string;
@@ -67,11 +66,9 @@ export const WorkspacesSearchBar: FunctionComponent<WorkspacesSearchBarProps> =
6766
]}
6867
/>
6968
</div>
70-
<Link to={"/new"}>
71-
<Button className="ml-2 gap-1.5 h-10">
72-
New Workspace <span className="opacity-60 hidden md:inline">{StartWorkspaceModalKeyBinding}</span>
73-
</Button>
74-
</Link>
69+
<LinkButton href={"/new"} className="ml-2 gap-1.5 h-10">
70+
New Workspace <span className="opacity-60 hidden md:inline">{StartWorkspaceModalKeyBinding}</span>
71+
</LinkButton>
7572
</div>
7673
);
7774
};

yarn.lock

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5530,20 +5530,10 @@ caniuse-api@^3.0.0:
55305530
lodash.memoize "^4.1.2"
55315531
lodash.uniq "^4.5.0"
55325532

5533-
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001271:
5534-
version "1.0.30001274"
5535-
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001274.tgz"
5536-
integrity sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew==
5537-
5538-
caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001520:
5539-
version "1.0.30001521"
5540-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001521.tgz#e9930cf499f7c1e80334b6c1fbca52e00d889e56"
5541-
integrity sha512-fnx1grfpEOvDGH+V17eccmNjucGUnCbP6KL+l5KqBIerp26WK/+RQ7CIDE37KGJjaPyqWXXlFUyKiWmvdNNKmQ==
5542-
5543-
caniuse-lite@^1.0.30001587, caniuse-lite@^1.0.30001599:
5544-
version "1.0.30001600"
5545-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001600.tgz#93a3ee17a35aa6a9f0c6ef1b2ab49507d1ab9079"
5546-
integrity sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==
5533+
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001271, caniuse-lite@^1.0.30001517, caniuse-lite@^1.0.30001520, caniuse-lite@^1.0.30001587, caniuse-lite@^1.0.30001599:
5534+
version "1.0.30001641"
5535+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001641.tgz"
5536+
integrity sha512-Phv5thgl67bHYo1TtMY/MurjkHhV4EDaCosezRXgZ8jzA/Ub+wjxAvbGvjoFENStinwi5kCyOYV3mi5tOGykwA==
55475537

55485538
case-anything@^2.1.13:
55495539
version "2.1.13"

0 commit comments

Comments
 (0)