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

Zoomable image viewer in Markdown (posts and comments) #5387

Merged
merged 1 commit into from
Jan 27, 2021
Merged

Conversation

infinite-persistence
Copy link
Contributor

Issue

Closes #4899: Ability to expand images in markdown posts for viewing

Questionable

  • I think it should be fine, but please double-check on my usage of window.app.store.dispatch and import { doOpenModal } from 'redux/actions/app'; in a jsx file.

Demo

  • output

p/s: Thanks to btzr-io for some pointers.

Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

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

One comment. Tested and it works great. This is really cool

@infinite-persistence
Copy link
Contributor Author

Update

  • Move ZoomableImage into a regular component

@@ -128,6 +128,10 @@
}
}

.img__zoomable {
cursor: pointer; // 'zoom-in' would be ideal, but browser-dependant.
Copy link
Contributor

@DispatchCommit DispatchCommit Jan 27, 2021

Choose a reason for hiding this comment

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

This could be solved down the road by adding a hover overlay to the image that indicates zoom-in.

https://stackoverflow.com/questions/21086385/how-to-make-in-css-an-overlay-over-an-image

Copy link
Contributor

@DispatchCommit DispatchCommit left a comment

Choose a reason for hiding this comment

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

There may be some unintended behavior when an image is also used as a link: https://lbry.tv/@dispatch:5/markdown-tests:6

When you click the image, the link will open in a new tab, but when you return to the tab, the image is also expanded in the modal window. This could be resolved or improved at a later time though.

But overall, a very nice feature / improvement.

## Issue
4899: Ability to expand images in markdown posts for viewing
@neb-b neb-b merged commit 7419fef into master Jan 27, 2021
@neb-b neb-b deleted the ip-image-viewer branch January 27, 2021 15:06
@RubenKelevra RubenKelevra mentioned this pull request Mar 20, 2021
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.

Ability to expand images in markdown posts for viewing
3 participants