From aa820303ec40ad42d41ba98a46c0147a39fd422d Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Wed, 29 May 2024 23:11:35 +0100 Subject: [PATCH] Hide bookmark permalink if it's the active route --- app/View/Components/Bookmark.php | 4 +++- resources/views/bookmarks/show.blade.php | 2 +- resources/views/components/bookmark.blade.php | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/View/Components/Bookmark.php b/app/View/Components/Bookmark.php index 271cea1..1f8e74d 100644 --- a/app/View/Components/Bookmark.php +++ b/app/View/Components/Bookmark.php @@ -13,7 +13,9 @@ class Bookmark extends Component * Create a new component instance. */ public function __construct( - public ModelsBookmark $bookmark + public ModelsBookmark $bookmark, + public bool $showPermalink = true, + public bool $showEdit = true, ) { // } diff --git a/resources/views/bookmarks/show.blade.php b/resources/views/bookmarks/show.blade.php index d2e1359..27ca5b8 100644 --- a/resources/views/bookmarks/show.blade.php +++ b/resources/views/bookmarks/show.blade.php @@ -4,7 +4,7 @@

← Back

- +

edit

diff --git a/resources/views/components/bookmark.blade.php b/resources/views/components/bookmark.blade.php index 5687f03..e4261e3 100644 --- a/resources/views/components/bookmark.blade.php +++ b/resources/views/components/bookmark.blade.php @@ -1,10 +1,12 @@

{{ $bookmark->title }} - @action('index') + @if ($showPermalink) # + @endif + @if ($showEdit) e - @endaction + @endif

{{ $bookmark->href }}

@if (!empty($bookmark->description))