Skip to content

Commit

Permalink
Lazy load post card images
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Sep 30, 2023
1 parent 90cf149 commit c0dfbce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const PostCard: VoidComponent<PostCardProps> = (props) => {
return (
<article class={styles.card} style={{ '--hue': hue() }}>
<A href={link()} class={styles.imageLink}>
<img class={styles.indexImg} src={props.post.indexImage} alt="" />
<img class={styles.indexImg} src={props.post.indexImage} alt="" loading="lazy" />
</A>
<div class={styles.labelContainer}>
<For each={props.post.labels}>{(label) => <Label label={label} />}</For>
Expand Down
2 changes: 1 addition & 1 deletion src/state/home.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gql, request } from '@solid-primitives/graphql'
import { createEffect, createResource, Resource, ResourceReturn, useContext } from 'solid-js'
import { createEffect, createResource, Resource, useContext } from 'solid-js'
import { GRAPHQL_BACKEND_URL } from '~/constants'
import { Post } from '~/models/post'
import { StateContext } from './StateProvider'
Expand Down

0 comments on commit c0dfbce

Please sign in to comment.