Skip to content
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

fix(service-portal): Update notification icon styling #15219

Merged
merged 2 commits into from
Jun 13, 2024
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
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
Loading