Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Expand image button #570

Merged
merged 13 commits into from
Sep 19, 2020
Merged

Expand image button #570

merged 13 commits into from
Sep 19, 2020

Conversation

DerMolly
Copy link
Member

Component/Part

markdown renderer

Description

This PR add a expand image button to bottom right corner of every image.

Steps

  • added implementation
  • added / updated tests
  • added / updated documentation
  • extended changelog

Related Issue(s)

#276

@DerMolly DerMolly self-assigned this Sep 15, 2020
@DerMolly DerMolly changed the title Feature/expand image Expand image button Sep 15, 2020
Copy link
Member

@ErikMichelson ErikMichelson left a comment

Choose a reason for hiding this comment

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

All in all, I'm not completely happy with the solution. :/

Some suggestions:

  • as mentioned above use a lightbox instead of modals
  • either fix the positioning of the enlarge button(1) or enlarge the image by clicking on it (cursor: zoom-in)
  • (optional) maybe allow navigation through all images in the document when inside the lightbox (arrow keys, arrow buttons on the left and right of the enlarged image)

(1): image

CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines 46 to 57
<CommonModal
show={showFullscreenImage}
onHide={() => setShowFullscreenImage(false)}
title={alt ?? ''}
closeButton={true}
size={'xl'}
icon={'picture-o'}
>
<Modal.Body>
<img alt={alt} {...props} className={'w-100'}/>
</Modal.Body>
</CommonModal>
Copy link
Member

Choose a reason for hiding this comment

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

I don't know but I don't like using modals for showing bigger images. You're wasting screen space by the thick modal headers and borders and you need to scroll on images in portrait format (in contrast to landscape format).

I rather would use a lightbox as many other apps and webpages do. For some examples see here: https://mdbootstrap.com/docs/jquery/javascript/lightbox/

Copy link
Member

Choose a reason for hiding this comment

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

I don't see anything wrong with using bootstrap modals, because they are already included and provide most of the functionality. But I would remove the header, footer and padding.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@ErikMichelson ErikMichelson added type: feature Adds or requests new functionality scope: renderer Concerns the markdown-renderer labels Sep 15, 2020
removed border around image in modal
removed image button instead the modal is shown when the image is clicked
public/locales/en.json Outdated Show resolved Hide resolved
<span>{alt ?? ''}</span>
</Modal.Title>
</Modal.Header>
<img alt={alt} {...props} className={'w-100'}/>
Copy link
Member

Choose a reason for hiding this comment

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

No bug, but an idea: If no title is present, but an alt text, then we should use the alt text as title.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@mrdrogdrog mrdrogdrog left a comment

Choose a reason for hiding this comment

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

nice

@DerMolly DerMolly added the status: ready to merge This ready to be merged label Sep 19, 2020
@mrdrogdrog mrdrogdrog removed the status: ready to merge This ready to be merged label Sep 19, 2020
@mrdrogdrog
Copy link
Member

Fix CI please

the alt tag wasn't passed down to frame, because it's explicitly used in image-frame, but not explicitly passed down
@DerMolly DerMolly added the status: ready to merge This ready to be merged label Sep 19, 2020
@DerMolly DerMolly merged commit cac9b7e into main Sep 19, 2020
@DerMolly DerMolly deleted the feature/expandImage branch September 19, 2020 18:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: renderer Concerns the markdown-renderer status: ready to merge This ready to be merged type: feature Adds or requests new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants