34 lines
975 B
Swift
34 lines
975 B
Swift
|
import SwiftUI
|
||
|
|
||
|
struct ConversationHeader: View {
|
||
|
@EnvironmentObject var store: AppStore
|
||
|
|
||
|
var body: some View {
|
||
|
ZStack {
|
||
|
// bg
|
||
|
Color.Main.backgroundDark
|
||
|
.ignoresSafeArea()
|
||
|
|
||
|
// title
|
||
|
let name = (
|
||
|
store.state.conversationsState.currentRoster?.name ??
|
||
|
store.state.conversationsState.currentRoster?.contactBareJid
|
||
|
) ?? L10n.Chat.title
|
||
|
Text(name)
|
||
|
.font(.head2)
|
||
|
.foregroundColor(Color.Main.black)
|
||
|
|
||
|
HStack {
|
||
|
Image(systemName: "chevron.left")
|
||
|
.foregroundColor(Color.Tango.orangeMedium)
|
||
|
.tappablePadding(.symmetric(12)) {
|
||
|
store.dispatch(.changeFlow(store.state.previousFlow))
|
||
|
}
|
||
|
Spacer()
|
||
|
}
|
||
|
.padding(.horizontal, 16)
|
||
|
}
|
||
|
.frame(height: 44)
|
||
|
}
|
||
|
}
|