lint
This commit is contained in:
parent
efa69984ac
commit
1a7bef0579
|
@ -26,8 +26,8 @@ final class SettingsCoordinator: NavigationCoordinatable {
|
|||
var customizeViewsSettings = makeCustomizeViewsSettings
|
||||
@Route(.push)
|
||||
var missingSettings = makeMissingSettings
|
||||
@Route(.push)
|
||||
var about = makeAbout
|
||||
@Route(.push)
|
||||
var about = makeAbout
|
||||
|
||||
@ViewBuilder
|
||||
func makeServerDetail() -> some View {
|
||||
|
@ -55,10 +55,10 @@ final class SettingsCoordinator: NavigationCoordinatable {
|
|||
MissingItemsSettingsView()
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func makeAbout() -> some View {
|
||||
AboutView()
|
||||
}
|
||||
@ViewBuilder
|
||||
func makeAbout() -> some View {
|
||||
AboutView()
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func makeStart() -> some View {
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
import Foundation
|
||||
|
||||
extension Bundle {
|
||||
var iconFileName: String? {
|
||||
guard let icons = infoDictionary?["CFBundleIcons"] as? [String: Any],
|
||||
let primaryIcon = icons["CFBundlePrimaryIcon"] as? [String: Any],
|
||||
let iconFiles = primaryIcon["CFBundleIconFiles"] as? [String],
|
||||
let iconFileName = iconFiles.last
|
||||
else { return nil }
|
||||
return iconFileName
|
||||
}
|
||||
var iconFileName: String? {
|
||||
guard let icons = infoDictionary?["CFBundleIcons"] as? [String: Any],
|
||||
let primaryIcon = icons["CFBundlePrimaryIcon"] as? [String: Any],
|
||||
let iconFiles = primaryIcon["CFBundleIconFiles"] as? [String],
|
||||
let iconFileName = iconFiles.last
|
||||
else { return nil }
|
||||
return iconFileName
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
import UIKit
|
||||
|
||||
extension UIApplication {
|
||||
static var appVersion: String? {
|
||||
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
|
||||
}
|
||||
static var appVersion: String? {
|
||||
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
|
||||
}
|
||||
|
||||
static var bundleVersion: String? {
|
||||
return Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String
|
||||
}
|
||||
static var bundleVersion: String? {
|
||||
Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import SwiftUI
|
|||
|
||||
struct AboutView: View {
|
||||
|
||||
var body: some View {
|
||||
Text("dud")
|
||||
}
|
||||
var body: some View {
|
||||
Text("dud")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,14 +160,14 @@ struct SettingsView: View {
|
|||
}
|
||||
}
|
||||
|
||||
Button {} label: {
|
||||
HStack {
|
||||
Text("Version")
|
||||
Spacer()
|
||||
Text("\(UIApplication.appVersion ?? "--") (\(UIApplication.bundleVersion ?? "--"))")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
Button {} label: {
|
||||
HStack {
|
||||
Text("Version")
|
||||
Spacer()
|
||||
Text("\(UIApplication.appVersion ?? "--") (\(UIApplication.bundleVersion ?? "--"))")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
import SwiftUI
|
||||
|
||||
struct AppIcon: View {
|
||||
var body: some View {
|
||||
Bundle.main.iconFileName
|
||||
.flatMap { UIImage(named: $0) }
|
||||
.map { Image(uiImage: $0).resizable() }
|
||||
}
|
||||
var body: some View {
|
||||
Bundle.main.iconFileName
|
||||
.flatMap { UIImage(named: $0) }
|
||||
.map { Image(uiImage: $0).resizable() }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,76 +10,76 @@ import SwiftUI
|
|||
|
||||
struct AboutView: View {
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
Section {
|
||||
HStack {
|
||||
Spacer()
|
||||
var body: some View {
|
||||
List {
|
||||
Section {
|
||||
HStack {
|
||||
Spacer()
|
||||
|
||||
VStack(alignment: .center) {
|
||||
AppIcon()
|
||||
.cornerRadius(11)
|
||||
.frame(width: 150, height: 150)
|
||||
VStack(alignment: .center) {
|
||||
AppIcon()
|
||||
.cornerRadius(11)
|
||||
.frame(width: 150, height: 150)
|
||||
|
||||
Text("Swiftfin")
|
||||
.fontWeight(.semibold)
|
||||
.font(.title2)
|
||||
}
|
||||
Text("Swiftfin")
|
||||
.fontWeight(.semibold)
|
||||
.font(.title2)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.listRowBackground(Color.clear)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
.listRowBackground(Color.clear)
|
||||
}
|
||||
|
||||
Section {
|
||||
Section {
|
||||
|
||||
HStack {
|
||||
Text("Version")
|
||||
Spacer()
|
||||
Text("\(UIApplication.appVersion ?? "--") (\(UIApplication.bundleVersion ?? "--"))")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
HStack {
|
||||
Text("Version")
|
||||
Spacer()
|
||||
Text("\(UIApplication.appVersion ?? "--") (\(UIApplication.bundleVersion ?? "--"))")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
HStack {
|
||||
Image("github-logo")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.frame(width: 20, height: 20)
|
||||
.foregroundColor(.primary)
|
||||
Link("Source Code",
|
||||
destination: URL(string: "https://github.com/jellyfin/Swiftfin")!)
|
||||
.foregroundColor(.primary)
|
||||
HStack {
|
||||
Image("github-logo")
|
||||
.renderingMode(.template)
|
||||
.resizable()
|
||||
.frame(width: 20, height: 20)
|
||||
.foregroundColor(.primary)
|
||||
Link("Source Code",
|
||||
destination: URL(string: "https://github.com/jellyfin/Swiftfin")!)
|
||||
.foregroundColor(.primary)
|
||||
|
||||
Spacer()
|
||||
Spacer()
|
||||
|
||||
Image(systemName: "chevron.right")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
Image(systemName: "chevron.right")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
HStack {
|
||||
Image(systemName: "plus.circle.fill")
|
||||
Link("Request a Feature",
|
||||
destination: URL(string: "https://github.com/jellyfin/Swiftfin/issues")!)
|
||||
.foregroundColor(.primary)
|
||||
HStack {
|
||||
Image(systemName: "plus.circle.fill")
|
||||
Link("Request a Feature",
|
||||
destination: URL(string: "https://github.com/jellyfin/Swiftfin/issues")!)
|
||||
.foregroundColor(.primary)
|
||||
|
||||
Spacer()
|
||||
Spacer()
|
||||
|
||||
Image(systemName: "chevron.right")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
Image(systemName: "chevron.right")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
|
||||
HStack {
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
Link("Report an Issue",
|
||||
destination: URL(string: "https://github.com/jellyfin/Swiftfin/issues")!)
|
||||
.foregroundColor(.primary)
|
||||
HStack {
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
Link("Report an Issue",
|
||||
destination: URL(string: "https://github.com/jellyfin/Swiftfin/issues")!)
|
||||
.foregroundColor(.primary)
|
||||
|
||||
Spacer()
|
||||
Spacer()
|
||||
|
||||
Image(systemName: "chevron.right")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Image(systemName: "chevron.right")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -169,16 +169,16 @@ struct SettingsView: View {
|
|||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
settingsRouter.route(to: \.about)
|
||||
} label: {
|
||||
HStack {
|
||||
Text("About")
|
||||
.foregroundColor(.primary)
|
||||
Spacer()
|
||||
Image(systemName: "chevron.right")
|
||||
}
|
||||
}
|
||||
Button {
|
||||
settingsRouter.route(to: \.about)
|
||||
} label: {
|
||||
HStack {
|
||||
Text("About")
|
||||
.foregroundColor(.primary)
|
||||
Spacer()
|
||||
Image(systemName: "chevron.right")
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationBarTitle(L10n.settings, displayMode: .inline)
|
||||
.toolbar {
|
||||
|
|
Loading…
Reference in New Issue