mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 03:15:03 +00:00
Hide non-working external links in tvOS settings
tvOS cannot open URLs in a browser, so the Community section (GitHub/Discord) is omitted and Acknowledgements dependencies render as plain text rather than tappable buttons.
This commit is contained in:
@@ -13,12 +13,14 @@ struct AboutView: View {
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
#if !os(tvOS)
|
||||
Section {
|
||||
communityLink("GitHub", icon: "github", url: "https://github.com/yattee/yattee")
|
||||
communityLink("Discord", icon: "discord", url: "https://yattee.stream/discord")
|
||||
} header: {
|
||||
Text(String(localized: "settings.about.community"))
|
||||
}
|
||||
#endif
|
||||
|
||||
Section {
|
||||
NavigationLink {
|
||||
|
||||
@@ -26,7 +26,11 @@ struct AcknowledgementsView: View {
|
||||
#endif
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func dependencyLink(_ name: String, url: String) -> some View {
|
||||
#if os(tvOS)
|
||||
Text(name)
|
||||
#else
|
||||
Button {
|
||||
if let url = URL(string: url) {
|
||||
openURL(url)
|
||||
@@ -39,6 +43,7 @@ struct AcknowledgementsView: View {
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user