From 5afdfe9e16eea032544fd6ff7b382c8a3b640566 Mon Sep 17 00:00:00 2001 From: Konrad Szwarc Date: Thu, 19 Jan 2023 00:01:55 +0100 Subject: [PATCH] Apply Lighthouse suggestions (#162) --- src/components/photo.astro | 9 ++++++--- src/components/theme-toggle.astro | 1 + src/sections/favorites/book-tile.astro | 2 +- src/sections/favorites/media-tile.astro | 2 +- src/sections/favorites/person-tile.astro | 8 +++++++- src/sections/favorites/video-tile.astro | 2 +- src/sections/main/main-section.astro | 8 +++++++- src/sections/portfolio/project-timeline-item.astro | 8 +++++++- src/sections/testimonials/testimonial.astro | 2 +- 9 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/components/photo.astro b/src/components/photo.astro index 2afdb1f..c471ecc 100644 --- a/src/components/photo.astro +++ b/src/components/photo.astro @@ -8,9 +8,12 @@ export interface Props { alt: string; class?: string; loading?: 'eager' | 'lazy'; + width?: number; + height?: number; } -const { src, alt, loading } = Astro.props; +const { src, loading, ...props } = Astro.props; + const className = Astro.props.class ?? ''; const isRemoteImage = typeof src === 'string'; @@ -18,8 +21,8 @@ const isRemoteImage = typeof src === 'string'; { isRemoteImage ? ( - {alt} + ) : ( - {alt} + ) } diff --git a/src/components/theme-toggle.astro b/src/components/theme-toggle.astro index 4b098ca..be9fb13 100644 --- a/src/components/theme-toggle.astro +++ b/src/components/theme-toggle.astro @@ -4,6 +4,7 @@ import Icon from './icon.astro';
diff --git a/src/sections/portfolio/project-timeline-item.astro b/src/sections/portfolio/project-timeline-item.astro index cc3221d..cdbb204 100644 --- a/src/sections/portfolio/project-timeline-item.astro +++ b/src/sections/portfolio/project-timeline-item.astro @@ -21,7 +21,13 @@ const alt = `Thumbnail for ${name} project`;
-