Hook up the RoomThreadList to the RoomFlowCoordinator state machine and presenting threads.

This commit is contained in:
Stefan Ceriu
2026-04-01 09:27:39 +03:00
committed by Stefan Ceriu
parent 212cd42161
commit a358cacf31
9 changed files with 67 additions and 17 deletions
@@ -15,9 +15,14 @@ struct RoomThreadListScreen: View {
ScrollView {
LazyVStack(spacing: 0) {
ForEach(context.viewState.items) { item in
RoomThreadListCell(item: item, mediaProvider: context.mediaProvider)
.padding(.horizontal, 16)
.padding(.vertical, 8)
Button {
context.send(viewAction: .tappedThread(threadRootEventID: item.id))
} label: {
RoomThreadListCell(item: item, mediaProvider: context.mediaProvider)
.padding(.horizontal, 16)
.padding(.vertical, 8)
}
.buttonStyle(ThreadCellButtonStyle())
}
footer
@@ -137,6 +142,14 @@ private struct RoomThreadListCell: View {
}
}
private struct ThreadCellButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.background(configuration.isPressed ? Color.compound.bgSubtleSecondary : Color.compound.bgCanvasDefault)
.contentShape(Rectangle())
}
}
// MARK: - Previews
struct RoomThreadListScreen_Previews: PreviewProvider, TestablePreview {