Skip to content

Commit

Permalink
Remove duplicate BasicText blocks (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
fornewid authored Dec 19, 2024
1 parent 34f52a6 commit 5d24ac2
Showing 1 changed file with 12 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,33 +291,18 @@ private fun CoreReadMoreText(
.then(toggleableModifier)
.padding(contentPadding),
) {
if (toggleArea == ToggleArea.More) {
BasicText(
text = currentText,
modifier = Modifier,
style = style,
onTextLayout = {
state.onTextLayout(it)
onTextLayout(it)
},
overflow = TextOverflow.Ellipsis,
softWrap = softWrap,
maxLines = if (expanded) Int.MAX_VALUE else readMoreMaxLines,
)
} else {
BasicText(
text = currentText,
modifier = Modifier,
style = style,
onTextLayout = {
state.onTextLayout(it)
onTextLayout(it)
},
overflow = TextOverflow.Ellipsis,
softWrap = softWrap,
maxLines = if (expanded) Int.MAX_VALUE else readMoreMaxLines,
)
}
BasicText(
text = currentText,
modifier = Modifier,
style = style,
onTextLayout = {
state.onTextLayout(it)
onTextLayout(it)
},
overflow = TextOverflow.Ellipsis,
softWrap = softWrap,
maxLines = if (expanded) Int.MAX_VALUE else readMoreMaxLines,
)
if (expanded.not()) {
BasicText(
text = overflowText,
Expand Down

0 comments on commit 5d24ac2

Please sign in to comment.