use phoenix component modal

This commit is contained in:
2022-02-14 01:26:51 -05:00
parent f517ffc8f8
commit 114f63b47a
16 changed files with 193 additions and 150 deletions

View File

@ -79,12 +79,15 @@
</div>
<%= if @live_action in [:new, :edit] do %>
<%= live_modal(CanneryWeb.AmmoGroupLive.FormComponent,
id: @ammo_group.id || :new,
title: @page_title,
action: @live_action,
ammo_group: @ammo_group,
return_to: Routes.ammo_group_index_path(@socket, :index),
current_user: @current_user
) %>
<.modal return_to={Routes.ammo_group_index_path(@socket, :index)}>
<.live_component
module={CanneryWeb.AmmoGroupLive.FormComponent}
id={@ammo_group.id || :new}
title={@page_title}
action={@live_action}
ammo_group={@ammo_group}
return_to={Routes.ammo_group_index_path(@socket, :index)}
current_user={@current_user}
/>
</.modal>
<% end %>

View File

@ -53,12 +53,15 @@
</div>
<%= if @live_action in [:edit] do %>
<%= live_modal(CanneryWeb.AmmoGroupLive.FormComponent,
id: @ammo_group.id,
title: @page_title,
action: @live_action,
ammo_group: @ammo_group,
return_to: Routes.ammo_group_show_path(@socket, :show, @ammo_group),
current_user: @current_user
) %>
<.modal return_to={Routes.ammo_group_show_path(@socket, :show, @ammo_group)}>
<.live_component
module={CanneryWeb.AmmoGroupLive.FormComponent}
id={@ammo_group.id}
title={@page_title}
action={@live_action}
ammo_group={@ammo_group}
return_to={Routes.ammo_group_show_path(@socket, :show, @ammo_group)}
current_user={@current_user}
/>
</.modal>
<% end %>