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

[RNMobile] Do not use hard coded fontFamily in Image block #13677

Merged
merged 21 commits into from
Feb 6, 2019

Conversation

daniloercoli
Copy link
Contributor

@daniloercoli daniloercoli commented Feb 5, 2019

This PR does fix an issue with the Image block on mobile where the fontFamily used was hard coded in the block, instead of reading it via CSS.

daniloercoli and others added 17 commits January 28, 2019 18:23
This is required to properly intercpet Enter.key on all platforms/keyboards. We decided to move to RichText since all of the work for Enter.key intercept was laready done there per Para and Heading blocks.
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg: (36 commits)
  Fixes plural messages POT generation. (#13577)
  Typo fix (#13595)
  REST API: Remove oEmbed proxy HTML filtering (#13575)
  Removed unnecessary className attribute. Fixes #11664 (#11831)
  Add changelog for RSS block (#13588)
  Components: Set type=button for TabPanel button elements. (#11944)
  Update util.js (#13582)
  Docs: Add accessbility specific page (#13169)
  Rnmobile/media methods refactor (#13554)
  chore(release): publish
  chore(release): publish
  Plugin: Deprecate gutenberg_get_script_polyfill (#13536)
  Block API: Parse entity only when valid character reference (#13512)
  RichText: List: fix indentation (#13563)
  Plugin: Deprecate window._wpLoadGutenbergEditor (#13547)
  Plugin: Avoid setting generic "Edit Post" title on load (#13552)
  Plugin: Populate demo content by default content filters (#13553)
  RichText: List: Fix getParentIndex (#13562)
  RichText: List: Fix outdent with children (#13559)
  Scripts: Remove npm run build from test-e2e default run (#13420)
  ...
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg:
  Try alternate list item jump fix. (#12941)
  Mobile bottom sheet component (#13612)
  Remove unintentional right-margin on last odd-item. (#12199)
  Introduce left and right float alignment options to latest posts block (#8814)
  Fix Google Docs table paste (#13543)
  Increase bottom padding on gallery image caption (#13623)
  Fix the editor save keyboard shortcut not working in code editor view (#13159)
  Plugin: Deprecate gutenberg_add_admin_body_class (#13572)
  Rnmobile/upload media failed state (#13615)
  Make clickOnMoreMenuItem not dependent on aria labels (#13166)
  Add: className prop support to server side render. (#13568)
  Fix: Categories Block: hierarchical Dropdown (#13567)
  Docs: Add clarification about git workflow (#13534)
  Plugin: Remove `user_can_richedit` filtering (#13608)
  eslint-plugin: Add rule `no-unused-vars-before-return` (#12828)
  Image settings button (#13597)
  Fixed wording for the color picker saturation (#13479)

# Conflicts:
#	packages/block-library/src/image/edit.native.js
* Remaps some font names so that they work in iOS.

* Improved the logic for picking the default font in some components.

* Modifies the logic that sets the default font for the code component.

* Changes the font family in a css file.

* Adds an import to have a default font for native.

* Standardizes the default font for the code component.

* Simplifies the default font for the code block.

* Simplifies the default font for the code block.

* Configures the default font for plain-text from a css file.

* Fixes the styling for the rich text components and restores a line that was removed by mistake.

* Fixes a linting problem.

* Fixes some linting issues.

* Fixes a linting issue.
…rnmobile/372-use-RichText-on-Title-block

* 'master' of https://github.com/WordPress/gutenberg: (22 commits)
  Make the modal title styling consistent (#13669)
  Disable navigation block for text mode. (#12185)
  Fix: Linting problem in modal example code (#13671)
  Add myself as a code owner to the annotations (#13672)
  Add more reviewers to CODEOWNERS.md file (#13667)
  Plugin: Remove jQuery heartbeat-to-hooks proxying (#13576)
  Workflow: Add repository CODEOWNERS file (#13604)
  Add a mobile minimum size for form fields (#13639)
  Update edit-save documentation  (#13578)
  Alt image setting (#13631)
  Fix: Allow years lower than 1970 in DateTime component. (#13602)
  Using addQueryArgs to generate Manage All Reusable Blocks link (#13653)
  Bump plugin version to 5.0.0-rc.1 (#13652)
  Update lodash to 4.17.10 (#13651)
  Refreshed PR (#9469)
  Set default values of the width and height input fields according to the actual image dimensions (#7687)
  12647 fix css color picker (#12747)
  Remove "we" from messages (#13644)
  Fix: Font size picker max width on mobile (#13264)
  Fix/issue 12501 menu item aria label
  ...
@daniloercoli daniloercoli added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Feb 5, 2019
@daniloercoli daniloercoli changed the title Do not use hard coded fontFamily value, instead use CSS style. [RNMobile] Do not use hard coded fontFamily in Image block Feb 5, 2019
…rnmobile/372-fix-image-caption-font-family

* 'master' of https://github.com/WordPress/gutenberg:
  Mention how 'core/notices' data store is accessed (#13593)
@daniloercoli daniloercoli changed the base branch from rnmobile/372-use-RichText-on-Title-block to master February 5, 2019 17:13
…rnmobile/372-fix-image-caption-font-family

* 'master' of https://github.com/WordPress/gutenberg:
  [RNMobile] Use RichText component on Title block (#13548)

# Conflicts:
#	packages/block-library/src/image/edit.native.js
…rnmobile/372-fix-image-caption-font-family

* 'master' of https://github.com/WordPress/gutenberg:
  Update CODEOWNERS
  Project: Avoid additional native-file code owner notification (#13675)
  Mobile: Link image setting (#13654)

# Conflicts:
#	packages/block-library/src/image/styles.native.scss
@@ -16,6 +20,10 @@
align-items: center;
}

.caption-text {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: for simplicity in accessing it, and to match the rest of the class definitions in the same file, what do you think about renaming it to .captionText?

Copy link
Contributor Author

@daniloercoli daniloercoli Feb 6, 2019

Choose a reason for hiding this comment

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

Yes, captionText was my 1st choice yesterday, but got an error in JS lint if I rename it:

[0] gutenberg-mobile/gutenberg/packages/block-library/src/image/edit.native.js
[0]   294:57  error  ["captionText"] is better written in dot notation  dot-notation

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, apparently the rules weren't in place in the past and the other class definitions had passed. Oh well, caption-text it is then :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that message is not about the dash, but it's telling you to replace styles['captionText'] with styles.captionText

Copy link
Contributor

@hypest hypest left a comment

Choose a reason for hiding this comment

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

This looks good to me!

I only left one comment that is not blocking; feel free to merge as is or do the renaming. Either way it's fine by me 👍

@daniloercoli daniloercoli merged commit 669d0c5 into master Feb 6, 2019
@daniloercoli daniloercoli deleted the rnmobile/372-fix-image-caption-font-family branch February 6, 2019 10:15
@youknowriad youknowriad added this to the 5.1 (Gutenberg) milestone Feb 15, 2019
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Use RichText component in Title block for mobile.
This is required to properly intercpet Enter.key on all platforms/keyboards. We decided to move to RichText since all of the work for Enter.key intercept was laready done there per Para and Heading blocks.

* Fix lint

* Set font family, weight, and size via RN props for Title, Heading, and Para blocks.

* Fix lint

* Adds font* props to PlainText for mobile

* Make `serif` default family for RichText  on mobile

* Set the correct font family for Image caption on mobile

* Set the correct font family for Nextpage block on mobile

* Set the correct font family for Code block on mobile

* set the correct font family for Image caption on mobile

* Remove extra fontFamily props.

* Remaps some font names so that they work in iOS. (#13628)

* Remaps some font names so that they work in iOS.

* Improved the logic for picking the default font in some components.

* Modifies the logic that sets the default font for the code component.

* Changes the font family in a css file.

* Adds an import to have a default font for native.

* Standardizes the default font for the code component.

* Simplifies the default font for the code block.

* Simplifies the default font for the code block.

* Configures the default font for plain-text from a css file.

* Fixes the styling for the rich text components and restores a line that was removed by mistake.

* Fixes a linting problem.

* Fixes some linting issues.

* Fixes a linting issue.

* Make sure PlainText takes in consideration the fontFamily passed via props before falling back to default styles

* Do not use hard coded `fontFamily` value, instead use CSS style.

* Add missing new line at end of style
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Use RichText component in Title block for mobile.
This is required to properly intercpet Enter.key on all platforms/keyboards. We decided to move to RichText since all of the work for Enter.key intercept was laready done there per Para and Heading blocks.

* Fix lint

* Set font family, weight, and size via RN props for Title, Heading, and Para blocks.

* Fix lint

* Adds font* props to PlainText for mobile

* Make `serif` default family for RichText  on mobile

* Set the correct font family for Image caption on mobile

* Set the correct font family for Nextpage block on mobile

* Set the correct font family for Code block on mobile

* set the correct font family for Image caption on mobile

* Remove extra fontFamily props.

* Remaps some font names so that they work in iOS. (#13628)

* Remaps some font names so that they work in iOS.

* Improved the logic for picking the default font in some components.

* Modifies the logic that sets the default font for the code component.

* Changes the font family in a css file.

* Adds an import to have a default font for native.

* Standardizes the default font for the code component.

* Simplifies the default font for the code block.

* Simplifies the default font for the code block.

* Configures the default font for plain-text from a css file.

* Fixes the styling for the rich text components and restores a line that was removed by mistake.

* Fixes a linting problem.

* Fixes some linting issues.

* Fixes a linting issue.

* Make sure PlainText takes in consideration the fontFamily passed via props before falling back to default styles

* Do not use hard coded `fontFamily` value, instead use CSS style.

* Add missing new line at end of style
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