Skip to content

Commit

Permalink
fix: classes on field wrapper component (#3519)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Dec 13, 2024
1 parent 5a8f449 commit 42630ec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions app/components/avo/field_wrapper_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ class Avo::FieldWrapperComponent < Avo::BaseComponent
value&.to_sym
end
prop :args, kind: :**, default: {}.freeze
prop :classes do |value|
@args&.dig(:class) || ""
end

def after_initialize
@action = @field.action
@classes = @args.dig(:class) || ""
end

def classes(extra_classes = "")
Expand Down
4 changes: 1 addition & 3 deletions app/components/avo/index/field_wrapper_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ class Avo::Index::FieldWrapperComponent < Avo::BaseComponent
prop :center_content, default: false
prop :flush, default: false
prop :args, kind: :**, default: {}.freeze
prop :classes do |value|
@args&.dig(:class) || ""
end

def after_initialize
@view = Avo::ViewInquirer.new("index")
@classes = @args.dig(:class) || ""
end

def classes
Expand Down
5 changes: 3 additions & 2 deletions app/components/avo/panel_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ class Avo::PanelComponent < Avo::BaseComponent
prop :profile_photo
prop :cover_photo
prop :args, kind: :**, default: {}.freeze
prop :name do |value|
value || @args&.dig(:title)

def after_initialize
@name = @args.dig(:name) || @args.dig(:title)
end

def classes
Expand Down

0 comments on commit 42630ec

Please sign in to comment.