Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Flipcash/Core/Screens/Conversation/ConversationBottomBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ struct ConversationComposer: View {

var body: some View {
let field = HStack(alignment: .bottom, spacing: 10) {
TextField("Message", text: $composer.draft, axis: .vertical)
TextField(fieldPrompt, text: $composer.draft, axis: .vertical)
.font(.appTextMessage)
.foregroundStyle(Color.textMain)
.tint(.white)
Expand Down Expand Up @@ -323,6 +323,15 @@ struct ConversationComposer: View {
}
}

/// The hint names what the field will send. An edit arrives with the existing text already in
/// the field, so its hint is never on screen and stays the new-message one.
private var fieldPrompt: String {
switch composer.mode {
case .new, .editing: "Message"
case .replying: "Reply"
}
}

/// The confirm button is up for the whole of an edit, as it is in WhatsApp, and only once
/// there's text to send otherwise.
private var showsSubmit: Bool { composer.isEditing || composer.canSubmit }
Expand Down
Loading