Currency dropdown + logo on login/topbar via brandLogo closure
- Onboarding + Settings: Forms\Components\Select for currency (MDL/EUR/USD/RON/UAH/RUB) instead of TextInput - TenantPanel: brandName/brandLogo/favicon as closures resolving from tenant. Logo now visible on login page, topbar, sidebar (Filament v5 brandLogo handles all 3 spots automatically) - Favicon falls back to logo if favicon not separately uploaded - Removed manual SIDEBAR_LOGO_BEFORE injection (replaced by brandLogo) - Removed manual <link rel=icon> in HEAD_END (replaced by ->favicon)
This commit is contained in:
@@ -33,7 +33,14 @@ class TenantPanelProvider extends PanelProvider
|
||||
->id('tenant')
|
||||
->path('app')
|
||||
->login()
|
||||
->brandName('AutoCRM')
|
||||
->brandName(fn () => app(\App\Tenancy\TenantManager::class)->current()?->display_name
|
||||
?? app(\App\Tenancy\TenantManager::class)->current()?->name
|
||||
?? 'AutoCRM')
|
||||
->brandLogo(fn () => app(\App\Tenancy\TenantManager::class)->current()?->getLogoUrl() ?: null)
|
||||
->brandLogoHeight('2.5rem')
|
||||
->favicon(fn () => app(\App\Tenancy\TenantManager::class)->current()?->getFaviconUrl()
|
||||
?: app(\App\Tenancy\TenantManager::class)->current()?->getLogoUrl()
|
||||
?: null)
|
||||
->colors([
|
||||
'primary' => Color::Blue,
|
||||
])
|
||||
@@ -89,7 +96,6 @@ class TenantPanelProvider extends PanelProvider
|
||||
$t = app(\App\Tenancy\TenantManager::class)->current();
|
||||
$themeColor = $t?->settings['theme_color'] ?? '#3B82F6';
|
||||
$name = $t?->display_name ?? $t?->name ?? 'AutoCRM';
|
||||
$favicon = $t?->getFaviconUrl();
|
||||
// Generate primary color shades from theme_color hex.
|
||||
$hex = ltrim($themeColor, '#');
|
||||
if (strlen($hex) === 6) {
|
||||
@@ -103,10 +109,6 @@ class TenantPanelProvider extends PanelProvider
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $name }}">
|
||||
@if ($favicon)
|
||||
<link rel="icon" type="image/png" href="{{ $favicon }}">
|
||||
<link rel="apple-touch-icon" href="{{ $favicon }}">
|
||||
@endif
|
||||
<style>
|
||||
:root {
|
||||
--primary-50: {{ "rgb({$r} {$g} {$b} / 0.05)" }};
|
||||
@@ -193,20 +195,6 @@ class TenantPanelProvider extends PanelProvider
|
||||
</style>
|
||||
BLADE)
|
||||
)
|
||||
->renderHook(
|
||||
PanelsRenderHook::SIDEBAR_LOGO_BEFORE,
|
||||
fn (): string => Blade::render(<<<'BLADE'
|
||||
@php
|
||||
$t = app(\App\Tenancy\TenantManager::class)->current();
|
||||
$logo = $t?->getLogoUrl();
|
||||
@endphp
|
||||
@if ($logo)
|
||||
<div style="padding: 12px 16px; display: flex; justify-content: center; border-bottom: 1px solid rgba(0,0,0,.06);">
|
||||
<img src="{{ $logo }}" alt="logo" style="max-height: 56px; max-width: 100%;">
|
||||
</div>
|
||||
@endif
|
||||
BLADE)
|
||||
)
|
||||
->renderHook(
|
||||
PanelsRenderHook::BODY_END,
|
||||
fn (): string => Blade::render(<<<'BLADE'
|
||||
|
||||
Reference in New Issue
Block a user