Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy loading #46

Closed
wants to merge 10 commits into from
Closed

Lazy loading #46

wants to merge 10 commits into from

Conversation

alextio
Copy link
Contributor

@alextio alextio commented Sep 23, 2024

Add lazy loading optimizations to People and Publications page and make slight UI tweaks according to Juho's feedback.

@alextio alextio self-assigned this Sep 23, 2024
Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for kaistinteractionlab ready!

Name Link
🔨 Latest commit 2392c27
🔍 Latest deploy log https://app.netlify.com/sites/kaistinteractionlab/deploys/66f1479873d1dd0008e39a5f
😎 Deploy Preview https://deploy-preview-46--kaistinteractionlab.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 75 (🔴 down 22 from production)
Accessibility: 98 (🟢 up 1 from production)
Best Practices: 83 (🔴 down 9 from production)
SEO: 83 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@alextio alextio changed the title Lazy Lazy loading Sep 23, 2024

const onError = () => {
setImageSrc(fallbackSrc)
}

return <Image {...props} src={imageSrc} alt={props.alt} onError={onError} />
return <div ref={ref}>{inView ? <Image {...props} src={imageSrc} alt={props.alt} onError={onError} /> : null}</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<Image/> from nextjs supports lazy loading. Why do we need this?
https://nextjs.org/docs/pages/api-reference/components/image#loading
Plus, switching between null (zero-size) and Image (fixed-size) will cause flickering

@@ -127,12 +127,34 @@ const DropDownMenu = styled.div`
}
`

const HamburgerButton = styled.button`
const HamburgerButton = styled.input`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should stay as a button.

background-color: white;
border: none;
cursor: pointer;

& > span {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad pattern. I would define each stick with another styled component.

@@ -145,9 +149,12 @@ export default function Page() {
>
<SectionTitle>{sectionName}</SectionTitle>
<SectionContent>
{publicationList[sectionName].map(pub => (
{/* {publicationList[sectionName].map(pub => (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this if we don't use it

@jhw123 jhw123 deleted the branch renewal September 24, 2024 17:20
@jhw123 jhw123 closed this Sep 24, 2024
@jhw123
Copy link
Member

jhw123 commented Sep 24, 2024

All new PRs should be merged to main now because we merged renewal. Please reopen the PR and target main.

@alextio alextio deleted the lazy branch October 14, 2024 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants