Merge pull request #6600 from blockscout/vb-token-icon-default-url

Token stub icon
pull/6603/head
Victor Baranov 2 years ago committed by GitHub
commit 58e3948a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 2
      apps/block_scout_web/assets/js/lib/token_icon.js
  3. 5
      apps/block_scout_web/assets/package-lock.json
  4. 1
      apps/block_scout_web/assets/static/images/icons/token_icon_default.svg
  5. 2
      apps/block_scout_web/lib/block_scout_web/templates/tokens/_token_icon.html.eex
  6. 1
      apps/block_scout_web/lib/block_scout_web/templates/tokens/_token_icon_default.html.eex

@ -64,6 +64,7 @@
### Chore
- [#6600](https://github.com/blockscout/blockscout/pull/6600) - Token stub icon
- [#6588](https://github.com/blockscout/blockscout/pull/6588) - Add latest image build for frontend-main with specific build-args
- [#6584](https://github.com/blockscout/blockscout/pull/6584) - Vacuum package-lock.json
- [#6581](https://github.com/blockscout/blockscout/pull/6581) - Dark mode switcher localStorage to cookie in order to support new UI

@ -17,7 +17,7 @@ function getTokenIconUrl (chainID, addressHash) {
if (chainName) {
return `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/${chainName}/assets/${addressHash}/logo.png`
} else {
return null
return '/images/icons/token_icon_default.svg'
}
}

@ -98,10 +98,11 @@
}
},
"../../../deps/phoenix": {
"version": "0.0.1"
"version": "1.5.13",
"license": "MIT"
},
"../../../deps/phoenix_html": {
"version": "0.0.1"
"version": "3.0.4"
},
"node_modules/@ampproject/remapping": {
"version": "2.2.0",

@ -0,0 +1 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h24v24h-24z"/></clipPath><g clip-path="url(#a)"><rect fill="#e2e8f0" height="24" rx="8" width="24"/><path d="m7.22437 8.07626v-2.02841h9.55683v2.02841h-3.5625v9.60794h-2.4318v-9.60794z" fill="#a0aec0"/></g></svg>

After

Width:  |  Height:  |  Size: 380 B

@ -1,2 +1,2 @@
<% token_icon_url = Explorer.Chain.get_token_icon_url_by(@chain_id, @address) %>
<img width=15 height=15 src="<%= token_icon_url %>" style="margin-top: -2px; min-height: 15px; min-width: 15px; border: none; outline: none;<%= if assigns[:style], do: @style %>" class="<%= if assigns[:additional_classes] do @additional_classes |> Enum.join(" ") end %>" alt="" onerror="this.style.visibility='hidden'"/>
<img width=15 height=15 src="<%= token_icon_url %>" style="margin-top: -2px; min-height: 15px; min-width: 15px; border: none; outline: none;<%= if assigns[:style], do: @style %>" class="<%= if assigns[:additional_classes] do @additional_classes |> Enum.join(" ") end %>" alt="" onerror="if (this.src != '/images/icons/token_icon_default.svg') this.src = '/images/icons/token_icon_default.svg';"/>

@ -0,0 +1 @@
<img width=15 height=15 src="/images/icons/token_icon_default.svg" style="margin-top: -2px; min-height: 15px; min-width: 15px; border: none; outline: none;<%= if assigns[:style], do: @style %>" class="<%= if assigns[:additional_classes] do @additional_classes |> Enum.join(" ") end %>" alt=""/>
Loading…
Cancel
Save