From 2df9957d39dc8b3587d2044c3f7cc893a1bde459 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Sun, 10 Mar 2024 14:11:32 -0700 Subject: [PATCH] Updated links to work again --- lib/pinchflat/sources/source.ex | 2 +- .../components/core_components.ex | 6 +-- lib/pinchflat_web/components/layouts.ex | 6 ++- .../layouts/partials/sidebar.html.heex | 54 ++++++++++++------- .../media_item_html/show.html.heex | 2 +- .../media_profile_html/edit.html.heex | 2 +- .../media_profile_html/index.html.heex | 2 +- .../media_profile_html/new.html.heex | 2 +- .../media_profile_html/show.html.heex | 4 +- .../page_html/onboarding_checklist.html.heex | 6 +-- .../searches/search_html/show.html.heex | 2 +- .../sources/source_html/edit.html.heex | 2 +- .../sources/source_html/index.html.heex | 4 +- .../sources/source_html/new.html.heex | 2 +- .../sources/source_html/show.html.heex | 4 +- 15 files changed, 58 insertions(+), 42 deletions(-) diff --git a/lib/pinchflat/sources/source.ex b/lib/pinchflat/sources/source.ex index 0ed8aaa..912a3a1 100644 --- a/lib/pinchflat/sources/source.ex +++ b/lib/pinchflat/sources/source.ex @@ -75,6 +75,6 @@ defmodule Pinchflat.Sources.Source do @doc false def fast_index_frequency do # minutes - 15 + 2 end end diff --git a/lib/pinchflat_web/components/core_components.ex b/lib/pinchflat_web/components/core_components.ex index e32810a..0f05157 100644 --- a/lib/pinchflat_web/components/core_components.ex +++ b/lib/pinchflat_web/components/core_components.ex @@ -620,15 +620,15 @@ defmodule PinchflatWeb.CoreComponents do ## Examples - <.back navigate={~p"/posts"}>Back to posts + <.back href={~p"/posts"}>Back to posts """ - attr :navigate, :any, required: true + attr :href, :any, required: true slot :inner_block, required: true def back(assigns) do ~H"""
- <.link navigate={@navigate} class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700"> + <.link href={@href} class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700"> <.icon name="hero-arrow-left-solid" class="h-3 w-3" /> <%= render_slot(@inner_block) %> diff --git a/lib/pinchflat_web/components/layouts.ex b/lib/pinchflat_web/components/layouts.ex index 42172ec..0efadc1 100644 --- a/lib/pinchflat_web/components/layouts.ex +++ b/lib/pinchflat_web/components/layouts.ex @@ -6,14 +6,16 @@ defmodule PinchflatWeb.Layouts do attr :icon, :string, required: true attr :text, :string, required: true - attr :navigate, :any, required: true + attr :href, :any, required: true + attr :target, :any, default: "_self" def sidebar_item(assigns) do # I'm testing out grouping classes here. Tentative order: font, layout, color, animation, state-modifiers ~H"""
  • <.link - navigate={@navigate} + href={@href} + target={@target} class={[ "font-medium text-bodydark1", "group relative flex items-center gap-2.5 rounded-sm px-4 py-2 duration-300 ease-in-out", diff --git a/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex b/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex index 13b72e1..9a1513f 100644 --- a/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex +++ b/lib/pinchflat_web/components/layouts/partials/sidebar.html.heex @@ -1,31 +1,45 @@ diff --git a/lib/pinchflat_web/controllers/media_items/media_item_html/show.html.heex b/lib/pinchflat_web/controllers/media_items/media_item_html/show.html.heex index 8056359..00bcb54 100644 --- a/lib/pinchflat_web/controllers/media_items/media_item_html/show.html.heex +++ b/lib/pinchflat_web/controllers/media_items/media_item_html/show.html.heex @@ -1,6 +1,6 @@
    - <.link navigate={~p"/sources/#{@media_item.source_id}"}> + <.link href={~p"/sources/#{@media_item.source_id}"}> <.icon name="hero-arrow-left" class="w-10 h-10 hover:dark:text-white" />

    diff --git a/lib/pinchflat_web/controllers/media_profiles/media_profile_html/edit.html.heex b/lib/pinchflat_web/controllers/media_profiles/media_profile_html/edit.html.heex index 6570b9b..3022c54 100644 --- a/lib/pinchflat_web/controllers/media_profiles/media_profile_html/edit.html.heex +++ b/lib/pinchflat_web/controllers/media_profiles/media_profile_html/edit.html.heex @@ -1,5 +1,5 @@
    - <.link navigate={~p"/media_profiles"}> + <.link href={~p"/media_profiles"}> <.icon name="hero-arrow-left" class="w-10 h-10 hover:dark:text-white" />

    Edit Media Profile

    diff --git a/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex b/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex index 7ba4ad8..c0443d2 100644 --- a/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex +++ b/lib/pinchflat_web/controllers/media_profiles/media_profile_html/index.html.heex @@ -3,7 +3,7 @@ Media Profiles