Remove 'document' case for message with timestamp preview (#2164)

* Remove 'document' case for message with timestamp preview

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2024-01-04 15:22:09 +01:00 committed by GitHub
parent b9a7b11482
commit 0ca9780337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 25 additions and 28 deletions

View file

@ -24,7 +24,6 @@ import io.element.android.features.messages.impl.timeline.model.TimelineItem
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemTextContent
import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
import org.jsoup.Jsoup
@PreviewsDayNight
@Composable
@ -38,18 +37,15 @@ internal fun TimelineItemEventRowTimestampPreview(
"Text longer, displayed on 1 line",
"Text which should be rendered on several lines",
).forEach { str ->
listOf(false, true).forEach { useDocument ->
ATimelineItemEventRow(
event = event.copy(
content = oldContent.copy(
body = str,
htmlDocument = if (useDocument) Jsoup.parse(str) else null,
),
reactionsState = aTimelineItemReactions(count = 0),
senderDisplayName = if (useDocument) "Document case" else "Text case",
ATimelineItemEventRow(
event = event.copy(
content = oldContent.copy(
body = str,
),
)
}
reactionsState = aTimelineItemReactions(count = 0),
senderDisplayName = "A sender",
),
)
}
}
}