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 {
|
var body: some View {
|
||||||
Form {
|
Form {
|
||||||
|
#if !os(tvOS)
|
||||||
Section {
|
Section {
|
||||||
communityLink("GitHub", icon: "github", url: "https://github.com/yattee/yattee")
|
communityLink("GitHub", icon: "github", url: "https://github.com/yattee/yattee")
|
||||||
communityLink("Discord", icon: "discord", url: "https://yattee.stream/discord")
|
communityLink("Discord", icon: "discord", url: "https://yattee.stream/discord")
|
||||||
} header: {
|
} header: {
|
||||||
Text(String(localized: "settings.about.community"))
|
Text(String(localized: "settings.about.community"))
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
NavigationLink {
|
NavigationLink {
|
||||||
|
|||||||
@@ -26,7 +26,11 @@ struct AcknowledgementsView: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ViewBuilder
|
||||||
private func dependencyLink(_ name: String, url: String) -> some View {
|
private func dependencyLink(_ name: String, url: String) -> some View {
|
||||||
|
#if os(tvOS)
|
||||||
|
Text(name)
|
||||||
|
#else
|
||||||
Button {
|
Button {
|
||||||
if let url = URL(string: url) {
|
if let url = URL(string: url) {
|
||||||
openURL(url)
|
openURL(url)
|
||||||
@@ -39,6 +43,7 @@ struct AcknowledgementsView: View {
|
|||||||
.foregroundStyle(.secondary)
|
.foregroundStyle(.secondary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user