@ndla/ui 49.0.4 → 49.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,6 +29,7 @@ interface Props {
29
29
  imageWidth?: number;
30
30
  name: string;
31
31
  email: string;
32
+ embedAlt?: string;
32
33
  lang?: string;
33
34
  }
34
35
  const BlockWrapper = styled.div`
@@ -135,6 +136,7 @@ const ContactBlock = ({
135
136
  description,
136
137
  name,
137
138
  email,
139
+ embedAlt,
138
140
  blobColor = 'green',
139
141
  blob = 'pointy',
140
142
  lang,
@@ -153,7 +155,7 @@ const ContactBlock = ({
153
155
  {image ? (
154
156
  <>
155
157
  <StyledImage
156
- alt={image.alttext.alttext}
158
+ alt={embedAlt !== undefined ? embedAlt : image.alttext.alttext}
157
159
  src={image.image.imageUrl}
158
160
  sizes={`(min-width: ${breakpoints.tablet}) 240px, (max-width: ${breakpoints.tablet}) 500px`}
159
161
  />
@@ -35,7 +35,8 @@ const IframeEmbed = ({ embed, isConcept }: Props) => {
35
35
 
36
36
  if (embedData.type === 'fullscreen') {
37
37
  const iframeImage = embed.status === 'success' ? embed.data.iframeImage : undefined;
38
- const image = { src: iframeImage?.image.imageUrl ?? '', alt: iframeImage?.alttext?.alttext ?? '' };
38
+ const alt = embedData.alt !== undefined ? embedData.alt : iframeImage?.alttext.alttext;
39
+ const image = { src: iframeImage?.image.imageUrl ?? '', alt: alt ?? '' };
39
40
  return (
40
41
  <Figure type="full">
41
42
  <ResourceBox