From 15a573baa0cdf7b079e0437ded709e0eef701de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3r=C3=B0ur=20Hafli=C3=B0ason?= Date: Thu, 13 Jun 2024 10:19:12 +0000 Subject: [PATCH] Add option to remove button docline --- .../components/Notifications/NotificationLine.tsx | 2 +- .../src/components/DocumentLine/AvatarImage.tsx | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/service-portal/src/components/Notifications/NotificationLine.tsx b/apps/service-portal/src/components/Notifications/NotificationLine.tsx index 5562f6392382..add475d4efff 100644 --- a/apps/service-portal/src/components/Notifications/NotificationLine.tsx +++ b/apps/service-portal/src/components/Notifications/NotificationLine.tsx @@ -51,7 +51,7 @@ export const NotificationLine = ({ data, onClickCallback }: Props) => { ) : undefined} diff --git a/libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx b/libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx index 5a6e4a77283d..51094f492fc0 100644 --- a/libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx +++ b/libs/service-portal/documents/src/components/DocumentLine/AvatarImage.tsx @@ -13,7 +13,7 @@ interface Props { avatar?: ReactNode onClick?: (event: MouseEvent) => void large?: boolean - ariaLabel?: string + as?: 'div' | 'button' imageClass?: string } @@ -23,7 +23,7 @@ export const AvatarImage: FC = ({ avatar, large, imageClass, - ariaLabel, + as = 'button', onClick, }) => { const { formatMessage } = useLocale() @@ -42,8 +42,12 @@ export const AvatarImage: FC = ({ className={cn(styles.imageContainer, { [styles.largeAvatar]: large, })} - component="button" - aria-label={ariaLabel ?? formatMessage(messages.markAsBulkSelection)} + component={as} + aria-label={ + as === 'button' + ? formatMessage(messages.markAsBulkSelection) + : undefined + } onClick={onClick} > {avatar ? (