vue-cryptoicon icon indicating copy to clipboard operation
vue-cryptoicon copied to clipboard

Shouldn't it return generic icon if symbol not found

Open abhishekgahlot opened this issue 6 years ago • 5 comments

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.

abhishekgahlot avatar Apr 17 '19 09:04 abhishekgahlot

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.

man15h avatar Apr 18 '19 06:04 man15h

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.

abhishekgahlot avatar Apr 27 '19 15:04 abhishekgahlot

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

man15h avatar May 02 '19 10:05 man15h

Thanks @man15h, I pushed the code long back for generic icon here though: https://github.com/abhishekgahlot/vue-cryptoicon/commit/b66875f4dd9f5a23f649b368adab0080935c55c2

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

abhishekgahlot avatar May 02 '19 10:05 abhishekgahlot

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

man15h avatar May 02 '19 11:05 man15h