Skip to content

Commit

Permalink
Merge pull request #2663 from NDLANO/fix/do-not-fall-back-to-empty-sr…
Browse files Browse the repository at this point in the history
…c-string

fix: do not fall back to empty src string
  • Loading branch information
Jonas-C authored Jan 3, 2025
2 parents 14e4431 + 5ab6797 commit 7eff1eb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/ndla-ui/src/Embed/ExternalEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const ExternalEmbed = ({ embed }: Props) => {

if (embedData.type === "fullscreen") {
const image = {
src: data.iframeImage?.image.imageUrl ?? "",
src: data.iframeImage?.image.imageUrl,
alt: embedData.alt !== undefined ? embedData.alt : (data.iframeImage?.alttext?.alttext ?? ""),
};
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/ndla-ui/src/Embed/IframeEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const IframeEmbed = ({ embed }: Props) => {
if (embedData.type === "fullscreen") {
const iframeImage = embed.status === "success" ? data.iframeImage : undefined;
const alt = embedData.alt !== undefined ? embedData.alt : iframeImage?.alttext.alttext;
const image = { src: iframeImage?.image.imageUrl ?? "", alt: alt ?? "" };
const image = { src: iframeImage?.image.imageUrl, alt: alt ?? "" };
return (
<Figure data-embed-type="iframe">
<ResourceBox
Expand Down
2 changes: 1 addition & 1 deletion packages/ndla-ui/src/ResourceBox/ResourceBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const StyledText = styled(Text, {
});

interface ImageMeta {
src: string;
src: string | undefined;
alt: string;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ndla-video-search/src/VideoListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const VideoListItem = ({ video, onVideoSelect, translations, locale }: Vi
return (
<li>
<StyledListItemRoot context="list" nonInteractive>
<StyledImage src={video.images?.thumbnail?.src ?? ""} alt="" variant="rounded" />
<StyledImage src={video.images?.thumbnail?.src} alt="" variant="rounded" />
<StyledListItemContent>
<StyledVideoMeta>
<Text textStyle="title.medium">
Expand Down

0 comments on commit 7eff1eb

Please sign in to comment.