mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-08 23:15:24 +02:00
Pre-launch design sync with Figma spec (#2154)
* Add lookbook + viewcomponent, organize design system file * Build menu component * Button updates * More button fixes * Replace all menus with new ViewComponent * Checkpoint: fix tests, all buttons and menus converted * Split into Link and Button components for clarity * Button cleanup * Simplify custom confirmation configuration in views * Finalize button, link component API * Add toggle field to custom form builder + Component * Basic tabs component * Custom tabs, convert all menu / tab instances in app * Gem updates * Centralized icon helper * Update all icon usage to central helper * Lint fixes * Centralize all disclosure instances * Dialog replacements * Consolidation of all dialog styles * Test fixes * Fix app layout issues, move to component with slots * Layout simplification * Flakey test fix * Fix dashboard mobile issues * Finalize homepage * Lint fixes * Fix shadows and borders in dark mode * Fix tests * Remove stale class * Fix filled icon logic * Move transparent? to public interface
This commit is contained in:
parent
1aafed5f8b
commit
90a9546f32
291 changed files with 4143 additions and 3104 deletions
|
@ -1,11 +1,15 @@
|
|||
<div class="pt-safe space-y-4">
|
||||
<div class="flex items-center gap-2 p-1.5">
|
||||
<%= link_to previous_path, class: "flex items-center gap-1 text-primary font-medium text-sm" do %>
|
||||
<%= lucide_icon "chevron-left", class: "w-5 h-5 text-secondary" %>
|
||||
<span class="hidden md:block">Back</span>
|
||||
<% end %>
|
||||
<%= render LinkComponent.new(
|
||||
text: "Back",
|
||||
icon: "chevron-left",
|
||||
href: previous_path,
|
||||
variant: "ghost",
|
||||
class: "hidden md:inline-flex"
|
||||
) %>
|
||||
|
||||
<%= link_to previous_path, class: "hidden md:block uppercase bg-surface-inset-hover rounded-sm px-1 py-0.5 text-xs text-secondary shadow-sm ml-1 pointer-events-none", data: { controller: "hotkey", hotkey: "Escape" } do %>
|
||||
esc
|
||||
<kbd>esc</kbd>
|
||||
<% end %>
|
||||
</div>
|
||||
<nav class="space-y-4 hidden md:block">
|
||||
|
@ -83,13 +87,13 @@
|
|||
</section>
|
||||
|
||||
<section>
|
||||
<%= button_to session_path(Current.session), method: :delete, class: "flex items-center gap-2 btn btn--ghost text-destructive w-full" do %>
|
||||
<%= lucide_icon("log-out", class: "w-5 h-5 shrink-0") %>
|
||||
<%= button_to session_path(Current.session), method: :delete, class: "flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-destructive hover:bg-surface-hover w-full" do %>
|
||||
<%= icon("log-out", color: "current") %>
|
||||
<span><%= t(".logout") %></span>
|
||||
<% end %>
|
||||
</section>
|
||||
</nav>
|
||||
<nav class="space-y-4 overflow-y-auto md:hidden" id="mobile-settings-nav" data-preserve-scroll data-controller="preserve-scroll">
|
||||
<nav class="space-y-4 overflow-y-auto md:hidden" id="mobile-settings-nav">
|
||||
|
||||
<ul class="flex space-y-1">
|
||||
|
||||
|
@ -141,8 +145,8 @@
|
|||
<%= render "settings/settings_nav_item", name: t(".feedback_label"), path: feedback_path, icon: "megaphone" %>
|
||||
</li>
|
||||
|
||||
<%= button_to session_path(Current.session), method: :delete, class: "flex items-center gap-2 btn btn--ghost text-destructive w-full" do %>
|
||||
<%= lucide_icon("log-out", class: "w-5 h-5 shrink-0") %>
|
||||
<%= button_to session_path(Current.session), method: :delete, class: "flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-destructive hover:bg-surface-hover w-full" do %>
|
||||
<%= icon("log-out") %>
|
||||
<span><%= t(".logout") %></span>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<%# locals: (name:, path:, icon:) %>
|
||||
|
||||
<%= link_to path, class: class_names(
|
||||
"flex items-center gap-2 btn btn--ghost whitespace-nowrap",
|
||||
"flex items-center gap-2 whitespace-nowrap px-3 py-2 rounded-lg text-sm",
|
||||
page_active?(path) ? "text-primary bg-container shadow-border-xs" : "text-secondary hover:bg-surface-hover border-transparent"
|
||||
), aria: { current: ("page" if page_active?(path)) } do %>
|
||||
<%= lucide_icon(icon, class: "w-5 h-5") if icon %>
|
||||
<%= icon(icon) if icon %>
|
||||
<%= name %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
<%# locals: path, direction, title %>
|
||||
<%= link_to path, class: "hidden md:flex w-full bg-container hover:bg-container-inset rounded-xl border border-alpha-black-25 shadow-xs p-4 items-center justify-between" do %>
|
||||
<% if direction == 'previous' %>
|
||||
<div class="w-5 h-5 text-secondary">
|
||||
<%= lucide_icon("arrow-left") %>
|
||||
</div>
|
||||
<%= icon("arrow-left") %>
|
||||
<% end %>
|
||||
<div class="<%= "grow" if direction == "next" %> <%= "text-right" if direction == "previous" %>">
|
||||
<span class="block text-sm text-secondary"><%= t(".#{direction}") %></span>
|
||||
<span class="block text-sm font-medium text-primary"><%= title %></span>
|
||||
</div>
|
||||
<% if direction == 'next' %>
|
||||
<div class="w-5 h-5 text-secondary">
|
||||
<%= lucide_icon("arrow-right") %>
|
||||
</div>
|
||||
<%= icon("arrow-right") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
@ -21,9 +17,7 @@
|
|||
<div class="flex items-center justify-between">
|
||||
<% if direction == 'previous' %>
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-5 h-5 text-secondary">
|
||||
<%= lucide_icon("arrow-left") %>
|
||||
</div>
|
||||
<%= icon("arrow-left") %>
|
||||
<span class="text-sm text-secondary">Back</span>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -35,9 +29,7 @@
|
|||
</div>
|
||||
<div class="flex items-center gap-3">
|
||||
<span class="text-sm font-medium text-primary"><%= title %></span>
|
||||
<div class="w-5 h-5 text-secondary">
|
||||
<%= lucide_icon("arrow-right") %>
|
||||
</div>
|
||||
<%= icon("arrow-right") %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%# locals: (user:, variant: :thumbnail, lazy: false) %>
|
||||
<%# locals: (avatar_url: nil, initials: "U", lazy: false) %>
|
||||
|
||||
<% if user.profile_image.attached? %>
|
||||
<%= image_tag user.profile_image.variant(variant), class: "rounded-full w-full h-full object-cover", loading: lazy ? "lazy" : "eager" %>
|
||||
<% if avatar_url.present? %>
|
||||
<%= image_tag avatar_url, class: "rounded-full w-full h-full object-cover", loading: lazy ? "lazy" : "eager" %>
|
||||
<% else %>
|
||||
<div class="text-white w-full h-full bg-gray-400 rounded-full flex items-center justify-center text-lg uppercase"><%= user.initial %></div>
|
||||
<div class="w-full h-full bg-surface-inset hover:bg-surface-inset-hover text-secondary rounded-full flex items-center justify-center text-lg uppercase"><%= initials %></div>
|
||||
<% end %>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div data-profile-image-preview-target="placeholderImage"
|
||||
class="h-full w-full flex justify-center items-center <%= user.profile_image.attached? ? "hidden" : "" %>">
|
||||
<div class="h-full w-full flex justify-center items-center bg-container">
|
||||
<%= lucide_icon "image-plus", class: "w-6 h-6 text-secondary" %>
|
||||
<%= icon "image-plus", size: "lg" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
|||
class="h-full w-full flex justify-center items-center <%= user.profile_image.attached? ? "" : "hidden" %>">
|
||||
<% if user.profile_image.attached? %>
|
||||
<div class="h-full w-full">
|
||||
<%= render "settings/user_avatar", user: user %>
|
||||
<%= render "settings/user_avatar", avatar_url: user.profile_image.url %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -30,16 +30,15 @@
|
|||
data-profile-image-preview-target="clearBtn"
|
||||
data-action="click->profile-image-preview#clearFileInput"
|
||||
class="<%= user.profile_image.attached? ? "" : "hidden" %> cursor-pointer absolute bottom-0 right-0 w-8 h-8 bg-gray-50 rounded-full flex justify-center items-center border border-white border-2">
|
||||
<%= lucide_icon "x", class: "w-4 h-4 text-secondary" %>
|
||||
<%= icon "x", size: "sm" %>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="md:text-left text-center">
|
||||
<%= form.hidden_field :delete_profile_image, value: "0", data: { profile_image_preview_target: "deleteProfileImage" } %>
|
||||
|
||||
<%= form.label :profile_image, class: "btn btn--outline inline-block", data: { profile_image_preview_target: "uploadButton" } do %>
|
||||
|
||||
<%= lucide_icon "camera", class: "w-5 h-5 mr-2 inline-block", data: { profile_image_preview_target: "cameraIcon" } %>
|
||||
<%= form.label :profile_image, class: "px-3 py-2 rounded-lg text-sm hover:bg-surface-hover border border-secondary inline-flex items-center gap-2 cursor-pointer", data: { profile_image_preview_target: "uploadButton" } do %>
|
||||
<%= icon "camera", data: { profile_image_preview_target: "cameraIcon" } %>
|
||||
<span data-profile-image-preview-target="uploadText">
|
||||
<%= t(".choose") %> <span class="text-secondary"><%= t(".choose_label") %></span>
|
||||
</span>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="p-3 shadow-border-xs bg-container rounded-lg flex justify-between items-center">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-9 h-9 rounded-full bg-gray-25 flex justify-center items-center">
|
||||
<%= lucide_icon "gem", class: "w-5 h-5 text-secondary" %>
|
||||
<%= icon "gem" %>
|
||||
</div>
|
||||
|
||||
<div class="text-sm space-y-1">
|
||||
|
@ -19,15 +19,24 @@
|
|||
</div>
|
||||
|
||||
<% if @user.family.subscribed? || subscription_pending? %>
|
||||
<%= link_to subscription_path, class: "btn btn--secondary flex items-center gap-1", target: "_blank", rel: "noopener" do %>
|
||||
<span>Manage</span>
|
||||
<%= lucide_icon "external-link", class: "w-5 h-5 shrink-0 text-secondary" %>
|
||||
<% end %>
|
||||
<%= render LinkComponent.new(
|
||||
text: "Manage",
|
||||
icon: "external-link",
|
||||
variant: "primary",
|
||||
icon_position: "right",
|
||||
href: subscription_path,
|
||||
target: "_blank",
|
||||
rel: "noopener"
|
||||
) %>
|
||||
<% else %>
|
||||
<%= link_to new_subscription_path, class: "btn btn--secondary flex items-center gap-1", target: "_blank", rel: "noopener" do %>
|
||||
<span>Subscribe</span>
|
||||
<%= lucide_icon "external-link", class: "w-5 h-5 shrink-0 text-secondary" %>
|
||||
<% end %>
|
||||
<%= render LinkComponent.new(
|
||||
text: "Subscribe",
|
||||
variant: "primary",
|
||||
icon: "external-link",
|
||||
icon_position: "right",
|
||||
href: new_subscription_path,
|
||||
target: "_blank",
|
||||
rel: "noopener") %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<p class="text-secondary text-sm"><%= t(".description") %></p>
|
||||
</div>
|
||||
|
||||
<%= styled_form_with model: Setting.new, url: settings_hosting_path, method: :patch, data: { controller: "auto-submit-form", "auto-submit-form-trigger-event-value" => "blur" } do |form| %>
|
||||
<div class="relative inline-block select-none">
|
||||
<%= form.check_box :require_invite_for_signup, class: "sr-only peer", "data-auto-submit-form-target": "auto", "data-autosubmit-trigger-event": "input", disabled: !Current.user.admin? %>
|
||||
<%= form.label :require_invite_for_signup, " ".html_safe, class: "switch" %>
|
||||
</div>
|
||||
<%= styled_form_with model: Setting.new,
|
||||
url: settings_hosting_path,
|
||||
method: :patch,
|
||||
data: { controller: "auto-submit-form", auto_submit_form_trigger_event_value: "change" } do |form| %>
|
||||
<%= form.toggle :require_invite_for_signup, { data: { auto_submit_form_target: "auto" } } %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
@ -19,11 +19,11 @@
|
|||
<p class="text-secondary text-sm"><%= t(".email_confirmation_description") %></p>
|
||||
</div>
|
||||
|
||||
<%= styled_form_with model: Setting.new, url: settings_hosting_path, method: :patch, data: { controller: "auto-submit-form", "auto-submit-form-trigger-event-value" => "blur" } do |form| %>
|
||||
<div class="relative inline-block select-none">
|
||||
<%= form.check_box :require_email_confirmation, class: "sr-only peer", "data-auto-submit-form-target": "auto", "data-autosubmit-trigger-event": "input", disabled: !Current.user.admin? %>
|
||||
<%= form.label :require_email_confirmation, " ".html_safe, class: "switch" %>
|
||||
</div>
|
||||
<%= styled_form_with model: Setting.new,
|
||||
url: settings_hosting_path,
|
||||
method: :patch,
|
||||
data: { controller: "auto-submit-form", auto_submit_form_trigger_event_value: "change" } do |form| %>
|
||||
<%= form.toggle :require_email_confirmation, { data: { auto_submit_form_target: "auto" } } %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<%= form.fields_for :family do |family_form| %>
|
||||
<%= family_form.select :currency,
|
||||
currencies_for_select.map { |currency| [ "#{currency.name} (#{currency.iso_code})", currency.iso_code ] },
|
||||
Money::Currency.as_options.map { |currency| [ "#{currency.name} (#{currency.iso_code})", currency.iso_code ] },
|
||||
{ label: t(".currency") }, disabled: true %>
|
||||
|
||||
<%= family_form.select :locale,
|
||||
|
@ -46,9 +46,9 @@
|
|||
<%= form_with model: @user, class: "flex flex-col md:flex-row justify-between items-center gap-4", id: "theme_form",
|
||||
data: { controller: "auto-submit-form", auto_submit_form_trigger_event_value: "change" } do |form| %>
|
||||
<%= form.hidden_field :redirect_to, value: "preferences" %>
|
||||
|
||||
|
||||
<% theme_option_class = "text-center transition-all duration-200 p-3 rounded-lg hover:bg-surface-hover cursor-pointer [&:has(input:checked)]:bg-surface-hover [&:has(input:checked)]:border [&:has(input:checked)]:border-primary [&:has(input:checked)]:shadow-xs" %>
|
||||
|
||||
|
||||
<% [
|
||||
{ value: "light", image: "light-mode-preview.png" },
|
||||
{ value: "dark", image: "dark-mode-preview.png" },
|
||||
|
@ -57,8 +57,8 @@
|
|||
<%= form.label :"theme_#{theme[:value]}", class: "group" do %>
|
||||
<div class="<%= theme_option_class %>">
|
||||
<%= image_tag(theme[:image], alt: "#{theme[:value].titleize} Theme Preview", class: "h-44 mb-2") %>
|
||||
<div class="<%= theme[:value] == 'system' ? 'flex items-center gap-2 justify-center' : 'text-sm font-medium text-primary' %>">
|
||||
<%= form.radio_button :theme, theme[:value], checked: @user.theme == theme[:value], class: "sr-only",
|
||||
<div class="<%= theme[:value] == "system" ? "flex items-center gap-2 justify-center" : "text-sm font-medium text-primary" %>">
|
||||
<%= form.radio_button :theme, theme[:value], checked: @user.theme == theme[:value], class: "sr-only",
|
||||
data: { auto_submit_form_target: "auto", autosubmit_trigger_event: "change", action: "theme#updateTheme" } %>
|
||||
<%= t(".theme_#{theme[:value]}") %>
|
||||
</div>
|
||||
|
|
|
@ -6,17 +6,20 @@
|
|||
|
||||
<div>
|
||||
<%= form.email_field :email, placeholder: t(".email"), label: t(".email") %>
|
||||
|
||||
<% if @user.unconfirmed_email.present? %>
|
||||
<p class="mt-2 text-sm text-gray-600">
|
||||
You have requested to change your email to <%= @user.unconfirmed_email %>. Please go to your email and confirm for the change to take effect.
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-4">
|
||||
<%= form.text_field :first_name, placeholder: t(".first_name"), label: t(".first_name") %>
|
||||
<%= form.text_field :last_name, placeholder: t(".last_name"), label: t(".last_name") %>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end mt-4">
|
||||
<%= form.submit t(".save"), class: "btn btn--primary md:w-auto w-full" %>
|
||||
<%= render ButtonComponent.new(text: t(".save"), class: "md:w-auto w-full justify-center") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -40,7 +43,7 @@
|
|||
<% @users.each do |user| %>
|
||||
<div class="flex gap-2 items-center bg-container p-4 border border-alpha-black-25 rounded-lg">
|
||||
<div class="w-9 h-9 shrink-0">
|
||||
<%= render "settings/user_avatar", user: user %>
|
||||
<%= render "settings/user_avatar", avatar_url: user.profile_image.url %>
|
||||
</div>
|
||||
<p class="text-primary font-medium text-sm"><%= user.display_name %></p>
|
||||
<div class="rounded-md bg-surface px-1.5 py-0.5">
|
||||
|
@ -48,17 +51,13 @@
|
|||
</div>
|
||||
<% if Current.user.admin? && user != Current.user %>
|
||||
<div class="ml-auto">
|
||||
<%= button_to settings_profile_path(user_id: user),
|
||||
method: :delete,
|
||||
class: "text-red-500 hover:text-red-700",
|
||||
data: { turbo_confirm: {
|
||||
title: t(".confirm_remove_member.title"),
|
||||
body: t(".confirm_remove_member.body", name: user.display_name),
|
||||
accept: t(".remove_member"),
|
||||
acceptClass: "w-full btn btn--destructive text-white rounded-xl text-center p-[10px] mb-2"
|
||||
}} do %>
|
||||
<%= lucide_icon "x", class: "w-5 h-5" %>
|
||||
<% end %>
|
||||
<%= render ButtonComponent.new(
|
||||
variant: "icon",
|
||||
icon: "x",
|
||||
href: settings_profile_path(user_id: user),
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion(user.display_name, high_severity: true)
|
||||
) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -89,26 +88,23 @@
|
|||
class="text-sm bg-gray-50 px-2 py-1 rounded border border-secondary w-72">
|
||||
<button data-action="clipboard#copy" class="text-secondary hover:text-gray-700">
|
||||
<span data-clipboard-target="iconDefault">
|
||||
<%= lucide_icon "copy", class: "w-5 h-5" %>
|
||||
<%= icon "copy" %>
|
||||
</span>
|
||||
<span class="hidden" data-clipboard-target="iconSuccess">
|
||||
<%= lucide_icon "check", class: "w-5 h-5" %>
|
||||
<%= icon "check" %>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if Current.user.admin? %>
|
||||
<%= button_to invitation_path(invitation),
|
||||
method: :delete,
|
||||
class: "text-red-500 hover:text-red-700",
|
||||
data: { turbo_confirm: {
|
||||
title: t(".confirm_remove_invitation.title"),
|
||||
body: t(".confirm_remove_invitation.body", email: invitation.email),
|
||||
accept: t(".remove_invitation"),
|
||||
acceptClass: "w-full btn btn--destructive text-white rounded-xl text-center p-[10px] mb-2"
|
||||
}} do %>
|
||||
<%= lucide_icon "x", class: "w-5 h-5" %>
|
||||
<% end %>
|
||||
<%= render ButtonComponent.new(
|
||||
variant: "icon",
|
||||
icon: "x",
|
||||
href: invitation_path(invitation),
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion(invitation.email, high_severity: true)
|
||||
) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -118,7 +114,7 @@
|
|||
<%= link_to new_invitation_path,
|
||||
class: "bg-container-inset flex items-center justify-center gap-2 text-secondary mt-1 hover:bg-container-inset-hover rounded-lg px-4 py-2 w-full text-center",
|
||||
data: { turbo_frame: :modal } do %>
|
||||
<%= lucide_icon("plus", class: "w-5 h-5 text-secondary") %>
|
||||
<%= icon("plus") %>
|
||||
<%= t(".invite_member") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
@ -134,16 +130,14 @@
|
|||
<h3 class="font-medium text-primary"><%= t(".reset_account") %></h3>
|
||||
<p class="text-secondary text-sm"><%= t(".reset_account_warning") %></p>
|
||||
</div>
|
||||
<%=
|
||||
button_to t(".reset_account"), reset_user_path(@user), method: :delete,
|
||||
class: "w-full md:w-auto btn btn--destructive",
|
||||
data: { turbo_confirm: {
|
||||
title: t(".confirm_reset.title"),
|
||||
body: t(".confirm_reset.body"),
|
||||
accept: t(".reset_account"),
|
||||
acceptClass: "w-full btn btn--destructive text-primary rounded-xl text-center p-[10px] mb-2"
|
||||
}}
|
||||
%>
|
||||
|
||||
<%= render ButtonComponent.new(
|
||||
text: t(".reset_account"),
|
||||
variant: "destructive",
|
||||
href: reset_user_path(@user),
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Account", high_severity: true)
|
||||
) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4">
|
||||
|
@ -151,16 +145,14 @@
|
|||
<h3 class="font-medium text-primary"><%= t(".delete_account") %></h3>
|
||||
<p class="text-secondary text-sm"><%= t(".delete_account_warning") %></p>
|
||||
</div>
|
||||
<%=
|
||||
button_to t(".delete_account"), user_path(@user), method: :delete,
|
||||
class: "w-full md:w-auto btn btn--destructive",
|
||||
data: { turbo_confirm: {
|
||||
title: t(".confirm_delete.title"),
|
||||
body: t(".confirm_delete.body"),
|
||||
accept: t(".delete_account"),
|
||||
acceptClass: "w-full btn btn--destructive text-white rounded-xl text-center p-[10px] mb-2"
|
||||
}}
|
||||
%>
|
||||
|
||||
<%= render ButtonComponent.new(
|
||||
text: t(".delete_account"),
|
||||
variant: "destructive",
|
||||
href: user_path(@user),
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("your account", high_severity: true)
|
||||
) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="p-3 shadow-border-xs bg-container rounded-lg md:flex md:justify-between md:items-center">
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="w-9 h-9 rounded-full bg-gray-25 flex justify-center items-center">
|
||||
<%= lucide_icon "shield-check", class: "w-5 h-5 text-secondary" %>
|
||||
<%= icon "shield-check" %>
|
||||
</div>
|
||||
|
||||
<div class="text-sm space-y-1">
|
||||
|
@ -21,18 +21,24 @@
|
|||
|
||||
<div class="mt-4 md:mt-0">
|
||||
<% if Current.user.otp_required? %>
|
||||
<%= button_to t(".disable_mfa"), disable_mfa_path,
|
||||
method: :delete,
|
||||
class: "w-full md:w-auto btn btn--secondary flex items-center gap-1 justify-center",
|
||||
data: { turbo_confirm: {
|
||||
title: t(".disable_mfa_confirm"),
|
||||
body: t(".disable_mfa_confirm"),
|
||||
accept: t(".disable_mfa"),
|
||||
acceptClass: "w-full bg-red-500 text-white rounded-xl text-center p-[10px] border mb-2"
|
||||
} } %>
|
||||
<%= render ButtonComponent.new(
|
||||
text: t(".disable_mfa"),
|
||||
variant: "secondary",
|
||||
href: disable_mfa_path,
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.new(
|
||||
title: t(".disable_mfa_confirm"),
|
||||
body: t(".disable_mfa_confirm"),
|
||||
btn_text: t(".disable_mfa"),
|
||||
destructive: true
|
||||
)
|
||||
) %>
|
||||
<% else %>
|
||||
<%= link_to t(".enable_mfa"), new_mfa_path,
|
||||
class: "w-full md:w-auto btn btn--primary flex items-center gap-1 justify-center" %>
|
||||
<%= render LinkComponent.new(
|
||||
text: t(".enable_mfa"),
|
||||
variant: "primary",
|
||||
href: new_mfa_path
|
||||
) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue