From 0b1fe6d49126a2cb57e60b539fb9a0fe8577a30e Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Sun, 26 May 2024 13:02:44 +0100 Subject: [PATCH] Remove Livewire Seems like overkill for this stage of things. It's also not clear to me how to use Livewire for only a subset of interactive functionality on the page. --- resources/sass/app.scss | 13 +++++++++++++ resources/sass/components/_bookmark.scss | 12 ++++++++++++ resources/views/bookmarks/show.blade.php | 3 +++ resources/views/components/bookmark.blade.php | 7 ++++++- routes/web.php | 8 ++++++-- 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/resources/sass/app.scss b/resources/sass/app.scss index abf61df..6bebdc0 100644 --- a/resources/sass/app.scss +++ b/resources/sass/app.scss @@ -17,6 +17,19 @@ body { @import 'components/bookmark'; @import 'components/pagination'; +a { + &, + &:active, + &:visited { + color: #fff; + } + + &:hover { + color: #88f; + } +} + + h1 { color: #FFF3B0; text-align: center; diff --git a/resources/sass/components/_bookmark.scss b/resources/sass/components/_bookmark.scss index 4af3287..aa88276 100644 --- a/resources/sass/components/_bookmark.scss +++ b/resources/sass/components/_bookmark.scss @@ -16,6 +16,18 @@ overflow: hidden; + a { + &, + &:active, + &:visited { + color: #9E2A2B; + } + + &:hover { + color: #000; + } + } + &-title { margin: 0; padding: 1ex; diff --git a/resources/views/bookmarks/show.blade.php b/resources/views/bookmarks/show.blade.php index 605ec9d..9704559 100644 --- a/resources/views/bookmarks/show.blade.php +++ b/resources/views/bookmarks/show.blade.php @@ -1,5 +1,8 @@ @extends('layouts.app') @section('content') +

+ ← Back +

@endsection diff --git a/resources/views/components/bookmark.blade.php b/resources/views/components/bookmark.blade.php index eaa31e4..4956fa4 100644 --- a/resources/views/components/bookmark.blade.php +++ b/resources/views/components/bookmark.blade.php @@ -1,5 +1,10 @@
-

{{ $bookmark->title }}

+

+ {{ $bookmark->title }} + @action('index') + # + @endaction +

{{ $bookmark->href }}

@if (!empty($bookmark->description))
diff --git a/routes/web.php b/routes/web.php index 668451c..7cd0725 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,5 +3,9 @@ use App\Http\Controllers\BookmarkController; use Illuminate\Support\Facades\Route; -Route::get('/', [BookmarkController::class, 'index']); -Route::resource('bookmarks', BookmarkController::class)->except(['index']); +Route::get( + '/', function () { + return redirect()->action([BookmarkController::class, 'index']); + } +); +Route::resource('bookmarks', BookmarkController::class);