Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Allow Avo::NavigationLinkComponent to accept an optional tar…
…get param (#685)
- Loading branch information
1 parent
f3f12f3
commit 030f2fc
Showing
2 changed files
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |