diff --git a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift index 3135c7892..c64633fff 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Labels/ApplyLabelsView.swift @@ -73,6 +73,9 @@ struct ApplyLabelsView: View { } } ) + #if os(macOS) + .buttonStyle(PlainButtonStyle()) + #endif } } } @@ -81,24 +84,17 @@ struct ApplyLabelsView: View { .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .navigationBarLeading) { - Button( - action: { presentationMode.wrappedValue.dismiss() }, - label: { Text("Cancel").foregroundColor(.appGrayTextContrast) } - ) + cancelButton } ToolbarItem(placement: .navigationBarTrailing) { - Button( - action: { - switch mode { - case let .item(feedItem): - viewModel.saveItemLabelChanges(itemID: feedItem.unwrappedID, dataService: dataService) - case .list: - onSave?(viewModel.selectedLabels) - } - presentationMode.wrappedValue.dismiss() - }, - label: { Text(mode.confirmButtonText).foregroundColor(.appGrayTextContrast) } - ) + saveItemChangesButton + } + } + #else + .toolbar { + ToolbarItemGroup { + cancelButton + saveItemChangesButton } } #endif @@ -107,21 +103,46 @@ struct ApplyLabelsView: View { } } + var saveItemChangesButton: some View { + Button( + action: { + switch mode { + case let .item(feedItem): + viewModel.saveItemLabelChanges(itemID: feedItem.unwrappedID, dataService: dataService) + case .list: + onSave?(viewModel.selectedLabels) + } + presentationMode.wrappedValue.dismiss() + }, + label: { Text(mode.confirmButtonText).foregroundColor(.appGrayTextContrast) } + ) + } + + var cancelButton: some View { + Button( + action: { presentationMode.wrappedValue.dismiss() }, + label: { Text("Cancel").foregroundColor(.appGrayTextContrast) } + ) + } + var body: some View { - NavigationView { - if viewModel.isLoading { - EmptyView() - } else { - #if os(iOS) - innerBody - .searchable( - text: $viewModel.labelSearchFilter, - placement: .navigationBarDrawer(displayMode: .always) - ) - #else - innerBody - #endif - } + Group { + #if os(iOS) + NavigationView { + if viewModel.isLoading { + EmptyView() + } else { + innerBody + .searchable( + text: $viewModel.labelSearchFilter, + placement: .navigationBarDrawer(displayMode: .always) + ) + } + } + #elseif os(macOS) + innerBody + .frame(minWidth: 400, minHeight: 400) + #endif } .task { switch mode {