mobile: group welcome message to fill max width (#2480)

* mobile: group welcome message to fill max width

* not limiting preview height

* min height, no scroll

---------

Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
This commit is contained in:
spaced4ndy 2023-05-23 14:31:43 +04:00 committed by GitHub
parent dc73bb3caf
commit f4861482f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 11 deletions

View File

@ -114,12 +114,8 @@ private fun GroupWelcomeLayout(
@Composable
private fun TextPreview(text: String, linkMode: SimplexLinkMode, markdown: Boolean = true) {
Column(
Modifier.height(140.dp)
) {
SelectionContainer(
Modifier.verticalScroll(rememberScrollState())
) {
Column {
SelectionContainer(Modifier.fillMaxWidth()) {
MarkdownText(
text,
formattedText = if (markdown) remember(text) { parseToMarkdown(text) } else null,

View File

@ -53,10 +53,10 @@ struct GroupWelcomeView: View {
}
private func textPreview() -> some View {
ScrollView {
messageText(welcomeText, parseSimpleXMarkdown(welcomeText), nil)
.allowsHitTesting(false)
}
messageText(welcomeText, parseSimpleXMarkdown(welcomeText), nil)
.allowsHitTesting(false)
.frame(minHeight: 140, alignment: .topLeading)
.frame(maxWidth: .infinity, alignment: .leading)
}
private func editorView() -> some View {
@ -80,7 +80,6 @@ struct GroupWelcomeView: View {
}
} else {
textPreview()
.frame(height: 140, alignment: .topLeading)
}
Button {