Skip to content

Commit

Permalink
add long title preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Matuyuhi committed Sep 1, 2024
1 parent 8c6f0e7 commit e872e43
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,32 @@ fun PreviewTimetableGridItemWelcomeTalk() {
}
}
}

@Preview
@Composable
fun PreviewTimetableGridItemMoreLongTitleItem() {
val fake = Session.fake()

val localDensity = LocalDensity.current
val verticalScale = 1f

val minutePx = with(localDensity) { TimetableSizes.minuteHeight.times(verticalScale).toPx() }
val displayEndsAt = fake.endsAt.minus(1, DateTimeUnit.MINUTE)
val height = ((displayEndsAt - fake.startsAt).inWholeMinutes * minutePx).roundToInt()

KaigiTheme {
Surface {
TimetableGridItem(
timetableItem = Session.fake().let {
val longTitle = it.title.copy(
jaTitle = it.title.jaTitle.repeat(10),
enTitle = it.title.enTitle.repeat(10),
)
it.copy(title = longTitle, speakers = persistentListOf(it.speakers.first()))
},
onTimetableItemClick = {},
gridItemHeightPx = height,
)
}
}
}

0 comments on commit e872e43

Please sign in to comment.