From d3adac8accf799b8dea90f53fe1e7c935408fbdd Mon Sep 17 00:00:00 2001 From: Zias van Nes Date: Tue, 4 Nov 2025 12:23:08 +0100 Subject: [PATCH] add:ProfilePicture component and replace Avatar Move avatar initials, fallback styling, and loading/loading-state UI into ProfilePicture and update components to use it. Export ProfilePicture from the lib index. --- src/lib/components/FindCard.svelte | 19 ++---- src/lib/components/FindPreview.svelte | 15 ++--- src/lib/components/ProfilePanel.svelte | 27 +-------- src/lib/components/ProfilePicture.svelte | 59 +++++++++++++++++++ src/lib/components/ProfilePictureSheet.svelte | 22 +------ src/lib/index.ts | 1 + src/routes/friends/+page.svelte | 44 ++++++-------- 7 files changed, 93 insertions(+), 94 deletions(-) create mode 100644 src/lib/components/ProfilePicture.svelte diff --git a/src/lib/components/FindCard.svelte b/src/lib/components/FindCard.svelte index cb1fc3f..54793af 100644 --- a/src/lib/components/FindCard.svelte +++ b/src/lib/components/FindCard.svelte @@ -3,7 +3,7 @@ import { Badge } from '$lib/components/badge'; import LikeButton from '$lib/components/LikeButton.svelte'; import VideoPlayer from '$lib/components/VideoPlayer.svelte'; - import { Avatar, AvatarFallback, AvatarImage } from '$lib/components/avatar'; + import ProfilePicture from '$lib/components/ProfilePicture.svelte'; import { MoreHorizontal, MessageCircle, Share } from '@lucide/svelte'; interface FindCardProps { @@ -42,24 +42,17 @@ function handleExplore() { onExplore?.(id); } - - function getUserInitials(username: string): string { - return username.slice(0, 2).toUpperCase(); - }