[ticket 640] added nickname to note (#687)

* [ticket 640] added nickname to note

* [640] added check for empty value
This commit is contained in:
AleksPlekhov
2026-06-25 22:06:05 +02:00
committed by GitHub
parent 34a6f37041
commit 37a20ebf34
@@ -202,6 +202,7 @@ fun LocationNotesSheet(
onDraftChange = { draft = it }, onDraftChange = { draft = it },
sendButtonEnabled = sendButtonEnabled, sendButtonEnabled = sendButtonEnabled,
accentGreen = accentGreen, accentGreen = accentGreen,
nickname = nickname,
onSend = { onSend = {
val content = draft.trim() val content = draft.trim()
if (content.isNotEmpty()) { if (content.isNotEmpty()) {
@@ -451,18 +452,37 @@ private fun LocationNotesInputSection(
onDraftChange: (String) -> Unit, onDraftChange: (String) -> Unit,
sendButtonEnabled: Boolean, sendButtonEnabled: Boolean,
accentGreen: Color, accentGreen: Color,
nickname: String?,
onSend: () -> Unit onSend: () -> Unit
) { ) {
val isDark = isSystemInDarkTheme() val isDark = isSystemInDarkTheme()
val colorScheme = MaterialTheme.colorScheme val colorScheme = MaterialTheme.colorScheme
Row( Column(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.background(color = colorScheme.background) .background(color = colorScheme.background)
.padding(horizontal = 12.dp, vertical = 8.dp), // Match main chat padding .padding(horizontal = 12.dp, vertical = 8.dp)
) {
if (!nickname.isNullOrBlank()) {
val baseName = nickname.split("#", limit = 2).firstOrNull() ?: nickname
Row(verticalAlignment = Alignment.CenterVertically) {
Text(
text = "@$baseName",
fontFamily = FontFamily.Monospace,
fontSize = 12.sp,
fontWeight = FontWeight.SemiBold,
color = colorScheme.onSurface
)
Spacer(modifier = Modifier.width(4.dp))
}
Spacer(modifier = Modifier.height(4.dp))
}
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp) // Match main chat spacing horizontalArrangement = Arrangement.spacedBy(8.dp)
) { ) {
// Text input with placeholder overlay (matches main chat exactly) // Text input with placeholder overlay (matches main chat exactly)
Box( Box(
@@ -533,6 +553,7 @@ private fun LocationNotesInputSection(
} }
} }
} }
}
/** /**
* Timestamp text - matches iOS timestampText exactly * Timestamp text - matches iOS timestampText exactly