diff --git a/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift b/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift index c5f16f17..1ad23421 100644 --- a/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift +++ b/Packages/AppAccount/Sources/AppAccount/AppAccountsSelectorView.swift @@ -46,6 +46,7 @@ public struct AppAccountsSelectorView: View { HapticManager.shared.fireHaptic(.buttonPress) } label: { labelView + .contentShape(Rectangle()) } .sheet(isPresented: $isPresented, content: { accountsView.presentationDetents([.height(preferredHeight), .large]) @@ -73,9 +74,10 @@ public struct AppAccountsSelectorView: View { Group { if let account = currentAccount.account, !currentAccount.isLoadingAccount { AvatarView(account: account, config: avatarConfig) - .padding(.leading, 16) } else { - ProgressView() + AvatarView(account: nil, config: avatarConfig) + .redacted(reason: .placeholder) + .allowsHitTesting(false) } }.overlay(alignment: .topTrailing) { if !currentAccount.followRequests.isEmpty || showNotificationBadge, accountCreationEnabled { diff --git a/Packages/DesignSystem/Sources/DesignSystem/Views/AvatarView.swift b/Packages/DesignSystem/Sources/DesignSystem/Views/AvatarView.swift index 454dfc5f..bb508f88 100644 --- a/Packages/DesignSystem/Sources/DesignSystem/Views/AvatarView.swift +++ b/Packages/DesignSystem/Sources/DesignSystem/Views/AvatarView.swift @@ -20,6 +20,7 @@ public struct AvatarView: View { if let account = account { if hasPopup { AvatarImage(account: account, config: adaptiveConfig) + .frame(width: config.width, height: config.height) .onHover { hovering in if hovering { toggleTask.cancel() @@ -48,6 +49,7 @@ public struct AvatarView: View { } } else { AvatarImage(account: account, config: adaptiveConfig) + .frame(width: config.width, height: config.height) } } else { AvatarPlaceHolder(config: adaptiveConfig) @@ -155,8 +157,9 @@ struct AvatarImage: View { LazyImage(request: ImageRequest(url: account.avatar, processors: [.resize(size: config.size)]) ) { state in if let image = state.image { - image.resizable().scaledToFill() - .frame(width: config.width, height: config.height) + image + .resizable() + .scaledToFit() .clipShape(RoundedRectangle(cornerRadius: config.cornerRadius)) .overlay( RoundedRectangle(cornerRadius: config.cornerRadius)