Files
SkinbaseNova/resources/views/web/home/sections/welcome-row.blade.php

47 lines
2.5 KiB
PHP

@php
$userData = is_array($userData ?? null) ? $userData : null;
$avatarFallback = 'https://files.skinbase.org/default/avatar_default.webp';
$firstName = trim((string) Str::of((string) ($userData['name'] ?? 'there'))->before(' '));
@endphp
@if ($userData)
<section class="border-b border-white/5 bg-nova-900/60 backdrop-blur-sm">
<div class="mx-auto max-w-7xl px-4 py-4 sm:px-6 lg:px-8">
<div class="flex flex-wrap items-center justify-between gap-3">
<div class="flex items-center gap-3">
<a href="{{ $userData['url'] ?? '/profile' }}">
<img
src="{{ $userData['avatar'] ?? $avatarFallback }}"
alt="{{ $userData['name'] ?? 'Member' }}"
class="h-9 w-9 rounded-full object-cover ring-2 ring-white/10 transition hover:ring-accent/60"
loading="lazy"
decoding="async"
>
</a>
<div>
<p class="text-sm text-soft">Welcome back,</p>
<p class="text-sm font-semibold leading-tight text-white">{{ $firstName !== '' ? $firstName : ($userData['name'] ?? 'there') }}</p>
</div>
</div>
<div class="flex items-center gap-2">
@if ((int) ($userData['messages_unread'] ?? 0) > 0)
<a href="/messages" class="inline-flex items-center gap-1.5 rounded-lg bg-nova-800 px-3 py-1.5 text-xs font-medium text-white ring-1 ring-white/10 transition hover:bg-nova-700">
<span>{{ (int) $userData['messages_unread'] }} new</span>
</a>
@endif
@if ((int) ($userData['notifications_unread'] ?? 0) > 0)
<a href="/dashboard/notifications" class="inline-flex items-center gap-1.5 rounded-lg bg-nova-800 px-3 py-1.5 text-xs font-medium text-white ring-1 ring-white/10 transition hover:bg-nova-700">
<span>{{ (int) $userData['notifications_unread'] }}</span>
</a>
@endif
<a href="/upload" class="btn-accent-solid inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-semibold">
Upload
</a>
</div>
</div>
</div>
</section>
@endif