mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-02-15 12:53:07 +00:00
Fix some performance issues
* Remove render blocking stripe JS that seems unnecessary * Use native lazy loading of images - Truly a progressive enhancement, only affects browsers that support it - Causes a warning: [Intervention] An <img> element was lazyloaded with loading=lazy, but had no dimensions specified. Specifying dimensions improves performance. See https://crbug.com/954323, which can not be easily fixed * Render content first, hydrate after that
This commit is contained in:
committed by
Aarni Koskela
parent
fb4fb44ef6
commit
bec251c4e6
@@ -34,7 +34,7 @@ export default class Feed extends React.Component {
|
||||
|
||||
render() {
|
||||
const messages = this.state.messages.map((message, i) => {
|
||||
let image = <img src={message.image} alt="" />;
|
||||
let image = <img src={message.image} alt="" loading="lazy" />;
|
||||
|
||||
if (message.imageLink) {
|
||||
image = (
|
||||
|
||||
@@ -14,6 +14,7 @@ const SponsorLink = ({ href, name }: Props) => (
|
||||
src={`/static/images/sponsors/${name.toLowerCase()}.svg`}
|
||||
alt={name}
|
||||
className={`sponsor sponsor__${name.toLowerCase()}`}
|
||||
loading="lazy"
|
||||
/>
|
||||
</a>
|
||||
);
|
||||
|
||||
@@ -23,7 +23,15 @@ export default class Members extends React.Component {
|
||||
const members = this.state.members.map((member) => {
|
||||
const src = `${member.avatar_url}&s=120`;
|
||||
return (
|
||||
<img className="member" key={member.avatar_url} src={src} alt="" />
|
||||
<img
|
||||
className="member"
|
||||
key={member.avatar_url}
|
||||
src={src}
|
||||
alt=""
|
||||
width={30}
|
||||
height={30}
|
||||
loading="lazy"
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user