-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor component to use attribute merging
Create attribute bag in test setup Update test to expect cleaner HTML output
- Loading branch information
1 parent
c61eef9
commit 759c63a
Showing
3 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
packages/framework/resources/views/components/navigation/navigation-link.blade.php
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,4 +1,6 @@ | ||
<a href="{{ $item }}" {!! $item->isActive() ? 'aria-current="page"' : '' !!} @class([ | ||
<a href="{{ $item }}" {{ ($attributes->except('item')->class([ | ||
'navigation-link block my-2 md:my-0 md:inline-block py-1 text-gray-700 hover:text-gray-900 dark:text-gray-100', | ||
'navigation-link-active border-l-4 border-indigo-500 md:border-none font-medium -ml-6 pl-5 md:ml-0 md:pl-0 bg-gray-100 dark:bg-gray-800 md:bg-transparent dark:md:bg-transparent' => $item->isActive() | ||
])>{{ $item->getLabel() }}</a> | ||
])->merge([ | ||
'aria-current' => ($item->isActive() ? 'page' : false), | ||
])) }}>{{ $item->getLabel() }}</a> |
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
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