Skip to content

Commit

Permalink
fix message alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
X1nto committed Dec 23, 2023
1 parent a7ef7a5 commit b1ad45e
Showing 1 changed file with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,34 @@ fun MessageScreen(
modifier = Modifier
.fillMaxSize()
.padding(padding)
.nestedScroll(scrollBehavior.nestedScrollConnection)
.verticalScroll(rememberScrollState()),
.nestedScroll(scrollBehavior.nestedScrollConnection),
contentAlignment = Alignment.Center
) {
when (state) {
is MessageState.Loading -> {
CircularProgressIndicator()
}

is MessageState.Success -> {
MaterialHtmlText2(
Box(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
text = remember {
"""
<div style="display:flex; flex-direction:column; gap:8px;">
<h4>${state.message.subject}</h4>
${state.message.body}
</div>
""".trimIndent()
}
)
.verticalScroll(rememberScrollState())
) {
MaterialHtmlText2(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
text = remember {
"""
<div style="display:flex; flex-direction:column; gap:8px;">
<h4>${state.message.subject}</h4>
${state.message.body}
</div>
""".trimIndent()
}
)
}
}

is MessageState.Error -> {
Text("Error")
}
Expand Down

0 comments on commit b1ad45e

Please sign in to comment.