+
<%= @title %>
<%= render_slot(@actions) %>
diff --git a/lib/atomic_web/components/sidebar.ex b/lib/atomic_web/components/sidebar.ex
index 1dc89f52..d8f7768c 100644
--- a/lib/atomic_web/components/sidebar.ex
+++ b/lib/atomic_web/components/sidebar.ex
@@ -122,7 +122,7 @@ defmodule AtomicWeb.Components.Sidebar do
<:wrapper>
diff --git a/lib/atomic_web/components/socials.ex b/lib/atomic_web/components/socials.ex
new file mode 100644
index 00000000..87175a0a
--- /dev/null
+++ b/lib/atomic_web/components/socials.ex
@@ -0,0 +1,43 @@
+defmodule AtomicWeb.Components.Socials do
+ @moduledoc false
+
+ use AtomicWeb, :component
+
+ attr :entity, :map, required: true
+
+ def socials(assigns) do
+ assigns = assign(assigns, :socials_with_values, get_social_values(assigns.entity))
+
+ ~H"""
+
+ <%= for {social, icon, url_base, social_value} <- @socials_with_values do %>
+ <%= if social_value do %>
+
+ icon} class="h-5 w-5" alt={Atom.to_string(social)} />
+ <.link class="capitalize text-blue-500" target="_blank" href={url_base <> social_value}>
+ <%= Atom.to_string(social) %>
+
+
+ <% end %>
+ <% end %>
+
+ """
+ end
+
+ defp get_social_values(entity) do
+ get_socials()
+ |> Enum.map(fn {social, icon, url_base} ->
+ social_value = Map.get(entity, social)
+ {social, icon, url_base, social_value}
+ end)
+ end
+
+ def get_socials do
+ [
+ {:tiktok, "tiktok.svg", "https://tiktok.com/"},
+ {:instagram, "instagram.svg", "https://instagram.com/"},
+ {:facebook, "facebook.svg", "https://facebook.com/"},
+ {:x, "x.svg", "https://x.com/"}
+ ]
+ end
+end
diff --git a/lib/atomic_web/components/tabs.ex b/lib/atomic_web/components/tabs.ex
index 58c0fe72..1e565b1f 100644
--- a/lib/atomic_web/components/tabs.ex
+++ b/lib/atomic_web/components/tabs.ex
@@ -13,7 +13,7 @@ defmodule AtomicWeb.Components.Tabs do
{@rest}
class={[
"flex gap-x-8 gap-y-2",
- @underline && "border-b border-gray-200",
+ @underline && "border-b border-zinc-200",
@class
]}
aria-label="Tabs"
@@ -53,7 +53,7 @@ defmodule AtomicWeb.Components.Tabs do
active_classes =
if active,
do: "bg-orange-100 text-orange-600",
- else: "text-gray-500 hover:text-gray-600"
+ else: "text-zinc-500 hover:text-zinc-600"
[base_classes, active_classes]
end
@@ -64,12 +64,12 @@ defmodule AtomicWeb.Components.Tabs do
active_classes =
if active,
do: "border-orange-500 text-orange-600",
- else: "text-gray-500 border-transparent hover:border-gray-300 hover:text-gray-600"
+ else: "text-zinc-500 border-transparent hover:border-zinc-300 hover:text-zinc-600"
underline_classes =
if active && underline,
do: "",
- else: "hover:border-gray-300"
+ else: "hover:border-zinc-300"
[base_classes, active_classes, underline_classes]
end
@@ -80,12 +80,12 @@ defmodule AtomicWeb.Components.Tabs do
active_classes =
if active,
do: "text-white bg-orange-600",
- else: "text-white bg-gray-500"
+ else: "text-white bg-zinc-500"
underline_classes =
if active,
do: "bg-orange-100 text-orange-600",
- else: "text-gray-500 bg-gray-100"
+ else: "text-zinc-500 bg-zinc-100"
[base_classes, active_classes, underline_classes]
end
@@ -96,7 +96,7 @@ defmodule AtomicWeb.Components.Tabs do
active_classes =
if active,
do: "text-white bg-primary-600",
- else: "text-white bg-gray-500"
+ else: "text-white bg-zinc-500"
[base_classes, active_classes]
end
diff --git a/lib/atomic_web/components/unauthenticated.ex b/lib/atomic_web/components/unauthenticated.ex
new file mode 100644
index 00000000..27d6f958
--- /dev/null
+++ b/lib/atomic_web/components/unauthenticated.ex
@@ -0,0 +1,24 @@
+defmodule AtomicWeb.Components.Unauthenticated do
+ @moduledoc """
+ A component for displaying an unauthenticated state.
+ """
+ use AtomicWeb, :component
+
+ attr :id, :string, default: "unauthenticated-state", required: false
+ attr :url, :string, default: "users/log_in", required: false
+
+ def unauthenticated_state(assigns) do
+ ~H"""
+
+ <.icon name="hero-user-circle" class="mx-auto h-12 w-12 text-zinc-400" />
+ <%= gettext("You are not authenticated") %>
+ <%= gettext("Please log in to view this content.") %>
+
+ <.button patch={@url} icon="hero-arrow-right-end-on-rectangle-solid" icon_position={:right}>
+ <%= gettext("Log In") %>
+
+
+
+ """
+ end
+end
diff --git a/lib/atomic_web/live/activity_live/form_component.ex b/lib/atomic_web/live/activity_live/form_component.ex
index 4e039b8f..ec6eb317 100644
--- a/lib/atomic_web/live/activity_live/form_component.ex
+++ b/lib/atomic_web/live/activity_live/form_component.ex
@@ -75,7 +75,7 @@ defmodule AtomicWeb.ActivityLive.FormComponent do
consume_uploaded_entries(socket, :image, fn %{path: path}, entry ->
Activities.update_activity_image(activity, %{
"image" => %Plug.Upload{
- content_type: entry.content_type,
+ content_type: entry.client_type,
filename: entry.client_name,
path: path
}
diff --git a/lib/atomic_web/live/activity_live/form_component.html.heex b/lib/atomic_web/live/activity_live/form_component.html.heex
index 6ba98a7b..b948949d 100644
--- a/lib/atomic_web/live/activity_live/form_component.html.heex
+++ b/lib/atomic_web/live/activity_live/form_component.html.heex
@@ -1,6 +1,6 @@
<.form id="activity-form" for={@form} phx-change="validate" phx-submit="save" phx-target={@myself}>
-
+
<.field type="text" field={@form[:title]} placeholder="Choose a title" required />
diff --git a/lib/atomic_web/live/calendar_live/components/month.ex b/lib/atomic_web/live/calendar_live/components/month.ex
index f0ddefd1..ec0d5d95 100644
--- a/lib/atomic_web/live/calendar_live/components/month.ex
+++ b/lib/atomic_web/live/calendar_live/components/month.ex
@@ -48,7 +48,7 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarMonth do
-
- <.link patch={~p"/activities/#{activity}"} class="group flex justify-between p-4 pr-6 focus-within:bg-gray-50 hover:bg-gray-50">
+ <.link patch={~p"/activities/#{activity}"} class="group flex justify-between p-4 pr-6 focus-within:bg-zinc-50 hover:bg-zinc-50">
<%= activity.title %>
diff --git a/lib/atomic_web/live/calendar_live/show.html.heex b/lib/atomic_web/live/calendar_live/show.html.heex
index 8b706aae..40286114 100644
--- a/lib/atomic_web/live/calendar_live/show.html.heex
+++ b/lib/atomic_web/live/calendar_live/show.html.heex
@@ -1,7 +1,7 @@
<.page title="Calendar">
-
+
-
+
@@ -21,15 +21,15 @@
-
<%= gettext("You are not authenticated") %>
+<%= gettext("Please log in to view this content.") %>
+-
- <.link patch={~p"/activities/#{activity}"} class="group flex justify-between p-4 pr-6 focus-within:bg-gray-50 hover:bg-gray-50">
+ <.link patch={~p"/activities/#{activity}"} class="group flex justify-between p-4 pr-6 focus-within:bg-zinc-50 hover:bg-zinc-50">
<%= activity.title %> diff --git a/lib/atomic_web/live/calendar_live/show.html.heex b/lib/atomic_web/live/calendar_live/show.html.heex index 8b706aae..40286114 100644 --- a/lib/atomic_web/live/calendar_live/show.html.heex +++ b/lib/atomic_web/live/calendar_live/show.html.heex @@ -1,7 +1,7 @@ <.page title="Calendar"> -
+-+ @@ -21,15 +21,15 @@-