Profile avatar resize crop eklendi. Hatalar fixlendi.

This commit is contained in:
2025-12-04 21:29:20 +03:00
parent 3d67900557
commit bbc245ced1
9 changed files with 880 additions and 11 deletions

View File

@@ -6,6 +6,7 @@
activeSearchTerm,
updateSearchTerm
} from "../stores/searchStore.js";
import { avatarUrlStore } from "../stores/avatarStore.js";
import { clearTokens } from "../utils/api.js";
@@ -15,6 +16,7 @@
export let avatarUrl = null;
let showAvatarMenu = false;
let avatarWrap;
$: resolvedAvatar = avatarUrl || $avatarUrlStore;
const onToggle = () => dispatch("toggleMenu");
@@ -82,8 +84,8 @@
<div class="avatar-wrap" bind:this={avatarWrap}>
<button class="avatar" type="button" aria-label="Profil" on:click={toggleAvatarMenu}>
{#if avatarUrl}
<img src={avatarUrl} alt="Avatar" loading="lazy" />
{#if resolvedAvatar}
<img src={resolvedAvatar} alt="Avatar" loading="lazy" on:error={() => (resolvedAvatar = null)} />
{:else}
<div class="placeholder">
<i class="fa-regular fa-user"></i>