Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

fix(ds): use DS::Disclosure for investment-performance expander (#2243)

Guillem Arias Fauste034a12f1d8d7
diff --git a/app/views/reports/_investment_performance.html.erb b/app/views/reports/_investment_performance.html.erb
index 96f9fc8e68..efa215a2ce 100644
--- a/app/views/reports/_investment_performance.html.erb
+++ b/app/views/reports/_investment_performance.html.erb
@@ -164,14 +164,16 @@
</p>
<% end %>
- <details class="group">
- <summary class="cursor-pointer text-xs text-secondary hover:text-primary flex items-center gap-1">
- <%= icon "chevron-right", size: "sm", class: "group-open:rotate-90 transition-transform" %>
- <%= t("reports.investment_performance.view_details") %>
- (<%= t("reports.investment_performance.holdings_count", count: data[:holdings].count) %>, <%= t("reports.investment_performance.sells_count", count: data[:sell_trades].count) %>)
- </summary>
+ <%= render DS::Disclosure.new(variant: :inline) do |disclosure| %>
+ <% disclosure.with_summary_content do %>
+ <span class="flex items-center gap-1 text-xs text-secondary hover:text-primary">
+ <%= icon "chevron-right", size: "sm", class: "group-open:rotate-90 motion-safe:transition-transform motion-safe:duration-150" %>
+ <%= t("reports.investment_performance.view_details") %>
+ (<%= t("reports.investment_performance.holdings_count", count: data[:holdings].count) %>, <%= t("reports.investment_performance.sells_count", count: data[:sell_trades].count) %>)
+ </span>
+ <% end %>
- <div class="mt-2 space-y-2 text-xs">
+ <div class="space-y-2 text-xs">
<% if data[:holdings].any? %>
<div class="space-y-1">
<p class="text-secondary font-medium"><%= t("reports.investment_performance.holdings") %></p>
@@ -207,7 +209,7 @@
</div>
<% end %>
</div>
- </details>
+ <% end %>
</div>
<% end %>
</div>