Change email
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %>
<%= email_input f, :email,
value: input_value(f, :email),
class: input_class(f, :email, "form-control"),
placeholder: "e.g., babka@73k.us",
maxlength: User.max_email,
phx_debounce: "500",
aria_describedby: error_ids(f, :email)
%>
<%= label f, :email do %>
<%= icon_div @socket, "bi-at", [class: "icon baseline text-muted"] %>
Email
<% end %>
<%= error_tag f, :email %>
<%= password_input f, :current_password,
value: input_value(f, :current_password),
class: "form-control",
placeholder: "Current Password",
aria_describedby: error_ids(f, :current_password)
%>
<%= label f, :current_password do %>
<%= icon_div @socket, "bi-lock", [class: "icon baseline text-muted"] %>
Current password
<% end %>
<%= error_tag f, :current_password %>
<%= submit "Change email",
class: "btn btn-primary",
disabled: !@changeset.valid? || input_value(f, :current_password) == "",
aria_disabled: (!@changeset.valid? || input_value(f, :current_password) == "") && "true" || false,
phx_disable_with: "Saving..."
%>
<% end %>