Skip to content

Commit

Permalink
docs(homepage): lazy load images
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan committed Aug 27, 2024
1 parent a154fcf commit 48dd905
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const CompanyItem = ({ item }: { item: Company }) => {
const { logo, name, url, text, width } = item;
return (
<Link className={styles.logo} href={url}>
<img src={logo} alt={name} style={{ width }} />
<img src={logo} alt={name} style={{ width }} loading="lazy" />
{text !== undefined ? (
<span className={styles.logoText}>{text}</span>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const FullyFeatured = memo(() => {
src={icon}
alt={index.toString()}
className={styles.icon}
loading="lazy"
/>
<div className={styles.featureContent}>
<h2 className={styles.featureTitle}>{title}</h2>
Expand Down
7 changes: 6 additions & 1 deletion website/theme/components/Landingpage/ToolStack/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ const ToolStack: React.FC = memo(() => {
{tools.map(({ name, desc, logo, url }) => {
return (
<Link className={styles.tool} key={name} href={url}>
<img src={logo} alt={name} className={styles.logo} />
<img
src={logo}
alt={name}
className={styles.logo}
loading="lazy"
/>
<h3 className={styles.toolTitle}>{name}</h3>
<p className={styles.toolDescription}>{desc}</p>
</Link>
Expand Down

0 comments on commit 48dd905

Please sign in to comment.