mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 07:02:57 +02:00
Adjusting the message screen to correctly display the time aligned to the right.
This commit is contained in:
@@ -54,18 +54,19 @@ fun ChatroomCompose(baseNote: Note, accountViewModel: AccountViewModel, navContr
|
|||||||
} else {
|
} else {
|
||||||
note.event?.content
|
note.event?.content
|
||||||
}
|
}
|
||||||
channel?.let {
|
channel?.let { channel ->
|
||||||
ChannelName(
|
ChannelName(
|
||||||
channelPicture = it.profilePicture(),
|
channelPicture = channel.profilePicture(),
|
||||||
channelTitle = {
|
channelTitle = {
|
||||||
Text(
|
Text(
|
||||||
"${it.info.name}",
|
"${channel.info.name}",
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold,
|
||||||
|
modifier = it
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
channelLastTime = note.event?.createdAt,
|
channelLastTime = note.event?.createdAt,
|
||||||
channelLastContent = "${author?.toBestDisplayName()}: " + description,
|
channelLastContent = "${author?.toBestDisplayName()}: " + description,
|
||||||
onClick = { navController.navigate("Channel/${it.idHex}") })
|
onClick = { navController.navigate("Channel/${channel.idHex}") })
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -85,13 +86,13 @@ fun ChatroomCompose(baseNote: Note, accountViewModel: AccountViewModel, navContr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
userToComposeOn?.let {
|
userToComposeOn?.let { user ->
|
||||||
ChannelName(
|
ChannelName(
|
||||||
channelPicture = it.profilePicture(),
|
channelPicture = user.profilePicture(),
|
||||||
channelTitle = { UsernameDisplay(it) },
|
channelTitle = { UsernameDisplay(user, it) },
|
||||||
channelLastTime = note.event?.createdAt,
|
channelLastTime = note.event?.createdAt,
|
||||||
channelLastContent = accountViewModel.decrypt(note),
|
channelLastContent = accountViewModel.decrypt(note),
|
||||||
onClick = { navController.navigate("Room/${it.pubkeyHex}") })
|
onClick = { navController.navigate("Room/${user.pubkeyHex}") })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +101,7 @@ fun ChatroomCompose(baseNote: Note, accountViewModel: AccountViewModel, navContr
|
|||||||
@Composable
|
@Composable
|
||||||
fun ChannelName(
|
fun ChannelName(
|
||||||
channelPicture: String,
|
channelPicture: String,
|
||||||
channelTitle: @Composable () -> Unit,
|
channelTitle: @Composable (Modifier) -> Unit,
|
||||||
channelLastTime: Long?,
|
channelLastTime: Long?,
|
||||||
channelLastContent: String?,
|
channelLastContent: String?,
|
||||||
onClick: () -> Unit
|
onClick: () -> Unit
|
||||||
@@ -125,7 +126,7 @@ fun ChannelName(
|
|||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.padding(bottom = 4.dp)
|
modifier = Modifier.padding(bottom = 4.dp)
|
||||||
) {
|
) {
|
||||||
channelTitle()
|
channelTitle(Modifier.weight(1f))
|
||||||
|
|
||||||
channelLastTime?.let {
|
channelLastTime?.let {
|
||||||
Text(
|
Text(
|
||||||
|
@@ -15,7 +15,7 @@ fun timeAgo(mills: Long?): String {
|
|||||||
humanReadable = "now";
|
humanReadable = "now";
|
||||||
}
|
}
|
||||||
|
|
||||||
return " • " + humanReadable
|
return humanReadable
|
||||||
.replace(" hr. ago", "h")
|
.replace(" hr. ago", "h")
|
||||||
.replace(" min. ago", "m")
|
.replace(" min. ago", "m")
|
||||||
.replace(" days ago", "d")
|
.replace(" days ago", "d")
|
||||||
|
Reference in New Issue
Block a user