This commit is contained in:
Ethan Pippin 2022-01-20 22:47:43 -07:00
parent efa69984ac
commit 1a7bef0579
8 changed files with 122 additions and 122 deletions

View File

@ -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 {
@ -54,11 +54,11 @@ final class SettingsCoordinator: NavigationCoordinatable {
func makeMissingSettings() -> some View {
MissingItemsSettingsView()
}
@ViewBuilder
func makeAbout() -> some View {
AboutView()
}
@ViewBuilder
func makeAbout() -> some View {
AboutView()
}
@ViewBuilder
func makeStart() -> some View {

View File

@ -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
}
}

View File

@ -9,11 +9,11 @@
import UIKit
extension UIApplication {
static var appVersion: String? {
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
}
static var bundleVersion: String? {
return Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String
}
static var appVersion: String? {
Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
}
static var bundleVersion: String? {
Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String
}
}

View File

@ -9,8 +9,8 @@
import SwiftUI
struct AboutView: View {
var body: some View {
Text("dud")
}
var body: some View {
Text("dud")
}
}

View File

@ -159,15 +159,15 @@ 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)
}
}
}
}
}

View File

@ -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() }
}
}

View File

@ -9,77 +9,77 @@
import SwiftUI
struct AboutView: View {
var body: some View {
List {
Section {
HStack {
Spacer()
VStack(alignment: .center) {
AppIcon()
.cornerRadius(11)
.frame(width: 150, height: 150)
Text("Swiftfin")
.fontWeight(.semibold)
.font(.title2)
}
Spacer()
}
.listRowBackground(Color.clear)
}
Section {
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)
Spacer()
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)
Spacer()
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)
Spacer()
var body: some View {
List {
Section {
HStack {
Spacer()
Image(systemName: "chevron.right")
.foregroundColor(.secondary)
}
}
}
}
VStack(alignment: .center) {
AppIcon()
.cornerRadius(11)
.frame(width: 150, height: 150)
Text("Swiftfin")
.fontWeight(.semibold)
.font(.title2)
}
Spacer()
}
.listRowBackground(Color.clear)
}
Section {
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)
Spacer()
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)
Spacer()
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)
Spacer()
Image(systemName: "chevron.right")
.foregroundColor(.secondary)
}
}
}
}
}

View File

@ -168,17 +168,17 @@ 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 {