mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 18:25:19 +00:00
Remove nickname label from chat input box
- Remove <@nickname> label to simplify UI - Add placeholder text "type a message..." for clarity - Maintain consistent padding for input field
This commit is contained in:
@@ -377,27 +377,12 @@ struct ContentView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HStack(alignment: .center, spacing: 4) {
|
HStack(alignment: .center, spacing: 4) {
|
||||||
if viewModel.selectedPrivateChatPeer != nil {
|
TextField("type a message...", text: $messageText)
|
||||||
Text("<@\(viewModel.nickname)> →")
|
|
||||||
.font(.system(size: 12, weight: .medium, design: .monospaced))
|
|
||||||
.foregroundColor(Color.orange)
|
|
||||||
.lineLimit(1)
|
|
||||||
.fixedSize()
|
|
||||||
.padding(.leading, 12)
|
|
||||||
} else {
|
|
||||||
Text("<@\(viewModel.nickname)>")
|
|
||||||
.font(.system(size: 12, weight: .medium, design: .monospaced))
|
|
||||||
.foregroundColor(textColor)
|
|
||||||
.lineLimit(1)
|
|
||||||
.fixedSize()
|
|
||||||
.padding(.leading, 12)
|
|
||||||
}
|
|
||||||
|
|
||||||
TextField("", text: $messageText)
|
|
||||||
.textFieldStyle(.plain)
|
.textFieldStyle(.plain)
|
||||||
.font(.system(size: 14, design: .monospaced))
|
.font(.system(size: 14, design: .monospaced))
|
||||||
.foregroundColor(textColor)
|
.foregroundColor(textColor)
|
||||||
.focused($isTextFieldFocused)
|
.focused($isTextFieldFocused)
|
||||||
|
.padding(.leading, 12)
|
||||||
.onChange(of: messageText) { newValue in
|
.onChange(of: messageText) { newValue in
|
||||||
// Get cursor position (approximate - end of text for now)
|
// Get cursor position (approximate - end of text for now)
|
||||||
let cursorPosition = newValue.count
|
let cursorPosition = newValue.count
|
||||||
|
|||||||
Reference in New Issue
Block a user