Skip to content

Commit

Permalink
Reverting the prefetch page and adding lazy loading
Browse files Browse the repository at this point in the history
  • Loading branch information
amankumarrr committed Oct 1, 2024
1 parent d92b65d commit d804cbb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions components/blocks/flag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const Flag = ({ country, height, width, className = "" }: FlagProps) => {
width={width || 35}
height={height || 35}
alt="country"
loading="lazy"
/>
</>
);
Expand Down
6 changes: 2 additions & 4 deletions components/blocks/serviceCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const Image = dynamic(() => import("next/image"), { ssr: false });
import type { Template } from "tinacms";

import dynamic from "next/dynamic";
import Link from "next/link";
import { CustomLink } from "../customLink";
import { Container } from "../util/container";
import { Section } from "../util/section";
Expand Down Expand Up @@ -77,10 +76,9 @@ const BigCards = ({ title, cards, schema }) => {
bgColor[card.color]
} hover:opacity-80`}
>
<Link
<CustomLink
href={card.link ?? ""}
className="unstyled flex grow text-left text-white"
prefetch={false}
>
<div className="flex grow flex-col">
{card?.imgSrc && (
Expand Down Expand Up @@ -121,7 +119,7 @@ const BigCards = ({ title, cards, schema }) => {
)}
</div>
</div>
</Link>
</CustomLink>
</li>
))}
</ul>
Expand Down
1 change: 1 addition & 0 deletions components/blocks/verticalImageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const RawImage = ({ data }) => {
height={data.height ?? 0}
width={data.width ?? 0}
sizes={data.sizes}
loading="lazy"
/>
);
};
Expand Down

0 comments on commit d804cbb

Please sign in to comment.