Skip to content

Commit

Permalink
lazy load poll & option images
Browse files Browse the repository at this point in the history
  • Loading branch information
dsevillamartin committed May 20, 2024
1 parent 474c745 commit db8d93f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/src/forum/components/Poll/PollOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class PollOption extends Component<PollOptionAttrs, PollState> {

<div className="PollAnswer-text">{this.optionDisplayItems().toArray()}</div>

{this.option.imageUrl() ? <img className="PollAnswer-image" src={this.option.imageUrl()} alt={this.option.answer()} /> : null}
{this.option.imageUrl() ? <img className="PollAnswer-image" src={this.option.imageUrl()} alt={this.option.answer()} loading="lazy" /> : null}
</label>
);

Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/components/PostPoll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default class PostPoll extends Component<PostPollAttrs> {
{canSeeVoteCount && <span className={classList('PollPercent', percent !== 100 && 'PollPercent--option')}>{percent}%</span>}
</div>

{opt.imageUrl() ? <img className="PollAnswer-image" src={opt.imageUrl()} alt={opt.answer()} /> : null}
{opt.imageUrl() ? <img className="PollAnswer-image" src={opt.imageUrl()} alt={opt.answer()} loading="lazy" /> : null}
</div>
);

Expand Down

0 comments on commit db8d93f

Please sign in to comment.