-
-
Notifications
You must be signed in to change notification settings - Fork 723
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
Show preview image in folder content on hover #6551
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for plone-components canceled.
|
@iRohitSingh the implementation looks good on the video. I have a few questions regarding the implementation:
|
@@ -97,6 +103,8 @@ export const ContentsItemComponent = ({ | |||
order, | |||
}) => { | |||
const intl = useIntl(); | |||
const previewImageUrl = `${item['@id']}/${item.image_scales?.image?.[0]?.scales?.teaser?.download}`; |
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.
@iRohitSingh this lookup should be added in a new component that can be placed in this file
which is called if the item type is image. Right now you would attempt to check this for everything
even if there is no need for it.
title={item['Type'] || item['@type']} | ||
/>{' '} | ||
<span title={item.title}> {item.title}</span> | ||
{item['@type'] === 'Image' ? ( |
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.
All of @tisto advice is quite valid, lazy loaded when needed, you don't want to load 100 images if you never even interact with them.
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.
@iRohitSingh I left some concerns as comments in the code.
Fix #6550
Screen.Recording.2024-12-19.at.7.52.51.PM.mov