stub in edit labels modal

This commit is contained in:
Satindar Dhillon
2022-04-05 08:47:14 -07:00
parent da78a2a9ce
commit 20a9cb811f
4 changed files with 12 additions and 1 deletions

View File

@ -68,7 +68,7 @@ struct GridCardNavigationLink: View {
viewModel.itemAppeared(item: item, searchQuery: searchQuery, dataService: dataService)
}
}
.aspectRatio(2.1, contentMode: .fill)
.aspectRatio(1.8, contentMode: .fill)
.scaleEffect(scale)
}
}

View File

@ -167,6 +167,9 @@ import Views
}
}
}
.sheet(item: $viewModel.itemUnderLabelEdit, onDismiss: { print("edit label modal dismissed") }) { item in
Text("editing item with id: \(item.id)")
}
}
}
}
@ -323,6 +326,8 @@ import Views
case .delete:
itemToRemove = item
confirmationShown = true
case .editLabels:
viewModel.itemUnderLabelEdit = item
}
}

View File

@ -14,6 +14,7 @@ final class HomeFeedViewModel: ObservableObject {
@Published var items = [FeedItem]()
@Published var isLoading = false
@Published var showPushNotificationPrimer = false
@Published var itemUnderLabelEdit: FeedItem?
var cursor: String?
var sendProgressUpdates = false

View File

@ -5,6 +5,7 @@ import Utils
public enum GridCardAction {
case toggleArchiveStatus
case delete
case editLabels
}
public struct GridCard: View {
@ -42,6 +43,10 @@ public struct GridCard: View {
var contextMenuView: some View {
Group {
Button(
action: { menuActionHandler(.editLabels) },
label: { Label("Edit Labels", systemImage: "tag") }
)
Button(
action: { menuActionHandler(.toggleArchiveStatus) },
label: {