Display the reaction picker as one horizontal row in both clients
This commit is contained in:
1 parent
0f14abd6c8
commit
066fa8552d
2 files changed
+22
-5
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package com.utun.chat.ui.components
|
||||
|
||||
import androidx.compose.foundation.Canvas
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
@@ -157,8 +158,12 @@ fun MessageReactions(message: Message, catalog: List<ReactionState>, onReact: (M
|
||||
}
|
||||
}
|
||||
if (picker) AlertDialog(onDismissRequest = { picker = false }, title = { Text(stringResource(R.string.poll_react)) },
|
||||
text = { FlowRow(horizontalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
for (reaction in catalog) TextButton(onClick = { onReact(message, reaction.id); picker = false }) { Text(reaction.emoji) }
|
||||
text = { Row(Modifier.fillMaxWidth().horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
for (reaction in catalog) IconToggleButton(checked = message.feedback?.reactions.orEmpty().any { it.mine && it.id == reaction.id },
|
||||
onCheckedChange = {
|
||||
LogManager.addLog("DEBUG", "POLL", "reaction chosen message=${message.messageId} emoji=${reaction.id}")
|
||||
onReact(message, reaction.id); picker = false
|
||||
}) { Text(reaction.emoji) }
|
||||
} },
|
||||
confirmButton = { TextButton(onClick = { onReact(message, null); picker = false }) {
|
||||
Text(stringResource(R.string.poll_clear_reactions))
|
||||
|
||||
Reference in new issue
Block a user