Skip to content

Commit

Permalink
fix: Add default icon for action list (#2838)
Browse files Browse the repository at this point in the history
Co-authored-by: Adrian Marin <adrian@adrianthedev.com>
  • Loading branch information
gabrielgiroe1 and adrianthedev authored Jun 11, 2024
1 parent f7111ca commit da88310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/avo/actions_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Avo::ActionsComponent < ViewComponent::Base
include Avo::ApplicationHelper
attr_reader :label, :size, :as_row_control

def initialize(actions: [], resource: nil, view: nil, exclude: [], include: [], style: :outline, color: :primary, label: nil, size: :md, as_row_control: false, icon: "heroicons/outline/arrow-down-circle")
def initialize(actions: [], resource: nil, view: nil, exclude: [], include: [], style: :outline, color: :primary, label: nil, size: :md, as_row_control: false, icon: nil)
@actions = actions || []
@resource = resource
@view = view
Expand Down
4 changes: 3 additions & 1 deletion lib/avo/resources/controls/actions_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module Avo
module Resources
module Controls
class ActionsList < BaseControl
ACTIONS_LIST_DROPDOWN_ICON = "heroicons/outline/arrow-down-circle"

attr_reader :color, :exclude, :include, :style, :icon

def initialize(**args)
Expand All @@ -11,7 +13,7 @@ def initialize(**args)
@exclude = args[:exclude] || []
@include = args[:include] || []
@style = args[:style] || :outline
@icon = args[:icon]
@icon = args[:icon] || ACTIONS_LIST_DROPDOWN_ICON
end
end
end
Expand Down

0 comments on commit da88310

Please sign in to comment.