Skip to content

Commit 0c49db5

Browse files
authored
fix: restyle collaborator remove button (#793)
1 parent ce921eb commit 0c49db5

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/components/AccessSettingsEditor.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ describe("AccessSettingsEditor", () => {
9898

9999
const remove = within(popover).getByRole("button", { name: "Remove Alice" });
100100
expect(remove).toHaveAttribute("title", "Remove Alice");
101+
expect(remove).toHaveClass("btn-icon");
102+
expect(remove).not.toHaveClass("inline-action");
103+
expect(remove).not.toHaveClass("inline-action-icon");
101104
await userEvent.click(remove);
102105
expect(onRemoveCollaborator).toHaveBeenCalledWith("user-1");
103106

src/components/AccessSettingsEditor.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,17 @@ export function AccessSettingsEditor({
190190
<option value="viewer">Viewer</option>
191191
<option value="editor">Editor</option>
192192
</select>
193-
<button
193+
<ActionButton
194194
aria-label={`Remove ${label}`}
195-
className="inline-action inline-action-icon access-collaborator-remove"
195+
className="access-collaborator-remove"
196196
disabled={disabled}
197197
onClick={() => onRemoveCollaborator(user.id)}
198+
size="icon"
198199
title={`Remove ${label}`}
199200
type="button"
200201
>
201202
<Trash2 aria-hidden="true" size={14} strokeWidth={2} />
202-
</button>
203+
</ActionButton>
203204
</div>
204205
);
205206
})

src/components/ActionButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Button } from "./ui/Button";
55
type ActionButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
66
children: ReactNode;
77
variant?: "default" | "danger";
8+
size?: "default" | "icon";
89
};
910

1011
export const ActionButton = forwardRef<HTMLButtonElement, ActionButtonProps>(({ variant = "default", ...props }, ref) => (

0 commit comments

Comments
 (0)