Skip to content

Commit

Permalink
Show table filter only if there is more than one group
Browse files Browse the repository at this point in the history
  • Loading branch information
kaulex99 committed Aug 2, 2023
1 parent c65a26a commit 8cc40e1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions WaiterRobot/Ui/TableList/TableListScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ struct TableListScreen: View {

ScreenContainer(vm.state) {
VStack {
TableListFilterRow(
selectedTableGroups: vm.state.selectedTableGroupList,
unselectedTableGroups: vm.state.unselectedTableGroupList,
onToggleFilter: { vm.actual.toggleFilter(tableGroup: $0) },
onClearFilter: vm.actual.clearFilter
)
if (vm.state.unselectedTableGroupList.count + vm.state.selectedTableGroupList.count) > 1 {
TableListFilterRow(
selectedTableGroups: vm.state.selectedTableGroupList,
unselectedTableGroups: vm.state.unselectedTableGroupList,
onToggleFilter: { vm.actual.toggleFilter(tableGroup: $0) },
onClearFilter: vm.actual.clearFilter
)
}

ScrollView {
if vm.state.filteredTableGroups.isEmpty {
Expand Down

0 comments on commit 8cc40e1

Please sign in to comment.