Merge pull request #3903 from blockscout/vb-short-view-address

Increase the number of left symbols in trimmed address hash
pull/3934/head
Victor Baranov 4 years ago committed by GitHub
commit b9c58017d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 4
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex

@ -6,6 +6,7 @@
- [#3888](https://github.com/blockscout/blockscout/pull/3888) - EIP-1967 contract proxy pattern detection fix - [#3888](https://github.com/blockscout/blockscout/pull/3888) - EIP-1967 contract proxy pattern detection fix
### Chore ### Chore
- [#3902](https://github.com/blockscout/blockscout/pull/3902) - Increase number of left symbols in short address view
- [#3894](https://github.com/blockscout/blockscout/pull/3894) - Refactoring: replace inline style display: none with d-none class - [#3894](https://github.com/blockscout/blockscout/pull/3894) - Refactoring: replace inline style display: none with d-none class
- [#3893](https://github.com/blockscout/blockscout/pull/3893) - Add left/right paddings in tx tile - [#3893](https://github.com/blockscout/blockscout/pull/3893) - Add left/right paddings in tx tile
- [#3870](https://github.com/blockscout/blockscout/pull/3870) - Manage token balance on-demand fetcher threshold via env var - [#3870](https://github.com/blockscout/blockscout/pull/3870) - Manage token balance on-demand fetcher threshold via env var

@ -266,7 +266,7 @@ defmodule BlockScoutWeb.AddressView do
end end
def trimmed_hash(address) when is_binary(address) do def trimmed_hash(address) when is_binary(address) do
"#{String.slice(address, 0..5)}#{String.slice(address, -6..-1)}" "#{String.slice(address, 0..7)}#{String.slice(address, -6..-1)}"
end end
def trimmed_hash(_), do: "" def trimmed_hash(_), do: ""
@ -406,6 +406,8 @@ defmodule BlockScoutWeb.AddressView do
short_string(token_id, max_length) short_string(token_id, max_length)
end end
def short_string(nil, _max_length), do: ""
def short_string(name, max_length) do def short_string(name, max_length) do
part_length = Kernel.trunc(max_length / 4) part_length = Kernel.trunc(max_length / 4)

Loading…
Cancel
Save