diff --git a/resources/views/components/btn/create.blade.php b/resources/views/components/btn/create.blade.php index caa7d06..f51caf4 100644 --- a/resources/views/components/btn/create.blade.php +++ b/resources/views/components/btn/create.blade.php @@ -1,17 +1,33 @@ @props([ 'href' => null, 'type' => 'button', + 'label' => null, ]) @php $tag = $href ? 'a' : 'button'; + $ariaLabel = $label ?? trim(preg_replace('/\s+/', ' ', strip_tags((string) $slot))); @endphp <{{ $tag }} @if ($href) href="{{ $href }}" @endif @if ($tag === 'button') type="{{ $type }}" @endif - {{ $attributes->class(['btn-primary']) }} + aria-label="{{ $ariaLabel }}" + title="{{ $ariaLabel }}" + {{ $attributes->class(['btn-fab h-10 w-10 lg:hidden']) }} > - + + + +<{{ $tag }} + @if ($href) href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + {{ $attributes->class(['btn-primary hidden lg:inline-flex']) }} +> + {{ $slot }} diff --git a/resources/views/components/domain-source-fields.blade.php b/resources/views/components/domain-source-fields.blade.php index 74c11ed..b063c94 100644 --- a/resources/views/components/domain-source-fields.blade.php +++ b/resources/views/components/domain-source-fields.blade.php @@ -8,6 +8,7 @@ ]) @php + $errors = $errors ?? new \Illuminate\Support\ViewErrorBag; $ownedDomainHosts = collect($ownedDomains)->map(fn ($d) => (string) $d)->all(); $oldValue = trim((string) old($fieldName, '')); $initialDomainSource = empty($ownedDomainHosts) diff --git a/resources/views/hosting/dashboard.blade.php b/resources/views/hosting/dashboard.blade.php index 7404d1d..a1f1cd6 100644 --- a/resources/views/hosting/dashboard.blade.php +++ b/resources/views/hosting/dashboard.blade.php @@ -2,14 +2,16 @@ @section('title', 'Overview — Ladill Hosting') @section('content')
-
-
-

Overview

-

Your shared hosting at a glance.

+
+
+

Overview

+
- - New hosting - + @include('partials.mobile-header-btn', [ + 'href' => route('hosting.single-domain'), + 'label' => 'New hosting', + 'variant' => 'primary', + ])
diff --git a/resources/views/hosting/panel/domains.blade.php b/resources/views/hosting/panel/domains.blade.php index dd85bd3..c6bdff0 100644 --- a/resources/views/hosting/panel/domains.blade.php +++ b/resources/views/hosting/panel/domains.blade.php @@ -16,6 +16,7 @@ @endif @php + $errors = $errors ?? new \Illuminate\Support\ViewErrorBag; $ownedDomainHosts = collect($ownedDomains)->map(fn ($d) => (string) $d)->all(); $oldDomain = trim((string) old('domain', '')); $initialDomainSource = empty($ownedDomainHosts) diff --git a/resources/views/hosting/panel/partials/sidebar.blade.php b/resources/views/hosting/panel/partials/sidebar.blade.php index 11de584..df504af 100644 --- a/resources/views/hosting/panel/partials/sidebar.blade.php +++ b/resources/views/hosting/panel/partials/sidebar.blade.php @@ -1,5 +1,5 @@ @php - $currentRoute = request()->route()->getName(); + $currentRoute = request()->route()?->getName() ?? ''; $panelRuntime = app(\App\Services\Hosting\PanelRuntimeResolver::class)->forSubject($account); $currentUser = auth()->user(); @@ -222,7 +222,7 @@ - {{ $account->node->hostname ?? $account->node->ip_address ?? 'Server' }} + {{ $account->node?->hostname ?? $account->node?->ip_address ?? 'Server' }}
diff --git a/resources/views/partials/mobile-header-btn.blade.php b/resources/views/partials/mobile-header-btn.blade.php new file mode 100644 index 0000000..97d79c4 --- /dev/null +++ b/resources/views/partials/mobile-header-btn.blade.php @@ -0,0 +1,53 @@ +@php + $variant = $variant ?? 'primary'; + $type = $type ?? 'submit'; + $tag = ! empty($href) ? 'a' : 'button'; + $ariaLabel = $ariaLabel ?? $label ?? ''; + $desktopLabel = $desktopLabel ?? $label ?? ''; + $showDesktopIcon = $showDesktopIcon ?? ($variant === 'primary'); + + $mobileClass = match ($variant) { + 'primary' => 'btn-fab h-10 w-10 lg:hidden', + 'outline' => 'inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-700 shadow-sm transition hover:border-slate-300 hover:bg-slate-50 lg:hidden', + 'dark' => 'inline-flex h-10 w-10 items-center justify-center rounded-full bg-gray-900 text-white shadow-sm transition hover:bg-gray-800 lg:hidden', + 'indigo' => 'inline-flex h-10 w-10 items-center justify-center rounded-full bg-indigo-600 text-white shadow-sm transition hover:bg-indigo-700 lg:hidden', + default => 'btn-fab h-10 w-10 lg:hidden', + }; + + $desktopClass = match ($variant) { + 'primary' => 'btn-primary hidden items-center lg:inline-flex', + 'outline' => 'hidden items-center rounded-lg border border-gray-200 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 lg:inline-flex', + 'dark' => 'hidden items-center gap-1.5 rounded-lg bg-gray-900 px-3.5 py-2 text-sm font-medium text-white transition hover:bg-gray-800 lg:inline-flex', + 'indigo' => 'hidden items-center justify-center rounded-xl bg-indigo-600 px-4 py-2.5 text-sm font-semibold text-white transition hover:bg-indigo-700 lg:inline-flex', + default => 'btn-primary hidden items-center lg:inline-flex', + }; + + $extraClass = $class ?? ''; +@endphp + +<{{ $tag }} + @if ($tag === 'a') href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + aria-label="{{ $ariaLabel }}" + title="{{ $ariaLabel }}" + @if (! empty($attributes)) {!! $attributes !!} @endif + class="{{ trim($mobileClass.' '.$extraClass) }}" +> + + + +<{{ $tag }} + @if ($tag === 'a') href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + @if (! empty($attributes)) {!! $attributes !!} @endif + class="{{ trim($desktopClass.' '.$extraClass) }}" +> + @if ($showDesktopIcon) + + @endif + {{ $desktopLabel }} + diff --git a/resources/views/partials/mobile-icon-link.blade.php b/resources/views/partials/mobile-icon-link.blade.php new file mode 100644 index 0000000..b1a96c4 --- /dev/null +++ b/resources/views/partials/mobile-icon-link.blade.php @@ -0,0 +1,27 @@ +@php + $icon = $icon ?? 'arrow'; + $desktopClass = $desktopClass ?? 'text-xs font-medium text-indigo-600 hover:text-indigo-700'; + $label = $label ?? ''; +@endphp + + + + @if ($icon === 'shield') + + @elseif ($icon === 'calendar') + + @else + + @endif + + +