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

lightbox mobile #2460

Merged
merged 16 commits into from
May 15, 2024
Merged

lightbox mobile #2460

merged 16 commits into from
May 15, 2024

Conversation

Rohan-cp
Copy link
Collaborator

@Rohan-cp Rohan-cp commented May 3, 2024

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:

  • I've tested the changes and all tests pass.
  • (if web) I've tested the changes on various desktop screen sizes to ensure responsiveness.
  • (if mobile) I've tested the changes on both light and dark modes.

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 9:31pm

Copy link

github-actions bot commented May 3, 2024

Bundle Sizes

Compared against 6f344c5

Route: No significant changes found

Dynamic import: No significant changes found

@Rohan-cp Rohan-cp changed the title lightbox mobile (WIP) lightbox mobile May 10, 2024
@Rohan-cp Rohan-cp requested a review from Robinnnnn May 10, 2024 20:42
@Rohan-cp Rohan-cp marked this pull request as ready for review May 10, 2024 20:42
Comment on lines 205 to 207
const handleMaximizeToggle = () => {
setIsLightboxOpen((currIsLightboxOpen) => !currIsLightboxOpen);
};
Copy link
Contributor

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

Comment on lines 217 to 237
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);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

same for these

Comment on lines 267 to 288
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>
)}
Copy link
Contributor

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

Comment on lines 289 to 294
origin={{
x: thumbnailPosition.x,
y: thumbnailPosition.y,
width: thumbnailPosition.width,
height: thumbnailPosition.height,
}}
Copy link
Contributor

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 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

useMemo

@Robinnnnn Robinnnnn merged commit 7569238 into main May 15, 2024
8 of 9 checks passed
@Robinnnnn Robinnnnn deleted the rohan/lightbox-test branch May 15, 2024 23:32
Robinnnnn added a commit that referenced this pull request May 16, 2024
Robinnnnn added a commit that referenced this pull request May 16, 2024
Rohan-cp added a commit that referenced this pull request May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants