@ndla/ui 45.0.2 → 45.0.4

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.
@@ -14,6 +14,7 @@ import { BlobPointy, BlobRound } from '@ndla/icons/common';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import concat from 'lodash/concat';
16
16
  import { errorSvgSrc } from '../Embed/ImageEmbed';
17
+ import Image from '../Image';
17
18
 
18
19
  const BLOB_WIDTH = 90;
19
20
 
@@ -36,11 +37,10 @@ const BlockWrapper = styled.div`
36
37
  border-radius: ${misc.borderRadius};
37
38
  border: 1px solid ${colors.brand.lighter};
38
39
  background-color: ${colors.white};
39
- max-width: 348px;
40
40
  & ~ & {
41
41
  margin-top: ${spacing.medium};
42
42
  }
43
- ${mq.range({ from: breakpoints.tabletWide })} {
43
+ ${mq.range({ from: breakpoints.tablet })} {
44
44
  max-width: 773px;
45
45
  flex-direction: row;
46
46
  padding: 0 0 ${spacing.medium} ${spacing.medium};
@@ -104,7 +104,7 @@ const ImageWrapper = styled.div`
104
104
  gap: ${spacing.xsmall};
105
105
  ${fonts.sizes('16px', '26px')};
106
106
  padding: ${spacing.medium} ${spacing.medium} 0 0;
107
- ${mq.range({ from: breakpoints.tabletWide })} {
107
+ ${mq.range({ from: breakpoints.tablet })} {
108
108
  padding-right: 0;
109
109
  }
110
110
  `;
@@ -122,7 +122,7 @@ const ContentWrapper = styled.div`
122
122
  width: 100%;
123
123
  `;
124
124
 
125
- const StyledImage = styled.img`
125
+ const StyledImage = styled(Image)`
126
126
  object-fit: cover;
127
127
  `;
128
128
 
@@ -137,7 +137,11 @@ const ContactBlock = ({ image, jobTitle, description, name, email, blobColor = '
137
137
  <ImageWrapper>
138
138
  {image ? (
139
139
  <>
140
- <StyledImage alt={image.alttext.alttext} src={`${image.image.imageUrl}?width=286`} />
140
+ <StyledImage
141
+ alt={image.alttext.alttext}
142
+ src={image.image.imageUrl}
143
+ sizes={`(min-width: ${breakpoints.tablet}) 240px, (max-width: ${breakpoints.tablet}) 500px`}
144
+ />
141
145
  {`${t('photo')}: ${authors.reduce((acc, name) => (acc = `${acc} ${name?.name}`), '')} ${
142
146
  image.copyright.license.license
143
147
  }`}
@@ -153,7 +157,7 @@ const ContactBlock = ({ image, jobTitle, description, name, email, blobColor = '
153
157
  <StyledText>{jobTitle}</StyledText>
154
158
  <StyledText>
155
159
  <Email>{`${t('email')}:`}</Email>
156
- <EmailLink href={`mailto:${email}?subject=Contact us`}>{email}</EmailLink>
160
+ <EmailLink href={`mailto:${email}`}>{email}</EmailLink>
157
161
  </StyledText>
158
162
  </InfoWrapper>
159
163
  <BlobWrapper>