diff --git a/app/Livewire/NotificationsPage.php b/app/Livewire/Pages/Notifications.php similarity index 92% rename from app/Livewire/NotificationsPage.php rename to app/Livewire/Pages/Notifications.php index 1d86b1c2..0af99ffc 100644 --- a/app/Livewire/NotificationsPage.php +++ b/app/Livewire/Pages/Notifications.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Livewire; +namespace App\Livewire\Pages; use App\Policies\NotificationPolicy; use Carbon\Carbon; @@ -13,7 +13,7 @@ use Illuminate\Support\Facades\Auth; use Livewire\Component; -final class NotificationsPage extends Component +final class Notifications extends Component { use AuthorizesRequests; @@ -48,7 +48,7 @@ public function markAsRead(string $notificationId): void public function render(): View { - return view('livewire.notifications-page', [ + return view('livewire.pages.notifications', [ // @phpstan-ignore-next-line 'notifications' => Auth::user() ->unreadNotifications() diff --git a/resources/views/livewire/notifications-page.blade.php b/resources/views/livewire/notifications-page.blade.php deleted file mode 100644 index 9cff88be..00000000 --- a/resources/views/livewire/notifications-page.blade.php +++ /dev/null @@ -1,208 +0,0 @@ -
- @forelse ($notifications as $date => $record) -
-
-

- - - - {{ $date }} -

-
- -
-
    - @foreach ($record as $notification) - @includeIf("components.notifications.{$notification->data['type']}") - @endforeach -
-
-
- @empty -
-
- - - -

- {{ __('pages/notification.empty') }} -

-
-
- -
-

- {{ __('pages/notification.new_content') }} -

-

- {{ __('pages/notification.choose_content') }} -

- -
- @endforelse -
diff --git a/resources/views/livewire/pages/notifications.blade.php b/resources/views/livewire/pages/notifications.blade.php new file mode 100644 index 00000000..79912bba --- /dev/null +++ b/resources/views/livewire/pages/notifications.blade.php @@ -0,0 +1,225 @@ +
+ +
+ + +

+ Notifications + +

+
+ +
+
+ @forelse ($notifications as $date => $record) +
+
+

+ + + + {{ $date }} +

+
+ +
+
    + @foreach ($record as $notification) + @includeIf("components.notifications.{$notification->data['type']}") + @endforeach +
+
+
+ @empty +
+
+ + + +

+ {{ __('pages/notification.empty') }} +

+
+
+ +
+

+ {{ __('pages/notification.new_content') }} +

+

+ {{ __('pages/notification.choose_content') }} +

+ +
+ @endforelse +
+
+
+
diff --git a/resources/views/user/notifications.blade.php b/resources/views/user/notifications.blade.php deleted file mode 100644 index 5faec7c0..00000000 --- a/resources/views/user/notifications.blade.php +++ /dev/null @@ -1,18 +0,0 @@ - - -
- - -

- Notifications - -

-
- -
- -
-
-
diff --git a/routes/web.php b/routes/web.php index e1d83bc2..60f414a0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -44,7 +44,7 @@ Route::get('subscribeable/{id}/{type}', [SubscriptionController::class, 'redirect'])->name('subscriptions.redirect'); // Notifications -Route::view('notifications', 'user.notifications') +Route::get('notifications', \App\Livewire\Pages\Notifications::class) ->name('notifications') ->middleware(['auth', 'checkIfBanned']);