Skip to content

Commit

Permalink
Fixed spacings and layout on TableListScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
kaulex99 committed Feb 25, 2024
1 parent 797ea6b commit 99e7837
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
5 changes: 4 additions & 1 deletion WaiterRobot/Ui/TableList/TableListFilterRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ struct TableListFilterRow: View {
.buttonStyle(.bordered)
.tint(group.hidden ? .primary : .blue)
}
}.padding(.horizontal)
}
.padding(.horizontal)
}
.padding(.bottom, 4)

Button {
onUnselectAll()
} label: {
Expand Down
21 changes: 13 additions & 8 deletions WaiterRobot/Ui/TableList/TableListScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct TableListScreen: View {
var body: some View {
content()
.navigationTitle(CommonApp.shared.settings.eventName)
.navigationBarTitleDisplayMode(.large)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
Expand Down Expand Up @@ -65,14 +65,19 @@ struct TableListScreen: View {
private func tableList(data: KotlinArray<TableGroup>) -> some View {
let tableGroups = Array(data)

VStack {
VStack(spacing: 0) {
if tableGroups.count > 1 {
TableListFilterRow(
tableGroups: tableGroups,
onToggleFilter: { viewModel.actual.toggleFilter(tableGroup: $0) },
onSelectAll: { viewModel.actual.showAll() },
onUnselectAll: { viewModel.actual.hideAll() }
)
VStack {
TableListFilterRow(
tableGroups: tableGroups,
onToggleFilter: { viewModel.actual.toggleFilter(tableGroup: $0) },
onSelectAll: { viewModel.actual.showAll() },
onUnselectAll: { viewModel.actual.hideAll() }
)

Divider()
}
.background(Color(UIColor.systemBackground))
}

if tableGroups.isEmpty {
Expand Down

0 comments on commit 99e7837

Please sign in to comment.