chore: reflow UserProfile code for pedantic reasons

This commit is contained in:
Harsh Shandilya 2024-05-09 17:54:01 +05:30
parent bdca0799db
commit 3b044a8d23

View file

@ -110,8 +110,7 @@ private fun UserProfileInternal(
Text(text = user.username, style = MaterialTheme.typography.displaySmall)
ThemedRichText(text = user.about)
user.invitedBy?.let { invitedBy ->
val text = buildAnnotatedString {
val style =
val linkTextStyle =
with(LocalTextStyle.current) {
SpanStyle(
LocalContentColor.current,
@ -130,11 +129,14 @@ private fun UserProfileInternal(
shadow,
)
}
withStyle(style = style) { append("Invited by ") }
val text = buildAnnotatedString {
withStyle(linkTextStyle) { append("Invited by ") }
pushStringAnnotation(tag = "URL", annotation = invitedBy)
withStyle(
style =
style.copy(textDecoration = TextDecoration.Underline, fontWeight = FontWeight.Bold)
linkTextStyle.copy(
textDecoration = TextDecoration.Underline,
fontWeight = FontWeight.Bold,
)
) {
append(invitedBy)
}