diff --git a/app/components/disclosure_component.html.erb b/app/components/disclosure_component.html.erb index 38db2d7f..bf6f61d1 100644 --- a/app/components/disclosure_component.html.erb +++ b/app/components/disclosure_component.html.erb @@ -2,20 +2,22 @@ <%= tag.summary class: class_names( "px-3 py-2 rounded-xl cursor-pointer flex items-center justify-between bg-surface" ) do %> -
- <% if align == :left %> - <%= helpers.icon "chevron-right", class: "group-open:transform group-open:rotate-90" %> - <% end %> - - <%= tag.span class: class_names("font-medium", align == :left ? "text-sm text-primary" : "text-xs uppercase text-secondary") do %> - <%= title %> - <% end %> -
- - <% if align == :right %> - <%= helpers.icon "chevron-down", class: "group-open:transform group-open:rotate-180" %> - <% elsif summary_content? %> + <% if summary_content? %> <%= summary_content %> + <% else %> +
+ <% if align == :left %> + <%= helpers.icon "chevron-right", class: "group-open:transform group-open:rotate-90" %> + <% end %> + + <%= tag.span class: class_names("font-medium", align == :left ? "text-sm text-primary" : "text-xs uppercase text-secondary") do %> + <%= title %> + <% end %> +
+ + <% if align == :right %> + <%= helpers.icon "chevron-down", class: "group-open:transform group-open:rotate-180" %> + <% end %> <% end %> <% end %> diff --git a/app/components/disclosure_component.rb b/app/components/disclosure_component.rb index 013e3e9d..5aba01b2 100644 --- a/app/components/disclosure_component.rb +++ b/app/components/disclosure_component.rb @@ -3,7 +3,7 @@ class DisclosureComponent < ViewComponent::Base attr_reader :title, :align, :open, :opts - def initialize(title:, align: "right", open: false, **opts) + def initialize(title: nil, align: "right", open: false, **opts) @title = title @align = align.to_sym @open = open diff --git a/app/views/accounts/_accountable_group.html.erb b/app/views/accounts/_accountable_group.html.erb index 26b69be3..ccca2088 100644 --- a/app/views/accounts/_accountable_group.html.erb +++ b/app/views/accounts/_accountable_group.html.erb @@ -2,13 +2,14 @@
<% is_open = open.nil? ? account_group.accounts.any? { |account| page_active?(account_path(account)) } : open %> - <%= render DisclosureComponent.new(title: account_group.name, align: :left, open: is_open) do |disclosure| %> + <%= render DisclosureComponent.new(align: :left, open: is_open) do |disclosure| %> <% disclosure.with_summary_content do %> - <% if account_group.syncing? %> -
- <%= render partial: "shared/sync_indicator", locals: { size: "xs" } %> -
- <% end %> +
+ <%= icon "chevron-right", class: "group-open:transform group-open:rotate-90" %> + <%= tag.span class: class_names("text-sm text-primary font-medium", "animate-pulse" => account_group.syncing?) do %> + <%= account_group.name %> + <% end %> +
<%= tag.p format_money(account_group.total_money), class: "text-sm font-medium text-primary" %> @@ -32,10 +33,7 @@
- <%= tag.p account.name, class: "text-sm text-primary font-medium truncate" %> - <% if account.syncing? %> - <%= render partial: "shared/sync_indicator", locals: { size: "xs" } %> - <% end %> + <%= tag.p account.name, class: class_names("text-sm text-primary font-medium truncate", "animate-pulse" => account.syncing?) %>
<%= tag.p account.short_subtype_label, class: "text-sm text-secondary truncate" %>
diff --git a/app/views/accounts/show/_header.html.erb b/app/views/accounts/show/_header.html.erb index 283b4e05..ea0514a5 100644 --- a/app/views/accounts/show/_header.html.erb +++ b/app/views/accounts/show/_header.html.erb @@ -12,15 +12,11 @@
-

<%= title || account.name %>

+

"><%= title || account.name %>

<% if subtitle.present? %>

<%= subtitle %>

<% end %>
- - <% if account.syncing? %> - <%= render partial: "shared/sync_indicator", locals: { size: "sm" } %> - <% end %>
<% end %> diff --git a/app/views/pages/dashboard/_balance_sheet.html.erb b/app/views/pages/dashboard/_balance_sheet.html.erb index 60f7786b..8ad17567 100644 --- a/app/views/pages/dashboard/_balance_sheet.html.erb +++ b/app/views/pages/dashboard/_balance_sheet.html.erb @@ -5,7 +5,7 @@

- + "> <%= classification_group.name %> @@ -14,10 +14,6 @@ <%= classification_group.total_money.format(precision: 0) %> <% end %>

- - <% if classification_group.syncing? %> - <%= render partial: "shared/sync_indicator", locals: { size: "sm" } %> - <% end %>
<% if classification_group.account_groups.any? %> diff --git a/app/views/pages/dashboard/_net_worth_chart.html.erb b/app/views/pages/dashboard/_net_worth_chart.html.erb index fabc0267..56a31f24 100644 --- a/app/views/pages/dashboard/_net_worth_chart.html.erb +++ b/app/views/pages/dashboard/_net_worth_chart.html.erb @@ -7,13 +7,9 @@

<%= t(".title") %>

- - <% if balance_sheet.syncing? %> - <%= render partial: "shared/sync_indicator", locals: { size: "sm" } %> - <% end %>
-

+

"> <%= series.trend.current.format %>

diff --git a/app/views/shared/_sync_indicator.html.erb b/app/views/shared/_sync_indicator.html.erb deleted file mode 100644 index 2ef56bf5..00000000 --- a/app/views/shared/_sync_indicator.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%# locals: (size: "md") %> - -
- <%= icon "loader-circle", color: "current", size: size %> -