Skip to content

Commit 47955e3

Browse files
committed
lazy loading images
1 parent b94e225 commit 47955e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export default function App() {
2222
return (
2323
<>
2424
<h1 className={styles.h1}>🤍 none of this is useful 🤍</h1>
25-
{list.map(([route, { meta, git }]) => (
25+
{list.map(([route, { meta, git }], i) => (
2626
<Link key={route} className={styles.route} href={`/${route as Routes}`}>
2727
<h2 style={{ viewTransitionName: route }} className={styles.link}>{meta.title}</h2>
2828
{'tags' in meta && meta.tags.length > 0 && (<p className={styles.tags}>{meta.tags.map(t => <span key={t}>{t}</span>)}</p>)}
2929
<p>Created on: {git.firstAdded && formatter.format(git.firstAdded)}</p>
30-
{'image' in meta && meta.image && <img src={meta.image} className={styles.bg} />}
30+
{'image' in meta && meta.image && <img src={meta.image} className={styles.bg} loading={i > 5 ? 'lazy' : 'eager'} />}
3131
</Link>
3232
))}
3333
</>

0 commit comments

Comments
 (0)