Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x dev - Updated the Sidebar Render Hooks #44

Merged
merged 3 commits into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/ModulesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,19 @@ public function register()
$title = $id->replace(['::', '-'], [' ', ' '])->title()->toString();
$panel
->renderHook(
'sidebar.start',
'panels::sidebar.nav.start',
fn () => new HtmlString("<h2 class='m-2 p-2 font-black text-xl'>$title</h2>"),
)->renderHook(
'sidebar.end',
fn () => new HtmlString("<a href='".url('/')."' class='m-2 p-2 block rounded-lg font-bold bg-primary-500/10 text-primary-500'>Go to Home</a>"),
)
->renderHook(
'panels::sidebar.nav.end',
fn () => new HtmlString(
'<a href="'.url('/').'" class="m-2 p-2 mt-4 inline-flex gap-2 block rounded-lg font-bold bg-gray-500/10">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 15L3 9m0 0l6-6M3 9h12a6 6 0 010 12h-3" />
</svg>
Main Panel
</a>'
),
);
}
}
Expand Down