diff --git a/apps/block_scout_web/assets/css/components/_stakes_table.scss b/apps/block_scout_web/assets/css/components/_stakes_table.scss index 84322f9463..da5cdf1a86 100644 --- a/apps/block_scout_web/assets/css/components/_stakes_table.scss +++ b/apps/block_scout_web/assets/css/components/_stakes_table.scss @@ -114,6 +114,12 @@ $stakes-table-cell-separation: 25px !default; background-color: $stakes-banned-background; color: $stakes-banned-color; } + + .stakes-td-banned-info { + display: block; + float: left; + padding-right: 30px; + } } .stakes-td-order { diff --git a/apps/block_scout_web/assets/css/components/stakes/_modal_validator_info.scss b/apps/block_scout_web/assets/css/components/stakes/_modal_validator_info.scss index 3df5db9001..b0514b55bc 100644 --- a/apps/block_scout_web/assets/css/components/stakes/_modal_validator_info.scss +++ b/apps/block_scout_web/assets/css/components/stakes/_modal_validator_info.scss @@ -47,3 +47,13 @@ padding: 0; } } + +.modal-validator-alert { + padding: 10px 30px; + background-color: #fff3f7; + color: #ff7986; + border-top: 1px solid #fee6ef; + border-bottom: 1px solid #fee6ef; + line-height: 1.5; + font-size: 14px; +} diff --git a/apps/block_scout_web/assets/css/components/stakes/_stakes.scss b/apps/block_scout_web/assets/css/components/stakes/_stakes.scss index 7ed7a7b3a7..86ccaa7b86 100644 --- a/apps/block_scout_web/assets/css/components/stakes/_stakes.scss +++ b/apps/block_scout_web/assets/css/components/stakes/_stakes.scss @@ -95,6 +95,7 @@ $stakes-stats-item-border-color: #fff !default; display: flex; justify-content: flex-end; padding-right: 30px; + float: left; } .stakes-control { diff --git a/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex b/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex index 54902c1764..bcbd3309a4 100644 --- a/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex +++ b/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex @@ -36,12 +36,14 @@ defmodule BlockScoutWeb.StakesChannel do def handle_in("render_validator_info", %{"address" => staking_address}, socket) do pool = Chain.staking_pool(staking_address) + delegator = socket.assigns[:account] && Chain.staking_pool_delegator(staking_address, socket.assigns.account) average_block_time = AverageBlockTime.average_block_time() token = ContractState.get(:token) html = View.render_to_string(StakesView, "_stakes_modal_validator_info.html", validator: pool, + delegator: delegator, average_block_time: average_block_time, token: token ) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex index 749d2edc87..f28519102f 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex @@ -92,6 +92,7 @@ defmodule BlockScoutWeb.StakesController do "_rows.html", token: token, pool: pool, + delegator: delegator, index: index, average_block_time: average_block_time, pools_type: filter, diff --git a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex index 866164cdcb..6eeaeb990f 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex @@ -34,9 +34,20 @@ <%= if @pool.is_banned do %> - Banned until block #<%= @pool.banned_until %> (<%= estimated_unban_day(@pool.banned_until, @average_block_time) %>) + Banned until block #<%= @pool.banned_until %> (<%= estimated_unban_day(@pool.banned_until, @average_block_time) %>). + <%= if @delegator && + @delegator.delegator_address_hash != @pool.staking_address_hash && + @pool.are_delegators_banned && + @pool.banned_until != @pool.banned_delegators_until do %> + You will be able to withdraw after block #<%= @pool.banned_delegators_until %> (<%= estimated_unban_day(@pool.banned_delegators_until, @average_block_time) %>) + <% end %> - <% else %> + <% end %> + <%= if !@pool.is_banned || + (!@pool.are_delegators_banned && + @delegator && + @delegator.delegator_address_hash != @pool.staking_address_hash + ) do %>
<%= if @buttons.move do %> <%= render BlockScoutWeb.StakesView, "_stakes_control_move.html", address: @pool.staking_address_hash %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_validator_info.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_validator_info.html.eex index ee7d64c309..69691b472b 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_validator_info.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_validator_info.html.eex @@ -10,6 +10,19 @@
+ <%= if @validator.is_banned do %> + + <% end %> <%= render BlockScoutWeb.CommonComponentsView, "_modal_close_button.html" %>