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

Svg Icons Component #21

Open
thabti opened this issue Mar 7, 2017 · 5 comments
Open

Svg Icons Component #21

thabti opened this issue Mar 7, 2017 · 5 comments

Comments

@thabti
Copy link
Contributor

thabti commented Mar 7, 2017

I read an interesting article. Since we use font-awesome, we can get the the svg files from https://github.com/encharm/Font-Awesome-SVG-PNG/tree/master/black/svg and make them into simple React component.

Benefits:

  • Less network calls (better than sprites and network calls)
  • We have our own set of icons.

thoughts?

@mmahalwy
Copy link
Contributor

mmahalwy commented Mar 7, 2017

@thabti
Copy link
Contributor Author

thabti commented Mar 7, 2017

That one isn't SVG, it requires you load the fonts still. I was thinking something like this:

import Folder from './Folder.js';
const Icon=  ({ name, size }) => <svg width={size + 'px'} height={size+'xp'}> {name === 'Folder' &&<Folder />}</svg>

Folder.js would have just the svg path:

expect default ({ color }) => <path h='.....' fill={color} />

usage:

import Icon from 'quran-component/lib/Icon';
...
return ( <Icon name='Folder' size='30' />)

@mmahalwy
Copy link
Contributor

mmahalwy commented Mar 8, 2017

Ah! nice :)

Check this out too: https://github.com/oblador/react-native-vector-icons

@thabti
Copy link
Contributor Author

thabti commented Mar 14, 2017

found the perfect one: https://github.com/gorangajic/react-icons

@mmahalwy
Copy link
Contributor

Oh yeah... not sure how i forgot about this...

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

No branches or pull requests

2 participants