Skip to content

Commit

Permalink
Topの一覧の画像にloading='lazy'
Browse files Browse the repository at this point in the history
  • Loading branch information
mehm8128 committed Mar 23, 2024
1 parent 009619f commit c05c8cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const BookListItem: React.FC<Props> = ({ book }) => {
<Flex align="flex-start" gap={Space * 2.5} justify="flex-start">
{imageUrl != null && (
<_ImgWrapper>
<Image alt={book.name} height={64} objectFit="cover" src={imageUrl} width={64} />
<Image alt={book.name} height={64} loading="lazy" objectFit="cover" src={imageUrl} width={64} />
</_ImgWrapper>
)}
<Box width="100%">
Expand Down
11 changes: 9 additions & 2 deletions workspaces/app/src/features/feature/components/FeatureCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const FeatureCard: React.FC<Props> = ({ book }) => {
<_Wrapper to={`/books/${book.id}`}>
{imageUrl != null && (
<_ImgWrapper>
<Image alt={book.image.alt} height={96} objectFit="cover" src={imageUrl} width={96} />
<Image alt={book.image.alt} height={96} loading="lazy" objectFit="cover" src={imageUrl} width={96} />
</_ImgWrapper>
)}

Expand All @@ -71,7 +71,14 @@ const FeatureCard: React.FC<Props> = ({ book }) => {
<Flex align="center" gap={Space * 1} justify="flex-end">
{authorImageUrl != null && (
<_AvatarWrapper>
<Image alt={book.author.name} height={32} objectFit="cover" src={authorImageUrl} width={32} />
<Image
alt={book.author.name}
height={32}
loading="lazy"
objectFit="cover"
src={authorImageUrl}
width={32}
/>
</_AvatarWrapper>
)}
<Text color={Color.MONO_100} typography={Typography.NORMAL14}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const RankingCard: React.FC<Props> = ({ book }) => {
<Flex align="flex-start" gap={Space * 2.5} justify="flex-start">
{imageUrl != null && (
<_ImgWrapper>
<Image alt={book.name} height={96} objectFit="cover" src={imageUrl} width={96} />
<Image alt={book.name} height={96} loading="lazy" objectFit="cover" src={imageUrl} width={96} />
</_ImgWrapper>
)}
<Box width="100%">
Expand All @@ -74,6 +74,7 @@ const RankingCard: React.FC<Props> = ({ book }) => {
<Image
alt={`${book.author.name}のアイコン`}
height={32}
loading="lazy"
objectFit="cover"
src={authorImageUrl}
width={32}
Expand Down

0 comments on commit c05c8cd

Please sign in to comment.