badge on the hamburger menu ?
Anyone point me to a solution for putting a badge on the hamburger menu button that appears for the smaller viewports ?
Solution
Solution I went with:
In the panel:
LW Component:
Blade:
In the panel:
->renderHook(
PanelsRenderHook::TOPBAR_START,
function () : string {
if (Filament::getTenant()->hasAlerts()) {
return Blade::render('@livewire(\'area.persona.livewire.sidebar-alert\')');
}
return '';
}
)LW Component:
use Livewire\Component;
class SidebarAlert extends Component
{
public function render()
{
return view('web.components.panel.persona.sidebar.alert');
}
}Blade:
<div class="lg:hidden">
<x-filament::icon-button
type="button"
wire:loading.attr="disabled"
x-on:click="$store.sidebar.open()"
x-show="! $store.sidebar.isOpen"
icon="phosphor-caret-circle-double-right-duotone"
size="lg"
class="animate-pulse text-red-500"
tooltip="You have alerts, expand the sidebar to see them"
/>
</div>