2022-07-25 19:31:54 -04:00
|
|
|
defmodule MemexWeb.Components.UserCard do
|
2022-02-25 21:52:17 -05:00
|
|
|
@moduledoc """
|
|
|
|
Display card for a user
|
|
|
|
"""
|
|
|
|
|
2022-07-25 19:31:54 -04:00
|
|
|
use MemexWeb, :component
|
2022-02-25 21:52:17 -05:00
|
|
|
|
|
|
|
def user_card(assigns) do
|
|
|
|
~H"""
|
|
|
|
<div
|
|
|
|
id={"user-#{@user.id}"}
|
|
|
|
class="mx-4 my-2 px-8 py-4 flex flex-col justify-center items-center text-center
|
|
|
|
border border-gray-400 rounded-lg shadow-lg hover:shadow-md
|
|
|
|
transition-all duration-300 ease-in-out"
|
|
|
|
>
|
|
|
|
<h1 class="px-4 py-2 rounded-lg title text-xl break-all">
|
|
|
|
<%= @user.email %>
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
<h3 class="px-4 py-2 rounded-lg title text-lg">
|
2022-05-05 21:44:42 -04:00
|
|
|
<p>
|
|
|
|
<%= if @user.confirmed_at |> is_nil() do %>
|
2022-11-17 22:30:01 -05:00
|
|
|
<%= gettext("email unconfirmed") %>
|
2022-05-05 21:44:42 -04:00
|
|
|
<% else %>
|
2022-12-19 21:13:27 -05:00
|
|
|
<p>
|
|
|
|
<%= gettext("user confirmed on") %>
|
|
|
|
<%= @user.confirmed_at |> display_datetime() %>
|
|
|
|
</p>
|
2022-05-05 21:44:42 -04:00
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2022-12-19 21:13:27 -05:00
|
|
|
<%= gettext("user registered on") %>
|
2022-05-05 21:44:42 -04:00
|
|
|
<%= @user.inserted_at |> display_datetime() %>
|
|
|
|
</p>
|
2022-02-25 21:52:17 -05:00
|
|
|
</h3>
|
|
|
|
|
|
|
|
<%= if @inner_block do %>
|
|
|
|
<div class="px-4 py-2 flex space-x-4 justify-center items-center">
|
|
|
|
<%= render_slot(@inner_block) %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
"""
|
|
|
|
end
|
|
|
|
end
|