Skip to content

Commit

Permalink
fix(service-portal): Update notification icon styling (#15219)
Browse files Browse the repository at this point in the history
* Update notification icon styling

* Add option to remove button docline
  • Loading branch information
thordurhhh authored Jun 13, 2024
1 parent f26bd9d commit 5bf7cbd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export const NotificationLine = ({ data, onClickCallback }: Props) => {
<AvatarImage
img={data.sender.logoUrl}
background={!isRead ? 'white' : 'blue100'}
as="div"
imageClass={styles.img}
/>
) : undefined}
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ export const link = style({
overflow: 'hidden',
})

export const img = style({
height: 'auto',
width: 'auto',
display: 'flex',
maxHeight: 28,
maxWidth: 28,
})

globalStyle(`${link} > span`, {
boxShadow: 'none',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ export const avatar = style({
})

export const circleImg = style({
width: '28px',
height: 'auto',
width: 'auto',
display: 'flex',
maxHeight: 38,
maxWidth: 38,
})

export const button = style({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ interface Props {
avatar?: ReactNode
onClick?: (event: MouseEvent<HTMLElement>) => void
large?: boolean
as?: 'div' | 'button'
imageClass?: string
}

export const AvatarImage: FC<Props> = ({
img,
background,
avatar,
large,
imageClass,
as = 'button',
onClick,
}) => {
const { formatMessage } = useLocale()
Expand All @@ -38,14 +42,24 @@ export const AvatarImage: FC<Props> = ({
className={cn(styles.imageContainer, {
[styles.largeAvatar]: large,
})}
component="button"
aria-label={formatMessage(messages.markAsBulkSelection)}
component={as}
aria-label={
as === 'button'
? formatMessage(messages.markAsBulkSelection)
: undefined
}
onClick={onClick}
>
{avatar ? (
avatar
) : (
<img className={styles.image} src={img} alt="document" />
<img
className={cn(styles.image, {
[`${imageClass}`]: imageClass,
})}
src={img}
alt="document"
/>
)}
</Box>
)
Expand Down

0 comments on commit 5bf7cbd

Please sign in to comment.