Improve chains menu

pull/1849/head
Victor Baranov 6 years ago
parent 1e51b24d87
commit 86119da883
  1. 2
      apps/block_scout_web/assets/css/components/_navbar.scss
  2. 12
      apps/block_scout_web/config/config.exs
  3. 7
      apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex
  4. 9
      apps/block_scout_web/lib/block_scout_web/views/layout_view.ex

@ -161,6 +161,8 @@
&.header {
font-weight: bold;
padding-left: 10px;
pointer-events: none;
&.division {
border-top: 1px solid rgb(183, 185, 184);

@ -67,19 +67,23 @@ config :block_scout_web,
},
%{
title: "Ethereum Classic",
url: "https://blockscout.com/etc/mainnet"
url: "https://blockscout.com/etc/mainnet",
other?: true
},
%{
title: "Aerum Mainnet",
url: "https://blockscout.com/aerum/mainnet"
url: "https://blockscout.com/aerum/mainnet",
other?: true
},
%{
title: "Callisto Mainnet",
url: "https://blockscout.com/callisto/mainnet"
url: "https://blockscout.com/callisto/mainnet",
other?: true
},
%{
title: "RSK Mainnet",
url: "https://blockscout.com/rsk/mainnet"
url: "https://blockscout.com/rsk/mainnet",
other?: true
}
]

@ -120,14 +120,17 @@
<%= subnetwork_title() %>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item header">Mainnet</a>
<%= for %{url: url, title: title} <- main_nets() do %>
<%= for %{url: url, title: title} <- head_main_nets() do %>
<a class="dropdown-item" href="<%= url%>"><%= title %></a>
<% end %>
<a class="dropdown-item header division">Testnet</a>
<%= for %{url: url, title: title} <- test_nets() do %>
<a class="dropdown-item" href="<%= url%>"><%= title %></a>
<% end %>
<a class="dropdown-item header division">Other networks</a>
<%= for %{url: url, title: title} <- other_nets() do %>
<a class="dropdown-item" href="<%= url%>"><%= title %></a>
<% end %>
</div>
</li>
</ul>

@ -102,10 +102,19 @@ defmodule BlockScoutWeb.LayoutView do
Enum.reject(other_networks(), &Map.get(&1, :test_net?))
end
def head_main_nets do
main_nets()
|> Enum.reject(&Map.get(&1, :other?))
end
def test_nets do
Enum.filter(other_networks(), &Map.get(&1, :test_net?))
end
def other_nets do
Enum.filter(other_networks(), &Map.get(&1, :other?))
end
def other_explorers do
if Application.get_env(:block_scout_web, :link_to_other_explorers) do
Application.get_env(:block_scout_web, :other_explorers, [])

Loading…
Cancel
Save