36 lines
930 B
Swift
36 lines
930 B
Swift
|
//
|
||
|
// CurrentAccountView.swift
|
||
|
// ComposeUI
|
||
|
//
|
||
|
// Created by Shadowfacts on 3/4/23.
|
||
|
//
|
||
|
|
||
|
import SwiftUI
|
||
|
import Pachyderm
|
||
|
|
||
|
struct CurrentAccountView: View {
|
||
|
let account: (any AccountProtocol)?
|
||
|
@EnvironmentObject private var controller: ComposeController
|
||
|
|
||
|
var body: some View {
|
||
|
HStack(alignment: .top) {
|
||
|
AvatarImageView(url: account?.avatar, size: 50)
|
||
|
.accessibilityHidden(true)
|
||
|
|
||
|
if let account {
|
||
|
VStack(alignment: .leading) {
|
||
|
controller.displayNameLabel(account, .title2, 24)
|
||
|
.lineLimit(1)
|
||
|
|
||
|
Text(verbatim: "@\(account.acct)")
|
||
|
.font(.body.weight(.light))
|
||
|
.foregroundColor(.secondary)
|
||
|
.lineLimit(1)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Spacer()
|
||
|
}
|
||
|
}
|
||
|
}
|