mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 04:45:21 +00:00
[ticket 640] added nickname to note (#687)
* [ticket 640] added nickname to note * [640] added check for empty value
This commit is contained in:
@@ -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,19 +452,38 @@ 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)
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp) // Match main chat spacing
|
|
||||||
) {
|
) {
|
||||||
|
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,
|
||||||
|
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(
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
@@ -532,6 +552,7 @@ private fun LocationNotesInputSection(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user