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

Shouldn't it return generic icon if symbol not found #1

Open
abhishekgahlot opened this issue Apr 17, 2019 · 5 comments
Open

Shouldn't it return generic icon if symbol not found #1

abhishekgahlot opened this issue Apr 17, 2019 · 5 comments

Comments

@abhishekgahlot
Copy link

abhishekgahlot commented Apr 17, 2019

Generally, its a good idea if a symbol isn't present to return a generic icon. I do see you have written a code for this here:

CryptoIcon.vue

I think when someone is iterating over lots of symbols and if the symbol isn't found in this library it should return generic but as of now, I get an error in console.

Maybe we should remove that else part and return generic, If you agree I can raise a PR for that.

@man15h
Copy link
Owner

man15h commented Apr 18, 2019

If you use Vue.use(Cryptoicon, { size: '50', color: 'black', generic: true }); it will fallback to the generic in case of icon is missing. Also for a single icon, you can pass generic prop <cryptoicon symbol="btc" size="24" generic /> . It isn't enabled by default so that someone can know which icon is available.

@abhishekgahlot
Copy link
Author

Sure, Yeah that's what I saw. I have to disagree and would consider enabling it by default so that if someone is building an app he doesn't have to handle lots of image loading error.

@man15h
Copy link
Owner

man15h commented May 2, 2019

Okay, I'll consider this and make the generic icon fallback true by default. although it will still show the error in the console.

@abhishekgahlot
Copy link
Author

Thanks @man15h, I pushed the code long back for generic icon here though: abhishekgahlot@b66875f

Also, one more thing I see after installing this package the folder size is really really huge. I think we should decrease the size it looks really big to me.

WhatsApp Image 2019-04-18 at 3 27 38 PM

@man15h
Copy link
Owner

man15h commented May 2, 2019

Probably that might be because of the submodule. I'll look into it. Thanks

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