VerusCoin / Verus-Mobile

The iOS/Android Verus Mobile cryptocurrency wallet.
MIT License
157 stars 78 forks source link

coin logos in send modal #167

Open thisdotLolu opened 8 months ago

thisdotLolu commented 8 months ago

hello @michaeltout thank you for taking out time, i've been looking at how i can implement this using your suggestion but i think i need some clarification, so when you say a pbaas currency mapped to an erc20 token i believe you mean it's satisfying the condition whereby proto === 'erc20' in this function export const getCoinLogo = (id, proto, theme = 'light') => { if (CoinLogos[id]) return CoinLogos[id][theme] else if (proto === 'erc20') return CoinLogos.ETH[theme] else return CoinLogoIcons.pbaas.RenderPbaasCurrencyLogo(id)[theme] } (please correct me if i am wrong). My issue with this is that, there aren't any object values which provides the info as to whether something has a 'proto' of erc20 or mapped to erc20 in this object(this is one object returned by one of the coins in the send modal-hope it's okay to paste here) {"description": "via Bridge.vETH", "key": "3", "keywords": ["iGBs4DWztRNvNEJBt4mqHszLxfKTNHTkhM", "DAI.vETH"], "logoid": "iGBs4DWztRNvNEJBt4mqHszLxfKTNHTkhM", "right": "0.89579771", "title": "DAI.vETH", "values": {"SEND_MODAL_CONVERTTO_FIELD": "DAI.vETH", "SEND_MODAL_EXPORTTO_FIELD": "", "SEND_MODAL_PRICE_ESTIMATE": {"name": "DAI.vETH", "price": 1.1163234564883833}, "SEND_MODAL_VIA_FIELD": "Bridge.vETH"}} which makes it much harder to satisfy this condition. But another approach i could think of is by checking if the title includes a .vETH string and implement the same thing i have done in this pr with only the condition changing.