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

[Mobile] Image height #13096

Merged
merged 10 commits into from
Jan 16, 2019
Merged

[Mobile] Image height #13096

merged 10 commits into from
Jan 16, 2019

Conversation

etoledom
Copy link
Contributor

@etoledom etoledom commented Dec 25, 2018

This PR takes over this (very old) PR #9975 to solve the issue wordpress-mobile/gutenberg-mobile#444

The image size implementations tries to follow closely the web implementation. I tried to share some code from ImageSize but most of it is platform specific. I made a small utils to share some math calculations.

On a future PR I plan to implement some kind of loading indicator.

image_height

To test:
Refer to the gutenberg-mobile PR.

@etoledom etoledom added Mobile Web Viewport sizes for mobile and tablet devices Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) labels Dec 25, 2018
@etoledom etoledom self-assigned this Dec 25, 2018
@etoledom etoledom requested a review from Tug December 25, 2018 12:36
@etoledom etoledom changed the title [Mobile] Image height - WIP [Mobile] Image height Dec 25, 2018
@Tug
Copy link
Contributor

Tug commented Dec 26, 2018

Beside the minor comments I had, this LGTM 👍 Great work here!

@etoledom
Copy link
Contributor Author

Thanks @Tug for the review!
I made the requested changes and now nom run ci is passing 🎉
Ready for another look 👀

@Tug Tug changed the base branch from rnmobile/release/0.3 to master December 27, 2018 13:44
@Tug
Copy link
Contributor

Tug commented Dec 27, 2018

This looks good now 👍
@etoledom I changed the base to master. You'll want to merge/rebase onto master before merging as we have some unwanted changes that appeared here now: https://github.com/WordPress/gutenberg/pull/13096/files#diff-ed195425f515f40db41c23d586760ef9

@etoledom etoledom force-pushed the rnmobile/image-block-img-size branch from c46abbd to 556b29b Compare January 2, 2019 18:38
@etoledom etoledom force-pushed the rnmobile/image-block-img-size branch from 556b29b to b72c99b Compare January 2, 2019 18:55
class ImageEdit extends Component {
constructor() {
super( ...arguments );
this.onMediaLibraryPress = this.onMediaLibraryPress.bind( this );
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @Tug ! I had to add this bind back since it was giving an error accessing this.props.setAttributes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, usually onSomething methods need to be bound to this 👍

@etoledom
Copy link
Contributor Author

etoledom commented Jan 3, 2019

Thank you @Tug ! Everything should be fixed now. Ready for another look 👍

Copy link
Contributor

@Tug Tug left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@etoledom etoledom merged commit 42ae871 into master Jan 16, 2019
@etoledom etoledom deleted the rnmobile/image-block-img-size branch January 16, 2019 14:24
@etoledom
Copy link
Contributor Author

Thank you!

@@ -0,0 +1,9 @@

export function calculatePreferedImageSize( image, container ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to add some JSDocs :)

youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* [rnmobile]: Convert image-block into class

* [rnmobile]: Creating mobile version of `image-size`.

* [rnmobile]: Adding util to image-block to share math between image-size components.

* [rnmobile]: Adding newline at the end of image-size.native.js file

* [rnmobile]: Replace wrong tabs characters

* [rnmobile]: Clear image size when url changes.

* [rnmobile]: Fixed lint issues

* [rnmobile]: Removing unnecessary binding calls

* [rnmobile]: Added necessary this.onLayout.bind( this )

* [rnmobile]: Adding missing bind to `onMediaLibraryPress`.
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* [rnmobile]: Convert image-block into class

* [rnmobile]: Creating mobile version of `image-size`.

* [rnmobile]: Adding util to image-block to share math between image-size components.

* [rnmobile]: Adding newline at the end of image-size.native.js file

* [rnmobile]: Replace wrong tabs characters

* [rnmobile]: Clear image size when url changes.

* [rnmobile]: Fixed lint issues

* [rnmobile]: Removing unnecessary binding calls

* [rnmobile]: Added necessary this.onLayout.bind( this )

* [rnmobile]: Adding missing bind to `onMediaLibraryPress`.
@gziolo gziolo removed the Mobile Web Viewport sizes for mobile and tablet devices label Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants