From 95a66dba307ebdcf582ab7782dce85e1c93432fe Mon Sep 17 00:00:00 2001 From: Sixten Otto Date: Mon, 20 Feb 2023 12:02:08 -0700 Subject: [PATCH] rework some Button to silence linter warnings --- .../Views/Home/Components/FeedCardNavigationLink.swift | 9 ++++----- .../App/Views/Profile/TextToSpeechLanguageView.swift | 4 ++-- apple/OmnivoreKit/Sources/Views/CommunityModal.swift | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift b/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift index 8437868c1..f14b02ae3 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/Components/FeedCardNavigationLink.swift @@ -45,11 +45,10 @@ struct FeedCardNavigationLink: View { var body: some View { ZStack { - Button( - action: { - viewModel.selectedItem = item - viewModel.linkIsActive = true - }) { + Button { + viewModel.selectedItem = item + viewModel.linkIsActive = true + } label: { NavigationLink(destination: EmptyView()) { EmptyView() } diff --git a/apple/OmnivoreKit/Sources/App/Views/Profile/TextToSpeechLanguageView.swift b/apple/OmnivoreKit/Sources/App/Views/Profile/TextToSpeechLanguageView.swift index dae09f095..5469618b3 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Profile/TextToSpeechLanguageView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Profile/TextToSpeechLanguageView.swift @@ -24,9 +24,9 @@ private var innerBody: some View { ForEach(Voices.Languages, id: \.key.self) { language in - Button(action: { + Button { audioController.defaultLanguage = language.key - }) { + } label: { HStack { Text(language.name) diff --git a/apple/OmnivoreKit/Sources/Views/CommunityModal.swift b/apple/OmnivoreKit/Sources/Views/CommunityModal.swift index c8a60b06e..94bb9a449 100644 --- a/apple/OmnivoreKit/Sources/Views/CommunityModal.swift +++ b/apple/OmnivoreKit/Sources/Views/CommunityModal.swift @@ -40,9 +40,9 @@ public struct CommunityModal: View { VStack { HStack { Spacer() - Button(action: { + Button { dismiss() - }) { + } label: { Image(systemName: "xmark.circle") .padding(10) }