diff --git a/lib/atomic_web/components/activity.ex b/lib/atomic_web/components/activity.ex index 84ee53e61..7dca7fbcf 100644 --- a/lib/atomic_web/components/activity.ex +++ b/lib/atomic_web/components/activity.ex @@ -5,6 +5,7 @@ defmodule AtomicWeb.Components.Activity do use AtomicWeb, :component import AtomicWeb.Components.Avatar + import AtomicWeb.Components.Popover alias Atomic.Activities.Activity @@ -14,9 +15,10 @@ defmodule AtomicWeb.Components.Activity do ~H"""
-
+
<.avatar name={@activity.organization.name} color={:light_gray} class="!h-10 !w-10" size={:xs} type={:organization} src={Uploaders.Logo.url({@activity.organization.logo, @activity.organization}, :original)} />
+ <.popover type={:organization} organization={@activity.organization}/>
<.link navigate={Routes.organization_show_path(AtomicWeb.Endpoint, :show, @activity.organization.id)}> diff --git a/lib/atomic_web/components/popover.ex b/lib/atomic_web/components/popover.ex new file mode 100644 index 000000000..41597c1de --- /dev/null +++ b/lib/atomic_web/components/popover.ex @@ -0,0 +1,43 @@ +defmodule AtomicWeb.Components.Popover do + @moduledoc """ + Renders a popover. + """ + + use AtomicWeb, :component + + import AtomicWeb.Components.Avatar + + attr :type, :atom, values: [:user, :organization], default: :user, doc: "The type of entity associated with the avatar." + attr :organization, :map, default: %{}, doc: "The organization to render." + attr :user, :map, default: %{}, doc: "The user to render." + + def popover(assigns) do + ~H""" + + """ + end + + def render_organization_popover(assigns) do + ~H""" +
+
+ <.avatar name={@organization.name} color={:light_gray} class="!h-10 !w-10" size={:xs} type={:organization} src={Uploaders.Logo.url({@organization.logo, @organization}, :original)} /> +
+ +
+
+

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

+

+ <%= @organization.description %> +

+
+
+ """ + end +end