feat: screener for message requests (#24)

Reviewed-on: https://git.reya.su/reya/coop-mobile/pulls/24
This commit is contained in:
2026-06-19 09:06:49 +00:00
parent 91e4e3b43d
commit 154906017e
13 changed files with 414 additions and 86 deletions
@@ -100,8 +100,8 @@ import su.reya.coop.RoomKind
import su.reya.coop.Screen
import su.reya.coop.ago
import su.reya.coop.shared.Avatar
import su.reya.coop.shared.displayNameFlow
import su.reya.coop.shared.getExpressiveFontFamily
import su.reya.coop.shared.nameFlow
import su.reya.coop.shared.pictureFlow
import su.reya.coop.short
@@ -627,11 +627,11 @@ fun NewRequests(requests: List<Room>) {
val secondRoom = requests.getOrNull(1)
val firstName by remember(firstRoom) {
firstRoom?.displayNameFlow(viewModel) ?: flowOf("")
firstRoom?.nameFlow(viewModel) ?: flowOf("")
}.collectAsStateWithLifecycle("Loading...")
val secondName by remember(secondRoom) {
secondRoom?.displayNameFlow(viewModel) ?: flowOf("")
secondRoom?.nameFlow(viewModel) ?: flowOf("")
}.collectAsStateWithLifecycle("")
val supportingText = when {
@@ -704,8 +704,8 @@ fun NewRequests(requests: List<Room>) {
@Composable
fun ChatRoom(room: Room, onClick: () -> Unit) {
val viewModel = LocalNostrViewModel.current
val displayName by remember(room) { room.displayNameFlow(viewModel) }.collectAsState("Loading...")
val picture by remember(room) { room.pictureFlow(viewModel) }.collectAsState(null)
val displayName by remember(room) { room.nameFlow(viewModel) }.collectAsStateWithLifecycle("Loading...")
val picture by remember(room) { room.pictureFlow(viewModel) }.collectAsStateWithLifecycle(null)
ListItem(
modifier = Modifier.clickable(onClick = onClick),
@@ -734,7 +734,8 @@ fun ChatRoom(room: Room, onClick: () -> Unit) {
Text(
text = room.lastMessage!!,
style = MaterialTheme.typography.bodyMedium,
overflow = TextOverflow.Ellipsis
overflow = TextOverflow.Ellipsis,
maxLines = 1,
)
}
},