mirror of
https://github.com/we-promise/sure.git
synced 2026-06-01 08:49:01 +00:00
* 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
58 lines
1.8 KiB
Plaintext
58 lines
1.8 KiB
Plaintext
<header class="flex items-center justify-between">
|
|
<h1 class="text-primary text-xl font-medium"><%= t(".categories") %></h1>
|
|
|
|
<div class="flex items-center gap-2">
|
|
<%= render MenuComponent.new do |menu| %>
|
|
<% menu.with_item(
|
|
variant: "button",
|
|
text: "Delete all",
|
|
href: destroy_all_categories_path,
|
|
method: :delete,
|
|
icon: "trash-2",
|
|
confirm: CustomConfirm.for_resource_deletion("All categories", high_severity: true)) %>
|
|
<% end %>
|
|
|
|
<%= render LinkComponent.new(
|
|
text: t(".new"),
|
|
variant: "primary",
|
|
icon: "plus",
|
|
href: new_category_path,
|
|
frame: :modal
|
|
) %>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="bg-container shadow-border-xs rounded-xl p-4">
|
|
<% if @categories.any? %>
|
|
<div class="space-y-4">
|
|
<% if @categories.incomes.any? %>
|
|
<%= render "categories/category_list_group", title: t(".categories_incomes"), categories: @categories.incomes %>
|
|
<% end %>
|
|
|
|
<% if @categories.expenses.any? %>
|
|
<%= render "categories/category_list_group", title: t(".categories_expenses"), categories: @categories.expenses %>
|
|
<% end %>
|
|
</div>
|
|
<% else %>
|
|
<div class="flex justify-center items-center py-20">
|
|
<div class="text-center flex flex-col items-center max-w-[500px]">
|
|
<p class="text-sm text-secondary mb-4"><%= t(".empty") %></p>
|
|
<div class="flex items-center gap-2">
|
|
<%= render ButtonComponent.new(
|
|
text: t(".bootstrap"),
|
|
href: bootstrap_categories_path,
|
|
) %>
|
|
|
|
<%= render LinkComponent.new(
|
|
text: t(".new"),
|
|
variant: "outline",
|
|
icon: "plus",
|
|
href: new_category_path,
|
|
frame: :modal
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|