From 312e03d94f1bd380c528e71cd74d207427fd8550 Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Mon, 13 Nov 2023 15:58:20 +0900 Subject: [PATCH 1/4] improvements for lighthouse scores --- app/[locale]/product/[handle]/page.tsx | 1 + app/[locale]/stories/[handle]/page.tsx | 1 + components/grid/homepage-products.tsx | 2 +- components/layout/menu/modal.tsx | 1 + components/layout/stories-detail.tsx | 1 + components/product/tasting-notes.tsx | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/[locale]/product/[handle]/page.tsx b/app/[locale]/product/[handle]/page.tsx index 3e22b9912..8b943cb79 100644 --- a/app/[locale]/product/[handle]/page.tsx +++ b/app/[locale]/product/[handle]/page.tsx @@ -117,6 +117,7 @@ export default async function ProductPage({ height={product.featuredImage.height} width={product.featuredImage.width} className="h-full w-full object-cover" + priority={true} /> diff --git a/app/[locale]/stories/[handle]/page.tsx b/app/[locale]/stories/[handle]/page.tsx index ed92e8ec4..87a08daba 100644 --- a/app/[locale]/stories/[handle]/page.tsx +++ b/app/[locale]/stories/[handle]/page.tsx @@ -80,6 +80,7 @@ export default async function BlogArticlePage({ height={article?.image.height} width={article?.image.width} className="h-full w-full object-cover" + priority={true} /> )} diff --git a/components/grid/homepage-products.tsx b/components/grid/homepage-products.tsx index 1e1d2e6c1..747ee4221 100644 --- a/components/grid/homepage-products.tsx +++ b/components/grid/homepage-products.tsx @@ -72,7 +72,7 @@ export async function HomepageProducts({ lang }: { lang?: SupportedLocale }) { > - + ); } diff --git a/components/layout/menu/modal.tsx b/components/layout/menu/modal.tsx index a13d60860..ec43660d4 100644 --- a/components/layout/menu/modal.tsx +++ b/components/layout/menu/modal.tsx @@ -26,6 +26,7 @@ export function MenuModal({ scrolled }: { scrolled: boolean }) { type="button" onClick={() => setIsOpen(true)} className="transition-all ease-in-out hover:scale-110" + aria-label="Open menu" > diff --git a/components/layout/stories-detail.tsx b/components/layout/stories-detail.tsx index 38b7d307e..18031191a 100644 --- a/components/layout/stories-detail.tsx +++ b/components/layout/stories-detail.tsx @@ -48,6 +48,7 @@ export default async function StoriesDetail({ 'h-full w-full object-cover', 'transition duration-300 ease-in-out hover:scale-105' )} + priority={true} /> )} diff --git a/components/product/tasting-notes.tsx b/components/product/tasting-notes.tsx index 9366acb99..a90dd5bab 100644 --- a/components/product/tasting-notes.tsx +++ b/components/product/tasting-notes.tsx @@ -27,6 +27,7 @@ export function ProductTastingNotes({ product }: { product: Product }) { width={imageWidth} height={imageHeight} alt={imageAlt || imageUrl} + priority={true} /> )} From 213ed8a723c9b27fa619764624d9273e154f07b3 Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Mon, 13 Nov 2023 17:42:43 +0900 Subject: [PATCH 2/4] fix aria-hidden issue --- components/layout/newsletter-footer.tsx | 1 + components/layout/newsletter-signup.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/components/layout/newsletter-footer.tsx b/components/layout/newsletter-footer.tsx index 98a0862a2..d83360e7c 100644 --- a/components/layout/newsletter-footer.tsx +++ b/components/layout/newsletter-footer.tsx @@ -54,6 +54,7 @@ export default function NewsletterSignup() { type="text" name={`b_${process?.env?.NEXT_PUBLIC_MAILCHIMP_USER_ID}_${process?.env?.NEXT_PUBLIC_MAILCHIMP_LIST_ID}`} defaultValue="" + tabIndex={-1} /> diff --git a/components/layout/newsletter-signup.tsx b/components/layout/newsletter-signup.tsx index 465f9fe48..f9519ea5e 100644 --- a/components/layout/newsletter-signup.tsx +++ b/components/layout/newsletter-signup.tsx @@ -52,6 +52,7 @@ export default function NewsletterSignup() { type="text" name={`b_${process?.env?.NEXT_PUBLIC_MAILCHIMP_USER_ID}_${process?.env?.NEXT_PUBLIC_MAILCHIMP_LIST_ID}`} defaultValue="" + tabIndex={-1} /> From 8f429999847bb30f092564bffb1e7783dd6ebc73 Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Mon, 13 Nov 2023 18:09:30 +0900 Subject: [PATCH 3/4] more aria fixes --- components/layout/footer.tsx | 20 +++++++++++++++++--- components/layout/navbar/index.tsx | 6 +++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/components/layout/footer.tsx b/components/layout/footer.tsx index be0609218..90c50f5d1 100644 --- a/components/layout/footer.tsx +++ b/components/layout/footer.tsx @@ -56,7 +56,11 @@ export default async function Footer({
- +
@@ -72,10 +76,18 @@ export default async function Footer({
- + - +
@@ -105,6 +117,7 @@ export default async function Footer({ className="group" rel="noopener noreferrer" target="_blank" + aria-label="Visit on Instagram" > @@ -113,6 +126,7 @@ export default async function Footer({ className="group" rel="noopener noreferrer" target="_blank" + aria-label="Visit on Facebook" > diff --git a/components/layout/navbar/index.tsx b/components/layout/navbar/index.tsx index a73f00077..cf22be032 100644 --- a/components/layout/navbar/index.tsx +++ b/components/layout/navbar/index.tsx @@ -57,7 +57,11 @@ export default function Navbar({ >
- +
From e14192fea088089db12fbafdcf2330235d50d1eb Mon Sep 17 00:00:00 2001 From: Sol Irvine Date: Mon, 13 Nov 2023 18:22:31 +0900 Subject: [PATCH 4/4] Update add-many-to-cart.tsx --- components/cart/add-many-to-cart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cart/add-many-to-cart.tsx b/components/cart/add-many-to-cart.tsx index 84b670365..8e6db8a2d 100644 --- a/components/cart/add-many-to-cart.tsx +++ b/components/cart/add-many-to-cart.tsx @@ -73,7 +73,7 @@ export function AddManyToCart({