mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 19:44:09 +00:00
* Fix lunch flow pre-loading and UX * Small UX fixes - Proper closing of modal on cancel - Preload on new account already * Review comments * Fix json error * Delete .claude/settings.local.json Signed-off-by: soky srm <sokysrm@gmail.com> * Lunch Flow brand (again :-) * FIX process only linked accounts * FIX disable accounts with no name * Fix string normalization --------- Signed-off-by: soky srm <sokysrm@gmail.com> Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
66 lines
3.5 KiB
Plaintext
66 lines
3.5 KiB
Plaintext
<%# locals: (path:, accountable_type:, show_us_link: true, show_eu_link: true, show_lunchflow_link: false) %>
|
|
|
|
<%= render layout: "accounts/new/container", locals: { title: t(".title"), back_path: new_account_path } do %>
|
|
<div class="text-sm"
|
|
<% if show_lunchflow_link %>
|
|
data-controller="lunchflow-preload"
|
|
data-lunchflow-preload-accountable-type-value="<%= h(accountable_type) %>"
|
|
<% if params[:return_to] %>
|
|
data-lunchflow-preload-return-to-value="<%= h(params[:return_to]) %>"
|
|
<% end %>
|
|
<% end %>>
|
|
<%= link_to path, class: "flex items-center gap-4 w-full text-center text-primary focus:outline-hidden focus:bg-surface border border-transparent focus:border focus:border-gray-200 px-2 hover:bg-surface rounded-lg p-2" do %>
|
|
<span class="flex w-8 h-8 shrink-0 grow-0 items-center justify-center rounded-lg bg-alpha-black-50 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]">
|
|
<%= icon("keyboard") %>
|
|
</span>
|
|
<%= t("accounts.new.method_selector.manual_entry") %>
|
|
<% end %>
|
|
|
|
<% if show_us_link %>
|
|
<%# Default US-only Link %>
|
|
<%= link_to new_plaid_item_path(region: "us", accountable_type: accountable_type),
|
|
class: "text-primary flex items-center gap-4 w-full text-center focus:outline-hidden focus:bg-surface border border-transparent focus:border focus:border-primary px-2 hover:bg-surface rounded-lg p-2",
|
|
data: { turbo_frame: "modal" } do %>
|
|
<span class="flex w-8 h-8 shrink-0 grow-0 items-center justify-center rounded-lg bg-alpha-black-50 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]">
|
|
<%= icon("link-2") %>
|
|
</span>
|
|
<%= t("accounts.new.method_selector.connected_entry") %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%# EU Link %>
|
|
<% if show_eu_link %>
|
|
<%= link_to new_plaid_item_path(region: "eu", accountable_type: accountable_type),
|
|
class: "text-primary flex items-center gap-4 w-full text-center focus:outline-hidden focus:bg-surface border border-transparent focus:border focus:border-primary px-2 hover:bg-surface rounded-lg p-2",
|
|
data: { turbo_frame: "modal" } do %>
|
|
<span class="flex w-8 h-8 shrink-0 grow-0 items-center justify-center rounded-lg bg-alpha-black-50 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]">
|
|
<%= icon("link-2") %>
|
|
</span>
|
|
<%= t("accounts.new.method_selector.connected_entry_eu") %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%# Lunchflow Link %>
|
|
<% if show_lunchflow_link %>
|
|
<%= link_to select_accounts_lunchflow_items_path(accountable_type: accountable_type, return_to: params[:return_to]),
|
|
class: "text-primary flex items-center gap-4 w-full text-center focus:outline-hidden focus:bg-surface border border-transparent focus:border focus:border-primary px-2 hover:bg-surface rounded-lg p-2",
|
|
data: {
|
|
turbo_frame: "modal",
|
|
turbo_action: "advance",
|
|
lunchflow_preload_target: "link"
|
|
} do %>
|
|
<span class="flex w-8 h-8 shrink-0 grow-0 items-center justify-center rounded-lg bg-alpha-black-50 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.02)]">
|
|
<%= icon("link-2") %>
|
|
</span>
|
|
<span class="flex items-center gap-2">
|
|
<%= t("accounts.new.method_selector.lunchflow_entry") %>
|
|
<span data-lunchflow-preload-target="spinner" class="hidden">
|
|
<%= icon("loader-2", class: "animate-spin") %>
|
|
</span>
|
|
</span>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
</div>
|
|
<% end %>
|