Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions .changeset/plain-avatar-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ describe('the user profile profile section', () => {

await openMenu(actor, await screen.findByRole('button', { name: 'Manage profile picture' }));
expect(screen.getByRole('menuitem', { name: 'Remove avatar' })).toBeInTheDocument();
expect(screen.getByRole('menuitem', { name: 'Change avatar' }).querySelector('svg')).toBeNull();
expect(screen.getByRole('menuitem', { name: 'Remove avatar' }).querySelector('svg')).toBeNull();
expect(screen.getByRole('menuitem', { name: 'Remove avatar' })).toHaveAttribute('data-color', 'negative');
});

it('says why an upload was refused', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { ActionMenu } from '../../../components/action-menu';
import { Avatar } from '../../../components/avatar';
import { Button } from '../../../components/button';
import { Section } from '../../../components/section';
import { Pen } from '../../../icons/glyphs/pen';
import { X } from '../../../icons/glyphs/x';
import { useMessages } from '../../../localization';
import { FileUpload } from '../../../primitives/file-upload';
import type { UserProfilePictureController } from './user-profile-picture.controller';
Expand Down Expand Up @@ -92,11 +90,11 @@ function ProfilePictureActions({
const actions: ActionMenuAction[] = [];

if (hasImage && canChange) {
actions.push({ label: m.picture.change, icon: Pen, onClick: openFilePicker });
actions.push({ label: m.picture.change, onClick: openFilePicker });
}

if (hasImage && onRemove) {
actions.push({ label: m.picture.remove, icon: X, onClick: onRemove });
actions.push({ label: m.picture.remove, color: 'negative', onClick: onRemove });
}

if (actions.length > 0) {
Expand Down
Loading