Profile banner displays

This commit is contained in:
Lumaa 2024-02-24 13:20:16 +01:00
parent 94c7f850de
commit 75483985ab
1 changed files with 19 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import SwiftUI
struct ProfileView: View { struct ProfileView: View {
@Environment(AccountManager.self) private var accountManager: AccountManager @Environment(AccountManager.self) private var accountManager: AccountManager
@Environment(UniversalNavigator.self) private var uniNav: UniversalNavigator @Environment(UniversalNavigator.self) private var uniNav: UniversalNavigator
@Environment(AppDelegate.self) private var appDelegate: AppDelegate
@EnvironmentObject private var navigator: Navigator @EnvironmentObject private var navigator: Navigator
@Namespace var accountAnims @Namespace var accountAnims
@ -91,6 +92,24 @@ struct ProfileView: View {
ScrollView { ScrollView {
VStack { VStack {
VStack (alignment: .leading) { VStack (alignment: .leading) {
if account.haveHeader {
AsyncImage(url: account.header, scale: 1.0) { image in
image
.resizable()
.scaledToFill()
.frame(height: appDelegate.windowHeight / 5)
.clipped()
.clipShape(RoundedRectangle(cornerRadius: 15.0))
.padding(.bottom)
} placeholder: {
EmptyView()
}
.onTapGesture {
let attachment: MediaAttachment = .init(id: account.id, type: "image", url: account.header)
navigator.presentedCover = .media(attachments: [attachment], selected: attachment)
}
}
unbig unbig
Text(account.note.asRawText) Text(account.note.asRawText)