Skip to content

Commit

Permalink
feature: Allow Avo::NavigationLinkComponent to accept an optional tar…
Browse files Browse the repository at this point in the history
…get param (#685)
  • Loading branch information
rickychilcott committed Feb 19, 2022
1 parent f3f12f3 commit 030f2fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/avo/navigation_link_component.html.erb
@@ -1,3 +1,3 @@
<%= active_link_to @path, class: 'text-gray-800 py-2 px-4 block font-normal hover:bg-gray-100 rounded-md mb-1 mx-3 text-sm leading-none', active: @active do %>
<%= active_link_to @path, class: 'text-gray-800 py-2 px-4 block font-normal hover:bg-gray-100 rounded-md mb-1 mx-3 text-sm leading-none', active: @active, target: @target do %>
<div class="w-4"></div> <%= @label %>
<% end %>
3 changes: 2 additions & 1 deletion app/components/avo/navigation_link_component.rb
@@ -1,10 +1,11 @@
# frozen_string_literal: true

class Avo::NavigationLinkComponent < ViewComponent::Base
def initialize(label: nil, path: nil, active: :inclusive, size: :md)
def initialize(label: nil, path: nil, active: :inclusive, size: :md, target: "_self")
@label = label
@path = path
@active = active
@size = size
@target = target
end
end

0 comments on commit 030f2fc

Please sign in to comment.