2024-04-29 21:17:28 +02:00
|
|
|
<div data-controller="merchant-avatar">
|
2024-08-26 19:18:27 -04:00
|
|
|
<%= styled_form_with model: @merchant, class: "space-y-4", data: { turbo: false } do |f| %>
|
2024-04-29 21:17:28 +02:00
|
|
|
<section class="space-y-4">
|
|
|
|
<div class="w-fit m-auto">
|
2024-08-26 19:18:27 -04:00
|
|
|
<%= render partial: "merchants/avatar", locals: { merchant: @merchant } %>
|
2024-04-29 21:17:28 +02:00
|
|
|
</div>
|
2024-08-26 19:18:27 -04:00
|
|
|
<div class="flex gap-2 items-center justify-center">
|
|
|
|
<% Merchant::COLORS.each do |color| %>
|
|
|
|
<label class="relative">
|
|
|
|
<%= f.radio_button :color, color, class: "sr-only peer", data: { action: "change->merchant-avatar#handleColorChange" } %>
|
|
|
|
<div class="w-6 h-6 rounded-full cursor-pointer peer-checked:ring-2 peer-checked:ring-offset-2 peer-checked:ring-blue-500" style="background-color: <%= color %>"></div>
|
|
|
|
</label>
|
|
|
|
<% end %>
|
2024-04-29 21:17:28 +02:00
|
|
|
</div>
|
|
|
|
<div class="relative flex items-center border border-gray-200 rounded-lg">
|
|
|
|
<%= f.text_field :name, placeholder: t(".name_placeholder"), class: "text-sm font-normal placeholder:text-gray-500 h-10 relative pl-3 w-full border-none rounded-lg", required: true, data: { merchant_avatar_target: "name" } %>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2024-08-26 19:18:27 -04:00
|
|
|
<%= f.submit %>
|
2024-04-29 21:17:28 +02:00
|
|
|
</section>
|
|
|
|
<% end %>
|
|
|
|
</div>
|