8000 chore: replace MoreMenu with DropdownMenu by jaaydenh · Pull Request #17615 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: replace MoreMenu with DropdownMenu #17615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update MoreMenu to use DropdownMenu
  • Loading branch information
jaaydenh committed May 1, 2025
commit fe820b37f5a1392277d6fedf3627215a82812458
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import TableCell from "@mui/material/TableCell";
import TableRow from "@mui/material/TableRow";
import type { BannerConfig } from "api/typesGenerated";
import { Button } from "components/Button/Button";
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "components/DropdownMenu/DropdownMenu";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "components/DropdownMenu/DropdownMenu";
import { EllipsisVertical } from "lucide-react";
import type { FC } from "react";

Expand Down Expand Up @@ -46,19 +51,13 @@ export const AnnouncementBannerItem: FC<AnnouncementBannerItemProps> = ({
<TableCell>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
size="icon-lg"
variant="subtle"
aria-label="Open menu"
>
<Button size="icon-lg" variant="subtle" aria-label="Open menu">
<EllipsisVertical aria-hidden="true" />
<span className="sr-only">Open menu</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
onClick={() => onEdit()}
>
<DropdownMenuItem onClick={() => onEdit()}>
Edit&hellip;
</DropdownMenuItem>
<DropdownMenuItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ import type {
} from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";
import { Avatar } from "components/Avatar/Avatar";
import { Loader } from "components/Loader/Loader";
import { Button } from "components/Button/Button";
import {
MoreMenu,
MoreMenuContent,
MoreMenuItem,
MoreMenuTrigger,
ThreeDotsButton,
} from "components/MoreMenu/MoreMenu";
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "components/DropdownMenu/DropdownMenu";
import { Loader } from "components/Loader/Loader";
import { Stack } from "components/Stack/Stack";
import { TableEmpty } from "components/TableEmpty/TableEmpty";
import { EllipsisVertical } from "lucide-react";
import type { ExternalAuthPollingState } from "pages/CreateWorkspacePage/CreateWorkspacePage";
import { type FC, useCallback, useEffect, useState } from "react";
import { useQuery } from "react-query";
Expand Down Expand Up @@ -178,12 +179,15 @@ const ExternalAuthRow: FC<ExternalAuthRowProps> = ({
</LoadingButton>
</TableCell>
<TableCell>
<MoreMenu>
<MoreMenuTrigger>
<ThreeDotsButton size="small" disabled={!authenticated} />
</MoreMenuTrigger>
<MoreMenuContent>
<MoreMenuItem
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button size="icon-lg" variant="subtle" aria-label="Open menu">
<EllipsisVertical aria-hidden="true" />
<span className="sr-only">Open menu</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
onClick={async () => {
onValidateExternalAuth();
// This is kinda jank. It does a refetch of the thing
Expand All @@ -194,19 +198,18 @@ const ExternalAuthRow: FC<ExternalAuthRowProps> = ({
}}
>
Test Validate&hellip;
</MoreMenuItem>
<Divider />
<MoreMenuItem
danger
</DropdownMenuItem>
<DropdownMenuItem
className="text-content-destructive focus:text-content-destructive"
onClick={async () => {
onUnlinkExternalAuth();
await refetch();
}}
>
Unlink&hellip;
</MoreMenuItem>
</MoreMenuContent>
</MoreMenu>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</TableCell>
</TableRow>
);
Expand Down
0