mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Hook up the RoomThreadList to the RoomFlowCoordinator state machine and presenting threads.
This commit is contained in:
committed by
Stefan Ceriu
parent
212cd42161
commit
a358cacf31
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user