diff --git a/lib/cobblemon_ui_web/live/dashboard_live.ex b/lib/cobblemon_ui_web/live/dashboard_live.ex index f17e3c9..ca932b6 100644 --- a/lib/cobblemon_ui_web/live/dashboard_live.ex +++ b/lib/cobblemon_ui_web/live/dashboard_live.ex @@ -27,8 +27,7 @@ defmodule CobblemonUiWeb.DashboardLive do species_info: %{}, view_mode: :party, loading: false, - error: nil, - selected_type: nil + error: nil )} end @@ -101,14 +100,6 @@ defmodule CobblemonUiWeb.DashboardLive do {:noreply, assign(socket, view_mode: String.to_existing_atom(mode), selected_pokemon: nil)} end - def handle_event("select_type", %{"type" => ""}, socket) do - {:noreply, assign(socket, selected_type: nil)} - end - - def handle_event("select_type", %{"type" => type}, socket) do - {:noreply, assign(socket, selected_type: type)} - end - @impl true def handle_info(:tick, socket) do {:noreply, do_refresh(socket)} @@ -326,7 +317,7 @@ defmodule CobblemonUiWeb.DashboardLive do /> <%!-- Type Chart --%> - <.type_chart selected_type={@selected_type} /> + <.type_chart /> diff --git a/lib/cobblemon_ui_web/live/pokemon_components.ex b/lib/cobblemon_ui_web/live/pokemon_components.ex index 3e6bf91..012dc7b 100644 --- a/lib/cobblemon_ui_web/live/pokemon_components.ex +++ b/lib/cobblemon_ui_web/live/pokemon_components.ex @@ -355,14 +355,11 @@ defmodule CobblemonUiWeb.PokemonComponents do alias CobblemonUi.TypeChart - attr :selected_type, :string, default: nil - def type_chart(assigns) do chart = TypeChart.defensive_chart() - offense = TypeChart.offensive_chart() types = TypeChart.types() - assigns = assign(assigns, chart: chart, offense: offense, types: types) + assigns = assign(assigns, chart: chart, types: types) ~H"""
- Tap a type to see its matchups -
+Weaknesses & Resistances
{@type_name}
+ <%!-- Weakness row --%> +Defensive & Offensive matchups
-- <.icon name="hero-exclamation-triangle" class="size-3" /> Weak to (2×) -
-- <.icon name="hero-shield-check" class="size-3" /> Resists (½×) -
-- <.icon name="hero-no-symbol" class="size-3" /> Immune to (0×) -
-- <.icon name="hero-bolt" class="size-3" /> Super effective (2×) -
-- <.icon name="hero-shield-exclamation" class="size-3" /> Not very effective (½×) -
-- <.icon name="hero-no-symbol" class="size-3" /> No effect (0×) -
-Select a type above to view matchups
-