Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Sep 3, 2024
1 parent 052f48d commit 9cc6abd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/components/avo/sidebar/base_item_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Avo::Sidebar::BaseItemComponent < Avo::BaseComponent

# Object = Avo::Menu::BaseItem || ViewComponent::Base
prop :item, _Nilable(Object), reader: :public
prop :locals, _Nilable(Hash), default: {}.freeze

def after_initialize
@items = @item.items.select(&:visible?)
Expand Down
4 changes: 3 additions & 1 deletion app/components/avo/sidebar/link_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<% if @path.present? %>
<%= send link_method, @path, class: classes, active: @active, target: @target, data: @data do %>
<%= rel.inspect %>
<%= @rel.inspect %>
<%= send link_method, @path, class: classes, active: @active, target: @target, data: @data, rel: @rel do %>
<%= helpers.svg @icon, class: "h-4 text-gray-700" if @icon.present? %>
<%= @label %>
<% if @target == :_blank %>
Expand Down
1 change: 1 addition & 0 deletions app/components/avo/sidebar/link_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Avo::Sidebar::LinkComponent < Avo::BaseComponent
prop :target, _Nilable(Symbol) do |value|
value&.to_sym
end
prop :rel, _Nilable(_Union(String, Symbol))
prop :data, Hash, default: {}.freeze
prop :icon, _Nilable(String)

Expand Down

0 comments on commit 9cc6abd

Please sign in to comment.