Pārlūkot izejas kodu

lazy load images

AykutSarac 2 gadi atpakaļ
vecāks
revīzija
4b7100a365
2 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 7 1
      src/components/Sponsors/index.tsx
  2. 1 0
      src/containers/Home/index.tsx

+ 7 - 1
src/components/Sponsors/index.tsx

@@ -86,7 +86,13 @@ export const Sponsors = () => {
       {sponsors.users.map((user) => (
         <StyledSponsor handle={user.handle} key={user.handle}>
           <a href={user.profile}>
-            <img src={user.avatar} alt={user.handle} width="40" height="40" />
+            <img
+              src={user.avatar}
+              alt={user.handle}
+              width="40"
+              height="40"
+              loading="lazy"
+            />
           </a>
         </StyledSponsor>
       ))}

+ 1 - 0
src/containers/Home/index.tsx

@@ -85,6 +85,7 @@ const Home: React.FC = () => {
             height="863"
             src="/jsonvisio-screenshot.webp"
             alt="preview"
+            loading="lazy"
           />
         </Styles.StyledImageWrapper>
       </Styles.StyledPreviewSection>