wip
This commit is contained in:
parent
d0cbe63eb1
commit
db66442393
|
@ -27,7 +27,9 @@ struct ConversationScreen: View {
|
|||
router.dismissScreen()
|
||||
}
|
||||
),
|
||||
centerText: .init(text: L10n.Conversation.title)
|
||||
centerText: .init(text: centerText(), action: {
|
||||
print("Center text tapped")
|
||||
})
|
||||
)
|
||||
|
||||
// Msg list
|
||||
|
@ -106,4 +108,13 @@ struct ConversationScreen: View {
|
|||
.environmentObject(attachments)
|
||||
}
|
||||
}
|
||||
|
||||
private func centerText() -> String {
|
||||
let name = messagesStore.roster.name ?? JID(messagesStore.roster.contactBareJid).localPart
|
||||
if let name = name {
|
||||
return name
|
||||
} else {
|
||||
return L10n.Conversation.title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,23 @@ struct SharedNavBarButton: View {
|
|||
|
||||
struct SharedNavBarText: View {
|
||||
let text: String
|
||||
let action: (() -> Void)?
|
||||
|
||||
init(
|
||||
text: String,
|
||||
action: (() -> Void)? = nil
|
||||
) {
|
||||
self.text = text
|
||||
self.action = action
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Text(text)
|
||||
.font(.head2)
|
||||
.foregroundColor(.Material.Text.main)
|
||||
.tappablePadding(.init(top: 8, leading: 24, bottom: 8, trailing: 24)) {
|
||||
action?()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue