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 236ec3f718
commit 1e2fc6ad27
10 changed files with 25 additions and 28 deletions

1
changelog.d/2127.misc Normal file
View File

@@ -0,0 +1 @@
Remove extra previews for timestamp view with 'document' case

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",
),
)
}
}
}