another.im-ios/ConversationsClassic/View/Screens/Conversation/ConversationHeader.swift

34 lines
984 B
Swift
Raw Normal View History

2024-06-27 11:39:41 +00:00
import SwiftUI
struct ConversationHeader: View {
@EnvironmentObject var store: AppStore
var body: some View {
ZStack {
// bg
2024-07-04 08:21:12 +00:00
Color.Material.Background.dark
2024-06-27 11:39:41 +00:00
.ignoresSafeArea()
// title
let name = (
store.state.conversationsState.currentRoster?.name ??
store.state.conversationsState.currentRoster?.contactBareJid
) ?? L10n.Chat.title
Text(name)
.font(.head2)
2024-07-04 08:21:12 +00:00
.foregroundColor(.Material.Text.main)
2024-06-27 11:39:41 +00:00
HStack {
Image(systemName: "chevron.left")
2024-07-04 08:21:12 +00:00
.foregroundColor(.Material.Elements.active)
2024-06-27 11:39:41 +00:00
.tappablePadding(.symmetric(12)) {
store.dispatch(.changeFlow(store.state.previousFlow))
}
Spacer()
}
.padding(.horizontal, 16)
}
.frame(height: 44)
}
}