Room List Filters Empty State View (#2522)

This commit is contained in:
Mauro
2024-03-05 15:15:07 +01:00
committed by GitHub
parent 1b5db6c63d
commit 8c68f5a591
8 changed files with 141 additions and 1 deletions
@@ -20,6 +20,7 @@ struct HomeScreenContent: View {
@Environment(\.verticalSizeClass) private var verticalSizeClass
@ObservedObject var context: HomeScreenViewModel.Context
@State private var topSectionFrame: CGRect = .zero
let scrollViewAdapter: ScrollViewAdapter
var body: some View {
@@ -56,9 +57,15 @@ struct HomeScreenContent: View {
// Showing empty views in pinned headers makes the room list spasm when reaching the top
LazyVStack(spacing: 0, pinnedViews: [.sectionHeaders]) {
Section {
HomeScreenRoomList(context: context)
if context.viewState.shouldShowEmptyFilterState {
RoomListFiltersEmptyStateView(state: context.filtersState)
.frame(height: geometry.size.height - topSectionFrame.height)
} else {
HomeScreenRoomList(context: context)
}
} header: {
topSection
.readFrame($topSectionFrame)
}
}
.searchable(text: $context.searchQuery)