mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Room List Filters Empty State View (#2522)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user