Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rename AccessibleSVG to SVG and make it work with React Native #9685

Merged
merged 3 commits into from
Sep 28, 2018

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Sep 7, 2018

Description

Follow-up: #9565.
Alternative to: #9294 and #9656.

TODO

  • Make it work with the mobile app (React Native).

How has this been tested?

npm test
npm run build - make sure all the SVG-based icons still work.

Types of changes

Refactoring.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@gziolo gziolo added the [Package] Components /packages/components label Sep 7, 2018
@gziolo gziolo added this to the 3.9 milestone Sep 7, 2018
@gziolo gziolo self-assigned this Sep 7, 2018
@gziolo gziolo requested a review from youknowriad September 7, 2018 10:30
@gziolo gziolo added the [Status] In Progress Tracking issues with work in progress label Sep 7, 2018
@gziolo gziolo changed the title Update/accessible svg rename Rename AccessibleSVG to SVG and make it work with React Native Sep 7, 2018
@gziolo gziolo 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 Sep 7, 2018
@gziolo gziolo mentioned this pull request Sep 7, 2018
4 tasks
@gziolo gziolo force-pushed the update/accessible-svg-rename branch from 173e458 to a953ceb Compare September 7, 2018 10:38
@youknowriad youknowriad removed this from the 3.9 milestone Sep 13, 2018
@@ -900,7 +900,7 @@ export default class Dashicon extends Component {
height={ size }
viewBox="0 0 20 20"
>
<Path d={ path } />
<path d={ path } />
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this continue to be Path? in order to get the React-Native version?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think temporary it should remain as is.

I was playing with createElement version which would do the replacement behind the scenes, but with no luck so far. I hope to do some more explorations soon.

@SergioEstevao
Copy link
Contributor

SergioEstevao commented Sep 25, 2018 via email

@gziolo gziolo force-pushed the update/accessible-svg-rename branch from a953ceb to 10fd7ae Compare September 25, 2018 13:58
@gziolo
Copy link
Member Author

gziolo commented Sep 25, 2018

@SergioEstevao I brought back Native components for SVG, can you double check if it works properly now? I hope to continue alternative solution where you can write DOM tags for SVG body but have RN to convert them to proper components behind the scenes. If it doesn't work we will have to ensure that all SVG use the pattern established so far.

@gziolo gziolo removed the [Status] In Progress Tracking issues with work in progress label Sep 25, 2018
@gziolo gziolo requested a review from mcsf September 25, 2018 14:02
## Usage

```jsx
import { G, Path, SVG } from '@wordpress/components';
Copy link
Contributor

Choose a reason for hiding this comment

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

Polygon is missing; worth showing in the example?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's essential to be include. I don't even know what it translates to :)

@gziolo gziolo requested review from youknowriad and removed request for youknowriad September 26, 2018 09:10
@gziolo gziolo requested a review from mzorz September 26, 2018 12:55
@gziolo
Copy link
Member Author

gziolo commented Sep 26, 2018

@mzorz, @hypest or @SergioEstevao, can you confirm that this PR works with wordpress-mobile/gutenberg-mobile#129?

@hypest
Copy link
Contributor

hypest commented Sep 26, 2018

👋 @gziolo , I tested out wordpress-mobile/gutenberg-mobile#129 against this branch and, apart from some updating that RN side branch needs, the app actually errors because the paragraph block has the icon being defined using plain, lowercased svg elements.

EDIT: Well, I should add that there's an open PR #9294 for the changes/fixes already.

@gziolo
Copy link
Member Author

gziolo commented Sep 28, 2018

Okey, let's merge this one and rebase #9294 against master.

@gziolo gziolo merged commit 5c2085a into master Sep 28, 2018
@gziolo gziolo added this to the 4.0 milestone Sep 28, 2018
@gziolo gziolo deleted the update/accessible-svg-rename branch September 28, 2018 07:14
@mtias
Copy link
Member

mtias commented Oct 9, 2018

Nice work following up here.

@mzorz
Copy link
Contributor

mzorz commented Oct 12, 2018

Okey, let's merge this one and rebase #9294 against master.

#9264 merged 🎉

# for free to join this conversation on GitHub. Already have an account? # 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) [Package] Components /packages/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants