removed some repetition

This commit is contained in:
Jesse Horne
2023-11-28 14:02:15 -05:00
parent ff3ad7487c
commit ce7300b4bb

View File

@@ -51,6 +51,19 @@ fun FramedItemView(
@Composable
fun Color.toQuote(): Color = if (isInDarkTheme()) lighter(0.12f) else darker(0.12f)
@Composable
fun ciQuotedMsgTextViewMarkdown(qi: CIQuote, lines: Int) {
MarkdownText(
qi.text,
qi.formattedText,
maxLines = lines,
overflow = TextOverflow.Ellipsis,
style = TextStyle(fontSize = 15.sp, color = MaterialTheme.colors.onSurface),
linkMode = linkMode,
uriHandler = if (appPlatform.isDesktop) uriHandler else null
)
}
@Composable
fun ciQuotedMsgTextView(qi: CIQuote, lines: Int) {
if (appPlatform.isDesktop) {
@@ -60,26 +73,10 @@ fun FramedItemView(
onClick = { showMenu.value = true }
)
) {
MarkdownText(
qi.text,
qi.formattedText,
maxLines = lines,
overflow = TextOverflow.Ellipsis,
style = TextStyle(fontSize = 15.sp, color = MaterialTheme.colors.onSurface),
linkMode = linkMode,
uriHandler = if (appPlatform.isDesktop) uriHandler else null
)
ciQuotedMsgTextViewMarkdown(qi, lines)
}
} else {
MarkdownText(
qi.text,
qi.formattedText,
maxLines = lines,
overflow = TextOverflow.Ellipsis,
style = TextStyle(fontSize = 15.sp, color = MaterialTheme.colors.onSurface),
linkMode = linkMode,
uriHandler = if (appPlatform.isDesktop) uriHandler else null
)
ciQuotedMsgTextViewMarkdown(qi, lines)
}
}