From ab54a66a4372514b7bbbad2545650cd4beaba6e4 Mon Sep 17 00:00:00 2001
From: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
Date: Wed, 13 Dec 2023 15:29:13 +0000
Subject: [PATCH] Fix `class` in `styled_link` and remove existing uses of
`class` (#3631)
Co-authored-by: Adrian Gruntkowski
---
lib/plausible_web/components/billing.ex | 7 +------
lib/plausible_web/components/generic.ex | 2 +-
lib/plausible_web/templates/site/change_domain.html.heex | 7 ++-----
lib/plausible_web/templates/site/snippet.html.heex | 8 ++------
4 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/lib/plausible_web/components/billing.ex b/lib/plausible_web/components/billing.ex
index 16ff004c3..c1ff9330f 100644
--- a/lib/plausible_web/components/billing.ex
+++ b/lib/plausible_web/components/billing.ex
@@ -273,7 +273,6 @@ defmodule PlausibleWeb.Components.Billing do
}
id="#upgrade-or-change-plan-link"
href={Routes.billing_path(PlausibleWeb.Endpoint, :choose_plan)}
- class="text-sm font-medium"
>
<%= change_plan_or_upgrade_text(@subscription) %>
@@ -296,7 +295,6 @@ defmodule PlausibleWeb.Components.Billing do
<.styled_link
:if={Subscription.Status.active?(@subscription)}
href={Routes.billing_path(PlausibleWeb.Endpoint, :change_plan_form)}
- class="text-sm font-medium"
>
Change plan
@@ -310,10 +308,7 @@ defmodule PlausibleWeb.Components.Billing do
<% else %>
Free trial
- <.styled_link
- href={Routes.billing_path(PlausibleWeb.Endpoint, :upgrade)}
- class="text-sm font-medium"
- >
+ <.styled_link href={Routes.billing_path(PlausibleWeb.Endpoint, :upgrade)}>
Upgrade
<% end %>
diff --git a/lib/plausible_web/components/generic.ex b/lib/plausible_web/components/generic.ex
index ff932fc14..4a207c1c4 100644
--- a/lib/plausible_web/components/generic.ex
+++ b/lib/plausible_web/components/generic.ex
@@ -144,7 +144,7 @@ defmodule PlausibleWeb.Components.Generic do
<.unstyled_link
new_tab={@new_tab}
href={@href}
- class="text-indigo-600 hover:text-indigo-700 dark:text-indigo-500 dark:hover:text-indigo-600"
+ class={"text-indigo-600 hover:text-indigo-700 dark:text-indigo-500 dark:hover:text-indigo-600 " <> @class}
>
<%= render_slot(@inner_block) %>
diff --git a/lib/plausible_web/templates/site/change_domain.html.heex b/lib/plausible_web/templates/site/change_domain.html.heex
index 5e42e10ed..c5afb0503 100644
--- a/lib/plausible_web/templates/site/change_domain.html.heex
+++ b/lib/plausible_web/templates/site/change_domain.html.heex
@@ -25,7 +25,7 @@
Visit our
- <.styled_link new_tab class="text-sm" href="https://plausible.io/docs/change-domain-name/">
+ <.styled_link new_tab href="https://plausible.io/docs/change-domain-name/">
documentation
for details.
@@ -36,10 +36,7 @@
- <.styled_link
- href={Routes.site_path(@conn, :settings_general, @site.domain)}
- class="w-full text-center"
- >
+ <.styled_link href={Routes.site_path(@conn, :settings_general, @site.domain)}>
Back to Site Settings
diff --git a/lib/plausible_web/templates/site/snippet.html.heex b/lib/plausible_web/templates/site/snippet.html.heex
index 6f93026c3..0035dfdc0 100644
--- a/lib/plausible_web/templates/site/snippet.html.heex
+++ b/lib/plausible_web/templates/site/snippet.html.heex
@@ -43,18 +43,14 @@
On WordPress? We have
- <.styled_link
- new_tab
- class="text-sm"
- href="https://plausible.io/wordpress-analytics-plugin"
- >
+ <.styled_link new_tab href="https://plausible.io/wordpress-analytics-plugin">
a plugin
See more
- <.styled_link new_tab class="text-sm" href="https://plausible.io/docs/integration-guides">
+ <.styled_link new_tab href="https://plausible.io/docs/integration-guides">
integration guides