Skip to content

Commit

Permalink
Merge pull request #44 from savannabits/3.x-dev
Browse files Browse the repository at this point in the history
3.x dev - Updated the Sidebar Render Hooks
  • Loading branch information
coolsam726 authored Jul 31, 2023
2 parents 1847f36 + 53e55a2 commit 740b5f1
Showing 1 changed file with 12 additions and 4 deletions.
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

0 comments on commit 740b5f1

Please sign in to comment.