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

Add Masonry Grid Layout for Uploaded Images with Expandable View #40

Merged
merged 7 commits into from
Aug 28, 2024

Conversation

AntonJames-Sistence
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Currently, when users upload images, there is no masonry layout or a way to handle displaying more than three images in a compact and user-friendly manner.

Issue Number: 7

What is the new behavior?

This PR introduces a new feature that allows users to view their uploaded images in a masonry grid layout. When users upload more than three images, the first three images are displayed in a compact masonry grid. If there are more than three images, a +N overlay appears on the third image, indicating the number of additional images. When the user clicks on the +N overlay, the grid expands to show all images.

The update leverages native CSS for the masonry layout, ensuring that the layout is handled efficiently by the browser without the need for additional JavaScript for positioning. This improves both performance and user experience.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Copy link

netlify bot commented Aug 25, 2024

Deploy Preview for reachat-storybook ready!

Name Link
🔨 Latest commit 0846c1c
🔍 Latest deploy log https://app.netlify.com/sites/reachat-storybook/deploys/66cf4af5e5783a00084cecf1
😎 Deploy Preview https://deploy-preview-40--reachat-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@AntonJames-Sistence
Copy link
Contributor Author

@steppy452 @amcdnl Please review this PR when you get a chance.

.storybook/index.css Outdated Show resolved Hide resolved
@amcdnl amcdnl requested a review from steppy452 August 26, 2024 10:52
Copy link
Member

@amcdnl amcdnl left a comment

Choose a reason for hiding this comment

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

Once you address some of the feedback, we can merge this.

Copy link
Contributor

@steppy452 steppy452 left a comment

Choose a reason for hiding this comment

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

this is a really good progress! I just have one comment aside from Austin's

@AntonJames-Sistence
Copy link
Contributor Author

Hi @amcdnl @steppy452, Thank you for your feedback. I've fixed the issues you pointed out. Please review the changes and let me know your thoughts.

<div
className={cn(
theme.messages.message.files.base,
imageFiles.length < 4 || expanded ? '' : 'grid grid-cols-3 gap-2 w-1/2'
Copy link
Contributor

Choose a reason for hiding this comment

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

and here we can use truncateImages instead

Copy link
Contributor

@steppy452 steppy452 left a comment

Choose a reason for hiding this comment

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

@AntonJames-Sistence just a minor comment to help w/ future maintenance but otherwise lgtm!

…nt breakpoints for masonry grid; apply minor style improvements for handling more than 3 images in the Masonry layout
@AntonJames-Sistence
Copy link
Contributor Author

@steppy452, thanks for the review. I addressed your comment and Implemented the maxImageLength variable, let me know what you think.

@amcdnl amcdnl merged commit 00d69a9 into reaviz:master Aug 28, 2024
5 checks passed
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.

3 participants