Set active title for setting

This commit is contained in:
philipp lang 2024-10-25 00:46:03 +02:00
parent 0d04d9ee99
commit 98f567b6cd
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ use Illuminate\View\Component;
class Layout extends Component class Layout extends Component
{ {
public function __construct(public string $pageClass = '') public function __construct(public string $pageClass = '', public string $title = '')
{ {
} }
@ -26,7 +26,7 @@ class Layout extends Component
return <<<'HTML' return <<<'HTML'
<div class="grow flex flex-col" @refresh-page.window="$wire.$refresh"> <div class="grow flex flex-col" @refresh-page.window="$wire.$refresh">
<div class="grow bg-gray-900 flex flex-col duration-300 navbar:ml-60"> <div class="grow bg-gray-900 flex flex-col duration-300 navbar:ml-60">
<x-page::header title="{{ session()->get('title') }}"> <x-page::header :title="$title">
<x-slot:beforeTitle> <x-slot:beforeTitle>
<a href="#" class="lg:hidden" wire:click.prevent="dispatch('toggle-sidebar')"> <a href="#" class="lg:hidden" wire:click.prevent="dispatch('toggle-sidebar')">
<x-ui::sprite src="menu" class="text-gray-100 w-5 h-5"></x-ui::sprite> <x-ui::sprite src="menu" class="text-gray-100 w-5 h-5"></x-ui::sprite>

View File

@ -23,7 +23,7 @@ class SettingLayout extends Component
public function render() public function render()
{ {
return <<<'HTML' return <<<'HTML'
<x-page::layout> <x-page::layout :title="$active::title()">
<x-slot:right> <x-slot:right>
{{ $right ?? '' }} {{ $right ?? '' }}
</x-slot:right> </x-slot:right>