diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-02-06 00:55:04 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-02-06 00:55:04 +0100 |
| commit | 75a0e4509a70055851b085f3f7293ae1cf48164c (patch) | |
| tree | b2933b23235b83cb9f5f2d9fd42c8028650ad1d6 /Map/Views/ContentView.swift | |
| parent | 91fd86189477e6c690c6487d51d80bc58c8ecb63 (diff) | |
Fix performance and undo1.2.0
Diffstat (limited to 'Map/Views/ContentView.swift')
| -rw-r--r-- | Map/Views/ContentView.swift | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Map/Views/ContentView.swift b/Map/Views/ContentView.swift index f439026..534c14c 100644 --- a/Map/Views/ContentView.swift +++ b/Map/Views/ContentView.swift @@ -25,7 +25,9 @@ struct ContentView: View { DefaultMapView() } ForEach(maps) { map in - NavigationLink(destination: MapDetailView(map: map)) { + NavigationLink( + destination: MapDetailView(map: map, title: map.title ?? "", content: map.content ?? "") + ) { HStack { Text(map.title ?? "Untitled Map") Spacer() @@ -38,10 +40,12 @@ struct ContentView: View { .cornerRadius(2.0) }.padding(.leading, 8.0) }.contextMenu { - Button(action: { store.send(.deleteMap(map: map))}) { - Image(systemName: "trash") - Text("Delete") - } + Button( + action: { store.send(.deleteMap(map: map)) }, + label: { + Image(systemName: "trash") + Text("Delete") + }) } } .onDelete(perform: deleteMaps) @@ -56,7 +60,7 @@ struct ContentView: View { } } } - DefaultMapView() + DefaultMapView() } } |