-
Notifications
You must be signed in to change notification settings - Fork 15
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
lightbox mobile #2460
lightbox mobile #2460
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Bundle SizesCompared against 6f344c5 Route: No significant changes found Dynamic import: No significant changes found |
const handleMaximizeToggle = () => { | ||
setIsLightboxOpen((currIsLightboxOpen) => !currIsLightboxOpen); | ||
}; |
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.
let's make sure to wrap in useCallback
const updateThumbnailPosition = () => { | ||
if (thumbnailRef.current) { | ||
thumbnailRef.current.measure((x, y, w, h, pageX, pageY) => { | ||
setThumbnailPosition({ | ||
width: w, | ||
height: h, | ||
x: pageX, | ||
y: pageY, | ||
}); | ||
}); | ||
} | ||
}; | ||
|
||
const handleOpenLightbox = () => { | ||
updateThumbnailPosition(); | ||
setIsLightboxOpen(true); | ||
}; | ||
|
||
const handleCloseLightbox = () => { | ||
setIsLightboxOpen(false); | ||
}; |
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.
same for these
renderContent={() => ( | ||
<TokenFailureBoundary tokenRef={token} variant="large"> | ||
<NftDetailAssetCacheSwapper | ||
cachedPreviewAssetUrl={route.params.cachedPreviewAssetUrl} | ||
> | ||
<Zoom | ||
contentContainerStyle={{ | ||
display: 'flex', | ||
width: width, | ||
flexGrow: 1, | ||
backgroundColor: colors.black['800'], | ||
}} | ||
style={{ display: 'flex', flexGrow: 1 }} | ||
doubleTapConfig={{ | ||
minZoomScale: 1, | ||
}} | ||
> | ||
<NftDetailAsset tokenRef={token} /> | ||
</Zoom> | ||
</NftDetailAssetCacheSwapper> | ||
</TokenFailureBoundary> | ||
)} |
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.
let's define this as a useCallback
origin={{ | ||
x: thumbnailPosition.x, | ||
y: thumbnailPosition.y, | ||
width: thumbnailPosition.width, | ||
height: thumbnailPosition.height, | ||
}} |
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.
useMemo
where the dependency is [thumbnailPosition]
> | ||
<View | ||
ref={thumbnailRef} | ||
style={{ width: width * 0.92, minHeight: width * 0.92 }} |
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.
useMemo
This reverts commit 7569238.
Summary of Changes
Screen.Recording.2024-05-10.at.13.47.19.mov
Edge Cases
List any common edge cases that you have considered and tested.
Testing Steps
Provide steps on how the reviewer can test the changes.
Checklist
Please make sure to review and check all of the following: