-
Notifications
You must be signed in to change notification settings - Fork 3k
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 Modal Previews when Uploading Attachments + Copy/Paste files #685
Conversation
Throwing a hold on this as I think maybe we want to make sure that previewing attachments works before implementing this. |
Still working out how to handle non image attachments, but made some progress here. |
Got something like this so far if you want to poke around @shawnborton |
Nice, that should be plenty to get started. |
…as ended up with more duplication
Gonna take this off hold so we can start getting some thoughts. There are a lot of changes but mostly it's copy and paste from files being renamed / reorganized. Would like to get this merged sooner than later as the conflicts are particularly painful to handle. @shawnborton are you cool with doing a styling follow up for this so we can get a first draft merged and then focus on the non image/pdf attachment previews? |
}; | ||
|
||
const AttachmentView = props => ( | ||
<> |
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.
Just curious, do you know why this was wrapped with a React.Fragment before?
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 was enabling us to use the short circuit syntax as a curly brace after the =>
would have opened a new block and required an explicit return.
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.
Overall I think this is much better than it was before. There were a few pieces that were pretty hard to wrap my head around, but each time I tried to find a way to simplify things or make them clearer I ended up realizing why you did it the way you did and couldn't come up with a cleaner way to do it. It seems to work pretty well, but I'm not approving just yet because I need to do more testing.
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.
Okay, this looks good to me and seems to work well.
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 am tagging this PR to highlight an issue fixed here. All conditions in ternary expressions or left-hand operands on conditional renders, should be boolean. This PR is one of the PRs that uses conditional render with string operands, hence I am tagging it here for the contributors to check. We've also updated the item in the checklist with this PR to avoid this issues in the future. |
cc @thienlnam since most of the original code is yours just reorganized a little
Summary of Changes
ThumbnailWithModal
component so that we can launch the preview modal without requiring a thumbnail to be displayed at allTODO
Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/143636
Tests (All platforms)
Web / Desktop only tests
Screenshots
iOS
Android
Web