Avatar placeholder değişti.

This commit is contained in:
2025-12-04 17:53:46 +03:00
parent 4bb3350229
commit da16481776

View File

@@ -7,13 +7,12 @@
updateSearchTerm updateSearchTerm
} from "../stores/searchStore.js"; } from "../stores/searchStore.js";
import avatarSrc from "../assets/avatar.png";
import { clearTokens } from "../utils/api.js"; import { clearTokens } from "../utils/api.js";
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
export let placeholder = ""; export let placeholder = "";
// Örnek avatar (yerel dosya) // Avatar opsiyonel; yoksa placeholder ikon gösterilir
export let avatarUrl = avatarSrc; export let avatarUrl = null;
let showAvatarMenu = false; let showAvatarMenu = false;
let avatarWrap; let avatarWrap;
@@ -86,7 +85,9 @@
{#if avatarUrl} {#if avatarUrl}
<img src={avatarUrl} alt="Avatar" loading="lazy" /> <img src={avatarUrl} alt="Avatar" loading="lazy" />
{:else} {:else}
<i class="fa-solid fa-user"></i> <div class="placeholder">
<i class="fa-regular fa-user"></i>
</div>
{/if} {/if}
</button> </button>
@@ -157,8 +158,8 @@
} }
.avatar { .avatar {
border: none; border: 0.5px solid var(--border, #dcdcdc);
background: #f2f2f2; background: #f7f8fa;
border-radius: 10px; border-radius: 10px;
width: 42px; width: 42px;
height: 42px; height: 42px;
@@ -177,8 +178,16 @@
border-radius: 10px; border-radius: 10px;
} }
.avatar i { .avatar .placeholder {
color: #666; width: 100%;
height: 100%;
background: #eef1f6;
border: 0.5px solid var(--border, #dcdcdc);
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
color: #2c3e50;
font-size: 18px; font-size: 18px;
} }