From b2ce994cea675f9c0e751af86faa5567eb3d664c Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 6 Mar 2025 14:24:33 -0600 Subject: [PATCH] fixeds --- EmployeeDirectory/Views/EmployeeListView.swift | 8 ++++++-- EmployeeDirectory/Views/EmployeeRowView.swift | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/EmployeeDirectory/Views/EmployeeListView.swift b/EmployeeDirectory/Views/EmployeeListView.swift index dcb39d3..17260a3 100644 --- a/EmployeeDirectory/Views/EmployeeListView.swift +++ b/EmployeeDirectory/Views/EmployeeListView.swift @@ -19,12 +19,16 @@ struct EmployeeListView: View { var body: some View { NavigationView { List { - ForEach(viewModel.employees) { employee in + //build out dynamic rows first + ForEach(viewModel.employees, id: \.id) { employee in NavigationLink(destination: EmployeeDetailsView(viewModel: .init(employee: employee))) { EmployeeRowView(viewModel: .init(employee: employee)) } + .listRowInsets(.none) .listRowSeparator(.hidden) } + + //add static row if there is a next page if viewModel.hasNextPage { ProgressView() .frame(maxWidth: .infinity, alignment: .center) @@ -34,7 +38,7 @@ struct EmployeeListView: View { } } .navigationTitle("Employees") - .listStyle(.plain) + .listStyle(.insetGrouped) } .task { if viewModel.employees.isEmpty { diff --git a/EmployeeDirectory/Views/EmployeeRowView.swift b/EmployeeDirectory/Views/EmployeeRowView.swift index 076be28..52c46ae 100644 --- a/EmployeeDirectory/Views/EmployeeRowView.swift +++ b/EmployeeDirectory/Views/EmployeeRowView.swift @@ -37,7 +37,6 @@ struct EmployeeRowView: View { Spacer() // Pushes everything to the left } - .padding(.vertical, 8) } }