diff --git a/resources/views/components/sidebar.blade.php b/resources/views/components/sidebar.blade.php index 87dd5e1..8fa7363 100644 --- a/resources/views/components/sidebar.blade.php +++ b/resources/views/components/sidebar.blade.php @@ -1,187 +1,140 @@ @php $workspace = current_workspace(); $workspaces = auth()->check() ? auth()->user()->workspaces()->orderBy('name')->get() : collect(); - $wsUlid = $workspace?->ulid; - $nav = $workspace ? [ - [ - 'label' => 'Dashboard', - 'route' => 'w.dashboard', - 'params' => [$wsUlid], - 'match' => 'w.dashboard', - 'icon' => 'dashboard', - ], - [ - 'label' => 'Links', - 'route' => 'w.links.index', - 'params' => [$wsUlid], - 'match' => 'w.links.*', - 'icon' => 'links', - ], - [ - 'label' => 'QR Codes', - 'route' => 'w.qr.index', - 'params' => [$wsUlid], - 'match' => 'w.qr.*', - 'icon' => 'qr', - ], - [ - 'label' => 'Link-in-Bio', - 'route' => 'w.bio.index', - 'params' => [$wsUlid], - 'match' => 'w.bio.*', - 'icon' => 'bio', - ], - [ - 'label' => 'Analytics', - 'route' => 'w.analytics.index', - 'params' => [$wsUlid], - 'match' => 'w.analytics.*', - 'icon' => 'analytics', - ], - [ - 'label' => 'Domains', - 'route' => 'w.domains.index', - 'params' => [$wsUlid], - 'match' => 'w.domains.*', - 'icon' => 'domains', - ], - [ - 'label' => 'Settings', - 'route' => 'w.settings.index', - 'params' => [$wsUlid], - 'match' => 'w.settings.*', - 'icon' => 'settings', - ], - [ - 'label' => 'Billing', - 'route' => 'w.billing.index', - 'params' => [$wsUlid], - 'match' => 'w.billing.*', - 'icon' => 'billing', - ], - [ - 'label' => 'Team', - 'route' => 'w.team.index', - 'params' => [$wsUlid], - 'match' => 'w.team.*', - 'icon' => 'team', - ], - [ - 'label' => 'AI', - 'route' => 'w.ai.insights', - 'params' => [$wsUlid], - 'match' => 'w.ai.*', - 'icon' => 'ai', - ], + $wsNav = $workspace ? [ + ['label' => 'Dashboard', 'route' => 'w.dashboard', 'params' => [$wsUlid], 'match' => 'w.dashboard', 'icon' => 'dashboard', 'exact' => true], + ['label' => 'Links', 'route' => 'w.links.index', 'params' => [$wsUlid], 'match' => 'w.links.*', 'icon' => 'links'], + ['label' => 'QR Codes', 'route' => 'w.qr.index', 'params' => [$wsUlid], 'match' => 'w.qr.*', 'icon' => 'qr'], + ['label' => 'Link-in-Bio','route' => 'w.bio.index', 'params' => [$wsUlid], 'match' => 'w.bio.*', 'icon' => 'bio'], + ['label' => 'Analytics', 'route' => 'w.analytics.index','params' => [$wsUlid], 'match' => 'w.analytics.*', 'icon' => 'analytics'], + ['label' => 'Domains', 'route' => 'w.domains.index', 'params' => [$wsUlid], 'match' => 'w.domains.*', 'icon' => 'domains'], ] : [ - [ - 'label' => 'Dashboard', - 'route' => 'dashboard', - 'params' => [], - 'match' => 'dashboard', - 'icon' => 'dashboard', - ], + ['label' => 'Dashboard', 'route' => 'dashboard', 'params' => [], 'match' => 'dashboard', 'icon' => 'dashboard', 'exact' => true], ]; - // Plan usage - $plan = $workspace?->plan; + $accountNav = $workspace ? [ + ['label' => 'Settings', 'route' => 'w.settings.index', 'params' => [$wsUlid], 'match' => 'w.settings.*', 'icon' => 'settings'], + ['label' => 'Billing', 'route' => 'w.billing.index', 'params' => [$wsUlid], 'match' => 'w.billing.*', 'icon' => 'billing'], + ['label' => 'Team', 'route' => 'w.team.index', 'params' => [$wsUlid], 'match' => 'w.team.*', 'icon' => 'team'], + ['label' => 'AI', 'route' => 'w.ai.insights', 'params' => [$wsUlid], 'match' => 'w.ai.*', 'icon' => 'ai'], + ] : []; + + $plan = $workspace?->plan; $linksUsed = $workspace ? $workspace->links()->count() : 0; $linkLimit = $plan?->link_limit ?? 50; - $usagePct = $linkLimit > 0 ? min(100, round(($linksUsed / $linkLimit) * 100)) : 0; + $usagePct = $linkLimit > 0 ? min(100, round(($linksUsed / $linkLimit) * 100)) : 0; - // User initials $userName = auth()->user()?->name ?? ''; $initials = collect(explode(' ', trim($userName)))->map(fn($w) => strtoupper(substr($w, 0, 1)))->take(2)->implode(''); @endphp diff --git a/resources/views/layouts/nimuli-app.blade.php b/resources/views/layouts/nimuli-app.blade.php index 6db1fd5..eec2bd3 100644 --- a/resources/views/layouts/nimuli-app.blade.php +++ b/resources/views/layouts/nimuli-app.blade.php @@ -14,6 +14,9 @@ + + +