This commit is contained in:
@@ -75,6 +75,9 @@ defmodule LoLAnalyticsWeb.ChampionLive.Show do
|
||||
)
|
||||
end
|
||||
|
||||
@impl true
|
||||
@spec handle_async(:get_items | :get_summoners | :get_win_rates, {:ok, any()}, map()) ::
|
||||
{:noreply, map()}
|
||||
def handle_async(:get_win_rates, {:ok, result}, socket) do
|
||||
{:noreply, push_event(socket, "win-rate", %{winRates: result})}
|
||||
end
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
.win-rate {
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.win-rate-container {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<.header>
|
||||
@@ -15,7 +20,9 @@
|
||||
<div class="flex flex-row gap-4">
|
||||
<.champion_avatar class="w-20" id={@champion.id} name={@champion.name}
|
||||
image={"https://ddragon.leagueoflegends.com/cdn/14.11.1/img/champion/#{@champion.image}"} />
|
||||
<canvas class="w-full win-rate" height="250" class="win-rate" id="win-rate" phx-hook="ChampionWinRate" />
|
||||
<div class="win-rate-container">
|
||||
<canvas class="w-full win-rate" height="250" class="win-rate" id="win-rate" phx-hook="ChampionWinRate" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-4" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user