removed some repetition

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

View File

@@ -52,14 +52,7 @@ fun FramedItemView(
fun Color.toQuote(): Color = if (isInDarkTheme()) lighter(0.12f) else darker(0.12f)
@Composable
fun ciQuotedMsgTextView(qi: CIQuote, lines: Int) {
if (appPlatform.isDesktop) {
SelectionContainer(
modifier = Modifier.onClick(
matcher = PointerMatcher.mouse(PointerButton.Secondary),
onClick = { showMenu.value = true }
)
) {
fun ciQuotedMsgTextViewMarkdown(qi: CIQuote, lines: Int) {
MarkdownText(
qi.text,
qi.formattedText,
@@ -70,16 +63,20 @@ fun FramedItemView(
uriHandler = if (appPlatform.isDesktop) uriHandler else null
)
}
} 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
@Composable
fun ciQuotedMsgTextView(qi: CIQuote, lines: Int) {
if (appPlatform.isDesktop) {
SelectionContainer(
modifier = Modifier.onClick(
matcher = PointerMatcher.mouse(PointerButton.Secondary),
onClick = { showMenu.value = true }
)
) {
ciQuotedMsgTextViewMarkdown(qi, lines)
}
} else {
ciQuotedMsgTextViewMarkdown(qi, lines)
}
}