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

Added support web-platform (Icon & Icon.Button) #133

Closed
wants to merge 1 commit into from

Conversation

IjzerenHein
Copy link

This adds support for react-native-web.

@oblador
Copy link
Owner

oblador commented Mar 16, 2016

How can we make this support custom fonts as well?

@IjzerenHein
Copy link
Author

What do you mean by that?

@oblador
Copy link
Owner

oblador commented Mar 17, 2016

@IjzerenHein: vector-icons support custom icon sets: https://github.com/oblador/react-native-vector-icons#custom-fonts Just thought it would be nice to support them too or at least not try to include them if we can't get the right path.

@IjzerenHein
Copy link
Author

Ah I see, I'll have a look when I have some more time 👍

@ptmt
Copy link

ptmt commented Apr 16, 2016

I've started a project which uses react-native-web, would be awesome to not use conditionals in the codebase for handling icons. Hope it could be merged. Also, maybe we should add some tests, to experiment more safely without affecting 99% of other users who only need Android and iOS support?

@oblador
Copy link
Owner

oblador commented May 9, 2016

@ptmt: I'm not going to merge this PR because I'm not entirely happy with how the CSS is inserted. However the latest version does fix the NativeModules related error and as long as you import the relevant fonts in your CSS it should work out of the box, however I haven't yet confirmed this.

@ptmt
Copy link

ptmt commented May 9, 2016

Sure, thanks!

@faceyspacey
Copy link

@oblador how do you want it inserted? This package would be big for the React Native Web community which more and more developers are veering toward daily.

@faceyspacey
Copy link

faceyspacey commented Sep 16, 2016

@IjzerenHein I used the code from your pull request and the font isn't installed in the head using react-native-web.

In case anyone else is interested, I've fallin back to manually inserting a font bundle in the head from a CDN and creating my own <Icon /> component that returns <Text className='ion-some-icon' /> instead.

In addition, with webpack it's challenging to get the font served. On top of these issues, React Storybook doesn't seem to give you control of the HTML file that has the bundle script in it, so you can't easily put a cdn font url there.

It seems there's a lot to think about to get this nicely working for react-native-web across a variety of scenarios. I'm sure someone with more webpack experience would have an easier time serving the font file from node_modules, but that still doesn't solve the fact that it's not being inserted in the head. It seems the head is overwritten after that code is executed or something like that.

@brunolemos
Copy link
Contributor

brunolemos commented Feb 12, 2017

@oblador can't you merge this or something similar? At least it makes the component works on the web. We can make improvements later.
cc #367

@oblador
Copy link
Owner

oblador commented Feb 13, 2017

Not sure what you mean, this package works just fine on the web. There's even a web project in this repo and steps in documentation. There might be ways of making it slightly easier, but this is not it.

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.

5 participants