From 868886ab83c704ef9992b6baaa88a4699be72f58 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 20 Jul 2022 10:13:45 -0700 Subject: [PATCH] add create label option on share ext --- .../Share/Views/ShareExtensionView.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift index 6a0420b36..c647ccd27 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift @@ -240,11 +240,25 @@ struct ApplyLabelsListView: View { #endif } } + Button( + action: { viewModel.showCreateLabelModal = true }, + label: { + HStack { + Image(systemName: "plus.circle.fill").foregroundColor(.green) + Text("Create a new Label").foregroundColor(.appGrayTextContrast) + Spacer() + } + } + ) + .disabled(viewModel.isLoading) } .listStyle(PlainListStyle()) .padding(.vertical, 0) .task { await viewModel.loadLabels(dataService: dataService, item: linkedItem) } + .sheet(isPresented: $viewModel.showCreateLabelModal) { + CreateLabelView(viewModel: viewModel) + } } }