Updated RecipeView

This commit is contained in:
VincentMeilinger
2024-03-01 14:17:24 +01:00
parent d3e0366ce6
commit 744ea76a34
41 changed files with 588 additions and 383 deletions

View File

@@ -50,12 +50,14 @@ struct RecipeTabView: View {
.navigationDestination(isPresented: $viewModel.presentSettingsView) {
SettingsView()
}
.navigationDestination(isPresented: $viewModel.presentEditView) {
RecipeView(viewModel: RecipeView.ViewModel())
}
} detail: {
NavigationStack {
if let category = viewModel.selectedCategory {
RecipeListView(
categoryName: category.name,
viewModel: mainViewModel,
showEditView: $viewModel.presentEditView
)
.id(category.id) // Workaround: This is needed to update the detail view when the selection changes
@@ -63,7 +65,8 @@ struct RecipeTabView: View {
}
}
.tint(.nextcloudBlue)
.sheet(isPresented: $viewModel.presentEditView) {
/*.sheet(isPresented: $viewModel.presentEditView) {
RecipeEditView(
viewModel:
RecipeEditViewModel(
@@ -72,7 +75,7 @@ struct RecipeTabView: View {
),
isPresented: $viewModel.presentEditView
)
}
}*/
.task {
viewModel.serverConnection = await mainViewModel.checkServerConnection()
}