mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 01:39:46 +00:00
Yattee v2 rewrite
This commit is contained in:
49
Yattee/Views/Settings/AcknowledgementsView.swift
Normal file
49
Yattee/Views/Settings/AcknowledgementsView.swift
Normal file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// AcknowledgementsView.swift
|
||||
// Yattee
|
||||
//
|
||||
// Lists dependencies and open source libraries used in the app.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct AcknowledgementsView: View {
|
||||
@Environment(\.openURL) private var openURL
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
Section {
|
||||
dependencyLink("mpv", url: "https://github.com/mpv-player/mpv")
|
||||
dependencyLink("MPVKit", url: "https://github.com/mpvkit/MPVKit")
|
||||
dependencyLink("Nuke", url: "https://github.com/kean/Nuke")
|
||||
} header: {
|
||||
Text(String(localized: "settings.acknowledgements.dependencies.header"))
|
||||
}
|
||||
}
|
||||
.navigationTitle(String(localized: "settings.acknowledgements.title"))
|
||||
#if os(iOS)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
#endif
|
||||
}
|
||||
|
||||
private func dependencyLink(_ name: String, url: String) -> some View {
|
||||
Button {
|
||||
if let url = URL(string: url) {
|
||||
openURL(url)
|
||||
}
|
||||
} label: {
|
||||
HStack {
|
||||
Text(name)
|
||||
Spacer()
|
||||
Image(systemName: "arrow.up.right")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
NavigationStack {
|
||||
AcknowledgementsView()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user