-
Notifications
You must be signed in to change notification settings - Fork 2
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
Lazy loading #46
Conversation
✅ Deploy Preview for kaistinteractionlab ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
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> |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 => ( |
There was a problem hiding this comment.
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
All new PRs should be merged to |
Add lazy loading optimizations to People and Publications page and make slight UI tweaks according to Juho's feedback.