multiplatform: show admin and owner roles in the conversation (#4455)

This commit is contained in:
spaced4ndy
2024-07-15 11:35:48 +04:00
committed by GitHub
parent 99888f9d5f
commit 5a014ba410

View File

@@ -1025,10 +1025,21 @@ fun BoxWithConstraintsScope.ChatItemsList(
horizontalAlignment = Alignment.Start
) {
if (cItem.content.showMemberName) {
val memberNameStyle = SpanStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary)
val memberNameString = if (memCount == 1 && member.memberRole > GroupMemberRole.Member) {
buildAnnotatedString {
withStyle(memberNameStyle.copy(fontWeight = FontWeight.Medium)) { append(member.memberRole.text) }
append(" ")
withStyle(memberNameStyle) { append(memberNames(member, prevMember, memCount)) }
}
} else {
buildAnnotatedString {
withStyle(memberNameStyle) { append(memberNames(member, prevMember, memCount)) }
}
}
Text(
memberNames(member, prevMember, memCount),
memberNameString,
Modifier.padding(start = MEMBER_IMAGE_SIZE + 10.dp),
style = TextStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary),
maxLines = 2
)
}