kullanıcı avatar denemesi.

This commit is contained in:
2026-07-28 06:18:48 +02:00
parent f34f8ea764
commit 1592bb02c2
+4 -4
View File
@@ -16,9 +16,9 @@ async function render() {
return; return;
} }
// Avatar resminin tam URL'ini oluşturuyoruz // PocketBase tam avatar URL formatı
const avatarUrl = user?.avatar const avatarUrl = user?.avatar
? `https://pocketbase.iontalp.com/api/files/${user.collectionId}/${user.id}/${user.avatar}` ? `https://pocketbase.iontalp.com/api/files/_pb_users_auth_/${user.id}/${user.avatar}?thumb=100x100`
: null; : null;
let currentBg = let currentBg =
@@ -59,12 +59,12 @@ async function render() {
<div id="profileBtn" class="flex items-center gap-3 p-2 rounded-xl hover:bg-white/5 cursor-pointer transition-all"> <div id="profileBtn" class="flex items-center gap-3 p-2 rounded-xl hover:bg-white/5 cursor-pointer transition-all">
${ ${
avatarUrl avatarUrl
? `<img src="${avatarUrl}" alt="Avatar" class="w-10 h-10 rounded-full object-cover border border-white/20" />` ? `<img src="${avatarUrl}" alt="Avatar" class="w-10 h-10 rounded-full object-cover border border-white/20 shadow-md" />`
: `<div class="w-10 h-10 rounded-full bg-indigo-600/30 border border-indigo-500/30 flex items-center justify-center font-bold text-indigo-400">${(user.username || user.email).charAt(0).toUpperCase()}</div>` : `<div class="w-10 h-10 rounded-full bg-indigo-600/30 border border-indigo-500/30 flex items-center justify-center font-bold text-indigo-400">${(user.username || user.email).charAt(0).toUpperCase()}</div>`
} }
<div class="overflow-hidden"> <div class="overflow-hidden">
<p class="text-sm font-medium text-white truncate">${user.username || user.email}</p> <p class="text-sm font-medium text-white truncate">${user.username || user.email}</p>
<p class="text-xs text-slate-400">Profili Gör</p> <p class="text-xs text-slate-400">Çevrimiçi</p>
</div> </div>
</div> </div>