mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-16 17:55:13 +00:00
Fix to account selector on iOS
This commit is contained in:
parent
47d54fd9e6
commit
b3153289c4
2 changed files with 9 additions and 4 deletions
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue