From 02fc8c514adfdce80d0b784573542a33a5bd0b16 Mon Sep 17 00:00:00 2001 From: FilipeR13 Date: Fri, 13 Sep 2024 16:40:36 +0100 Subject: [PATCH] format --- lib/atomic_web/components/activity.ex | 19 +++++++++++++------ .../live/home_live/components/schedule.ex | 8 ++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/atomic_web/components/activity.ex b/lib/atomic_web/components/activity.ex index d54c4085..1721c6b5 100644 --- a/lib/atomic_web/components/activity.ex +++ b/lib/atomic_web/components/activity.ex @@ -38,7 +38,7 @@ defmodule AtomicWeb.Components.Activity do <%= if @activity.image do %>
- +
<% end %> @@ -53,10 +53,14 @@ defmodule AtomicWeb.Components.Activity do - <.icon name={:user_group} solid class={[ - "h-5 w-5", - color_class(@activity.enrolled, @activity.maximum_entries) - ]} /> + <.icon + name={:user_group} + solid + class={[ + "h-5 w-5", + color_class(@activity.enrolled, @activity.maximum_entries) + ]} + /> <%= @activity.enrolled %>/<%= @activity.maximum_entries %> enrollments @@ -83,6 +87,9 @@ defmodule AtomicWeb.Components.Activity do end defp color_class(enrolled, maximum_entries) when enrolled == maximum_entries, do: "text-red-500" - defp color_class(enrolled, maximum_entries) when enrolled > div(maximum_entries,2), do: "text-amber-300" + + defp color_class(enrolled, maximum_entries) when enrolled > div(maximum_entries, 2), + do: "text-amber-300" + defp color_class(_, _), do: "text-lime-600" end diff --git a/lib/atomic_web/live/home_live/components/schedule.ex b/lib/atomic_web/live/home_live/components/schedule.ex index 6c3da45b..136ccfb5 100644 --- a/lib/atomic_web/live/home_live/components/schedule.ex +++ b/lib/atomic_web/live/home_live/components/schedule.ex @@ -33,7 +33,7 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do <.link navigate={Routes.organization_show_path(AtomicWeb.Endpoint, :show, entry.organization.id)}> -
+

<%= entry.organization.name %>

@@ -62,14 +62,14 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do <%= pretty_display_date(entry.start) %>

-
+

<%= truncate(entry.description, 150) %>

<.link navigate={Routes.organization_show_path(AtomicWeb.Endpoint, :show, entry.organization.id)}> -
+

<%= entry.organization.name %>

@@ -85,7 +85,7 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do defp truncate(text, length) do if String.length(text) > length do - String.slice(text, 0..length - 1) <> "..." + String.slice(text, 0..(length - 1)) <> "..." else text end