From cea22cbf96da00ee48539532532162e78b9e174a Mon Sep 17 00:00:00 2001 From: ilyasosman Date: Sat, 11 May 2024 23:40:19 +0300 Subject: [PATCH] Add lazy loading to image --- src/components/About.jsx | 11 +++++++---- src/components/BlogDetail.jsx | 2 ++ src/components/Footer.jsx | 10 +++++----- src/components/Home.jsx | 6 ++++++ src/components/JoinUs.jsx | 1 + src/components/Roadmap.jsx | 2 ++ src/components/Rocket.jsx | 3 +++ src/components/Team.jsx | 3 ++- 8 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/components/About.jsx b/src/components/About.jsx index 6172217..5ae1bb1 100644 --- a/src/components/About.jsx +++ b/src/components/About.jsx @@ -54,12 +54,12 @@ const About = () => {
- +
@@ -114,6 +114,7 @@ const About = () => { src={N2_interns} alt="N2 interns" className="block rounded-lg" + loading="lazy" /> Visit to Broglio Space Center in April 2022 supported by Kenya @@ -185,12 +186,13 @@ const About = () => { className="w-full object-contain" src={thumbnail1} alt="" + loading="lazy" />
@@ -211,12 +213,13 @@ const About = () => { className="w-full object-contain" src={thumbnail2} alt="" + loading="lazy" />
diff --git a/src/components/BlogDetail.jsx b/src/components/BlogDetail.jsx index 616d96a..95a9e23 100644 --- a/src/components/BlogDetail.jsx +++ b/src/components/BlogDetail.jsx @@ -59,6 +59,7 @@ const BlogDetail = () => { src={issue.user.avatar_url} alt={issue.user.login} className="w-8 h-8 rounded-full mr-2" + loading="lazy" />

{issue.user.login}

@@ -77,6 +78,7 @@ const BlogDetail = () => { src={comment.user.avatar_url} alt={comment.user.login} className="w-8 h-8 rounded-full mr-2" + loading="lazy" />

{comment.user.login}

diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index 0109cba..be101cb 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -60,35 +60,35 @@ const Footer = () => { target="_blank" className="border border-gray-300 p-2 rounded-full aspect-square text-gray-700 transition-all duration-500 hover:text-blue-600 hover:border-blue-600 focus-within:outline-0 focus-within:text-blue-600 focus-within:border-blue-600" > - github + github - YouTube + YouTube - LinkedIn + LinkedIn - Twitter + Twitter - Insta + Insta diff --git a/src/components/Home.jsx b/src/components/Home.jsx index fa15598..e748e5f 100644 --- a/src/components/Home.jsx +++ b/src/components/Home.jsx @@ -105,6 +105,7 @@ const Home = () => {
{
{
{
{ className="h-9" src="https://ksa.go.ke/assets/images/ksa-logo-new.png-web2-207x165.png" alt="Client logo" + loading="lazy" /> @@ -310,6 +315,7 @@ const Home = () => { className="h-9" src="https://www.jkuat.ac.ke/directorates/dipuil/wp-content/uploads/2015/11/jkuat-logo.png" alt="Client logo" + loading="lazy" /> diff --git a/src/components/JoinUs.jsx b/src/components/JoinUs.jsx index d352ae7..5505ba7 100644 --- a/src/components/JoinUs.jsx +++ b/src/components/JoinUs.jsx @@ -16,6 +16,7 @@ const JoinUs = () => { src="https://nakujaproject.com/image/gallery/dryrun.webp" alt="image" className="mt-4 rounded-lg" + loading="lazy" />
diff --git a/src/components/Roadmap.jsx b/src/components/Roadmap.jsx index 26eb087..550f3c7 100644 --- a/src/components/Roadmap.jsx +++ b/src/components/Roadmap.jsx @@ -26,6 +26,7 @@ const Roadmap = () => ( width={550} height={550} alt="Grid" + loading="lazy" />
@@ -39,6 +40,7 @@ const Roadmap = () => ( width={16} height={16} alt={status} + loading="lazy" />
{status}
diff --git a/src/components/Rocket.jsx b/src/components/Rocket.jsx index ce33bf5..2372459 100644 --- a/src/components/Rocket.jsx +++ b/src/components/Rocket.jsx @@ -151,6 +151,7 @@ const Rocket = () => { src={rocket.image} alt={`${rocket.name} Image`} className="w-full h-auto object-cover rounded-lg" + loading="lazy" /> )} {rocket.image1 && ( @@ -158,6 +159,7 @@ const Rocket = () => { src={rocket.image1} alt={`${rocket.name} Image 1`} className="w-full h-auto object-cover rounded-lg" + loading="lazy" /> )} {rocket.image2 && ( @@ -165,6 +167,7 @@ const Rocket = () => { src={rocket.image2} alt={`${rocket.name} Image 2`} className="w-full h-auto object-cover rounded-lg" + loading="lazy" /> )} diff --git a/src/components/Team.jsx b/src/components/Team.jsx index b6a9839..82ee670 100644 --- a/src/components/Team.jsx +++ b/src/components/Team.jsx @@ -5,12 +5,13 @@ const TeamCard = ({ name, position, education, image }) => (
{image ? ( - {name} + {name} ) : ( Placeholder )}