homeman-elixir/lib/homeman_web/live/user_live/show.html.heex

29 lines
791 B
Plaintext
Raw Normal View History

2024-01-21 23:48:10 -06:00
<.header>
User <%= @user.id %>
<:subtitle>This is a user record from your database.</:subtitle>
<:actions>
<.link patch={~p"/users/#{@user}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit user</.button>
</.link>
</:actions>
</.header>
<.list>
<:item title="Name"><%= @user.name %></:item>
<:item title="Avatar url"><%= @user.avatar_url %></:item>
<:item title="Color"><%= @user.color %></:item>
</.list>
<.back navigate={~p"/users"}>Back to users</.back>
<.modal :if={@live_action == :edit} id="user-modal" show on_cancel={JS.patch(~p"/users/#{@user}")}>
<.live_component
module={HomemanWeb.UserLive.FormComponent}
id={@user.id}
title={@page_title}
action={@live_action}
user={@user}
patch={~p"/users/#{@user}"}
/>
</.modal>