Files
SealShare/resources/views/partials/toolbar.blade.php
T
Andreas Reinhold / reiniandClaude Opus 5 accbc17c1c Move the navigation into a floating toolbar at the bottom
The top app bar repeated the site's name, which already heads the upload
and download pages, and spread its actions to the window's far edge. A
floating toolbar centred above the bottom edge, as wide as its buttons,
now holds them: Upload and the admin pages with the current one filled,
and the account menu; guests get Upload, the theme toggle and Log in,
without tooltips. On a phone the sign-in card no longer stretches to the
full height, and the admin dashboard's empty state sits outside the
scrolling table.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy
2026-09-13 11:12:12 +02:00

45 lines
2.5 KiB
PHP

{{-- The one navigation on every page: a floating toolbar centred above the bottom edge, as wide as
its buttons. The site's name and logo head the upload and download pages instead of a bar.
A signed-in user gets the pages they can reach and the account menu; everyone else gets the
upload page, the theme toggle and a way to sign in — without tooltips, so the download page
stays free of anchored components. The current page's button is filled. --}}
@php
$onUpload = request()->routeIs('upload', 'share.created');
$onDashboard = request()->routeIs('admin.dashboard');
$onAdminSettings = request()->routeIs('admin.settings');
@endphp
<nav aria-label="{{ __('Main') }}">
<x-toolbar :label="__('Main')" place="bottom" data-test="app-toolbar">
@auth
<x-button icon="upload" :tooltip="__('Upload')" :link="route('upload')" :variant="$onUpload ? 'filled' : 'text'" :aria-current="$onUpload ? 'page' : null" />
@if (auth()->user()->is_admin)
<x-button icon="dashboard" :tooltip="__('Admin dashboard')" :link="route('admin.dashboard')" :variant="$onDashboard ? 'filled' : 'text'" :aria-current="$onDashboard ? 'page' : null" />
<x-button icon="admin_panel_settings" :tooltip="__('Admin settings')" :link="route('admin.settings')" :variant="$onAdminSettings ? 'filled' : 'text'" :aria-current="$onAdminSettings ? 'page' : null" />
@endif
<span class="ms-1 inline-flex">
<x-account-menu :name="auth()->user()->name" :email="auth()->user()->email" position="top-end">
<x-menu-item :label="__('Settings')" icon="settings" :link="route('profile.edit')" />
<x-slot:footer>
<form method="POST" action="{{ route('logout') }}">
@csrf
<x-menu-item :label="__('Log out')" icon="logout" type="submit" data-test="logout-button" />
</form>
</x-slot:footer>
</x-account-menu>
</span>
@else
<x-button icon="upload" :aria-label="__('Upload')" :link="route('upload')" :variant="$onUpload ? 'filled' : 'text'" :aria-current="$onUpload ? 'page' : null" />
<x-theme-toggle />
@if (Route::has('login') && ! request()->routeIs('login'))
<x-button :label="__('Log in')" :link="route('login')" />
@endif
@endauth
</x-toolbar>
</nav>