mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
Sync notifications and troubleshooting guides (#998)
* Add help articles * Broadcast sync messages as notifications * Lint fixes * more lint fixes * Remove redundant code
This commit is contained in:
parent
b200b71284
commit
fa08f027c7
33 changed files with 256 additions and 97 deletions
19
app/views/accounts/_alert.html.erb
Normal file
19
app/views/accounts/_alert.html.erb
Normal file
|
@ -0,0 +1,19 @@
|
|||
<%# locals: (message:, help_path: nil) -%>
|
||||
<%= tag.div class: "flex gap-6 items-center rounded-xl px-4 py-3 bg-error/5",
|
||||
data: { controller: "element-removal" },
|
||||
role: "alert" do %>
|
||||
<div class="flex gap-3 items-center text-red-500 grow overflow-x-scroll">
|
||||
<%= lucide_icon("alert-octagon", class: "w-5 h-5 shrink-0") %>
|
||||
<p class="text-sm whitespace-nowrap"><%= message %></p>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-4 ml-auto">
|
||||
<% if help_path %>
|
||||
<%= link_to "Troubleshoot", help_path, class: "text-red-500 font-medium hover:underline", data: { turbo_frame: :drawer } %>
|
||||
<% end %>
|
||||
|
||||
<%= tag.button data: { action: "click->element-removal#remove" } do %>
|
||||
<%= lucide_icon("x", class: "w-5 h-5 shrink-0 text-red-500") %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,8 +0,0 @@
|
|||
<%# locals: (is_syncing:) %>
|
||||
<% if is_syncing %>
|
||||
<div class="my-4 px-8 py-4 rounded-lg bg-yellow-500/10 flex items-center justify-between">
|
||||
<p class="text-gray-900 text-sm">
|
||||
Syncing your account balances.
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,5 +1,3 @@
|
|||
<%= turbo_stream_from @account %>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex items-center gap-3">
|
||||
|
@ -45,12 +43,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<%= turbo_frame_tag "sync_message" do %>
|
||||
<%= render partial: "accounts/sync_message", locals: { is_syncing: @account.syncing? } %>
|
||||
<% end %>
|
||||
|
||||
<% if @account.alert %>
|
||||
<%= render partial: "shared/alert", locals: { type: "error", content: t("." + @account.alert) } %>
|
||||
<%= render "alert", message: @account.alert, help_path: help_article_path("troubleshooting") %>
|
||||
<% end %>
|
||||
|
||||
<div class="bg-white shadow-xs rounded-xl border border-alpha-black-25 rounded-lg">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue