Fix preview issue.
TimelineItemEventForTimestampViewProvider can now have event content which is not TimelineItemTextContent
This commit is contained in:
parent
0e261689e9
commit
4adee708fc
1 changed files with 18 additions and 11 deletions
|
|
@ -22,18 +22,25 @@ internal fun TimelineItemEventRowTimestampPreview(
|
|||
@PreviewParameter(TimelineItemEventForTimestampViewProvider::class) event: TimelineItem.Event
|
||||
) = ElementPreview {
|
||||
Column {
|
||||
val oldContent = event.content as TimelineItemTextContent
|
||||
listOf(
|
||||
"Text",
|
||||
"Text longer, displayed on 1 line",
|
||||
"Text which should be rendered on several lines",
|
||||
).forEach { str ->
|
||||
ATimelineItemEventRow(
|
||||
event = event.copy(
|
||||
content = oldContent.copy(
|
||||
body = str,
|
||||
pillifiedBody = str,
|
||||
when (event.content) {
|
||||
is TimelineItemTextContent -> listOf(
|
||||
"Text",
|
||||
"Text longer, displayed on 1 line",
|
||||
"Text which should be rendered on several lines",
|
||||
).forEach { str ->
|
||||
ATimelineItemEventRow(
|
||||
event = event.copy(
|
||||
content = event.content.copy(
|
||||
body = str,
|
||||
pillifiedBody = str,
|
||||
),
|
||||
reactionsState = aTimelineItemReactions(count = 0),
|
||||
),
|
||||
)
|
||||
}
|
||||
else -> ATimelineItemEventRow(
|
||||
event = event.copy(
|
||||
content = event.content,
|
||||
reactionsState = aTimelineItemReactions(count = 0),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue