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

feat(HighlightedCard): support for alt for image #1135

Merged
merged 2 commits into from
Jun 4, 2024
Merged
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
8 changes: 8 additions & 0 deletions src/highlighted-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type CommonProps = TextProps & {
descriptionLinesMax?: number;
imageUrl?: string;
imageFit?: 'fit' | 'fill' | 'fill-center';
imageAlt?: string;
onClose?: () => void;
trackingEvent?: TrackingEvent | ReadonlyArray<TrackingEvent>;
isInverse?: boolean;
Expand All @@ -55,6 +56,7 @@ const Content = React.forwardRef<HTMLDivElement, Props>((props, ref) => {
description,
imageUrl,
imageFit,
imageAlt,
titleAs = 'h3',
width,
dataAttributes,
Expand Down Expand Up @@ -119,6 +121,12 @@ const Content = React.forwardRef<HTMLDivElement, Props>((props, ref) => {
</div>
{imageUrl && (
<div
{...(imageAlt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could update this in order to use a Mistica Image component instead of a div

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I woudn't touch this component too much. The idea is to deprecate/remove it mid-term

? {
role: 'img',
'aria-label': imageAlt,
}
: {})}
className={styles.imageContent}
style={{
backgroundImage: `url(${imageUrl})`,
Expand Down
Loading