mirror of
https://github.com/we-promise/sure.git
synced 2026-05-29 23:39:03 +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
32 lines
1.3 KiB
Plaintext
32 lines
1.3 KiB
Plaintext
<%# locals: (category:) %>
|
|
<% is_selected = category.id === @selected_category&.id %>
|
|
|
|
<%= content_tag :div,
|
|
class: ["filterable-item flex justify-between items-center border-none rounded-lg px-2 py-1 group w-full hover:bg-gray-25 focus-within:bg-gray-25",
|
|
{ "bg-gray-25": is_selected }],
|
|
data: { filter_name: category.name } do %>
|
|
<%= button_to transaction_category_path(
|
|
@transaction.entry,
|
|
entry: {
|
|
entryable_type: "Transaction",
|
|
entryable_attributes: { id: @transaction.id, category_id: category.id }
|
|
}
|
|
),
|
|
method: :patch,
|
|
class: "flex w-full items-center gap-1.5 cursor-pointer focus:outline-none" do %>
|
|
|
|
<%= icon("check") if is_selected %>
|
|
|
|
<% if category.subcategory? %>
|
|
<%= icon("corner-down-right", size: "sm") %>
|
|
<% end %>
|
|
|
|
<%= render partial: "categories/badge", locals: { category: category } %>
|
|
<% end %>
|
|
|
|
<%= render MenuComponent.new do |menu| %>
|
|
<% menu.with_item(variant: "link", text: t(".edit"), icon: "pencil-line", href: edit_category_path(category), data: { turbo_frame: :modal }) %>
|
|
<% menu.with_item(variant: "link", text: t(".delete"), icon: "trash-2", href: new_category_deletion_path(category), data: { turbo_frame: :modal }, destructive: true) %>
|
|
<% end %>
|
|
<% end %>
|