IceCubes/IceCubesApp/App/Tabs/Settings/AboutView.swift

106 lines
2.8 KiB
Swift
Raw Normal View History

import DesignSystem
2023-02-04 17:17:38 +01:00
import Env
import SwiftUI
struct AboutView: View {
@EnvironmentObject private var routerPath: RouterPath
@EnvironmentObject private var theme: Theme
2023-02-04 17:17:38 +01:00
let versionNumber: String
init() {
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
2023-02-04 17:17:38 +01:00
versionNumber = version + " "
} else {
versionNumber = ""
}
}
2023-02-04 17:17:38 +01:00
var body: some View {
2023-02-04 17:17:38 +01:00
ScrollView {
VStack(alignment: .leading) {
Divider()
HStack {
Spacer()
Image("icon0")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon14")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon17")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Image("icon23")
.resizable()
.frame(width: 50, height: 50)
.cornerRadius(4)
Spacer()
}
.padding(.top, 10)
HStack {
Spacer()
Text("\(versionNumber)©2023 Thomas Ricouard")
.font(.scaledFootnote)
.foregroundColor(.gray)
.fontWeight(.semibold)
.padding(.bottom, 10)
Spacer()
}
Divider()
Text("settings.about.built-with")
.padding(.horizontal, 25)
.padding(.bottom, 10)
.font(.scaledSubheadline)
.foregroundColor(.gray)
Text("""
2023-02-04 17:17:38 +01:00
[EmojiText](https://github.com/divadretlaw/EmojiText)
2023-02-04 17:17:38 +01:00
[HTML2Markdown](https://gitlab.com/mflint/HTML2Markdown)
2023-02-04 17:17:38 +01:00
[KeychainSwift](https://github.com/evgenyneu/keychain-swift)
2023-02-04 17:17:38 +01:00
[LRUCache](https://github.com/nicklockwood/LRUCache)
2023-02-12 16:29:41 +01:00
[Bodega](https://github.com/mergesort/Bodega)
2023-02-04 17:17:38 +01:00
[Nuke](https://github.com/kean/Nuke)
2023-02-04 17:17:38 +01:00
[SwiftSoup](https://github.com/scinfu/SwiftSoup.git)
2023-02-04 17:17:38 +01:00
[Atkinson Hyperlegible](https://github.com/googlefonts/atkinson-hyperlegible)
2023-02-04 17:17:38 +01:00
[OpenDyslexic](http://opendyslexic.org)
[SwiftUI-Introspect](https://github.com/siteline/SwiftUI-Introspect)
[RevenueCat](https://github.com/RevenueCat/purchases-ios)
2023-02-04 17:17:38 +01:00
""")
.padding(.horizontal, 25)
.multilineTextAlignment(.leading)
.font(.scaledSubheadline)
.foregroundColor(.gray)
}
Divider()
Spacer()
}
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
.navigationTitle(Text("settings.about.title"))
.navigationBarTitleDisplayMode(.large)
.environment(\.openURL, OpenURLAction { url in
routerPath.handle(url: url)
})
}
}
struct AboutView_Previews: PreviewProvider {
2023-02-04 17:17:38 +01:00
static var previews: some View {
AboutView()
2023-03-04 09:31:22 +01:00
.environmentObject(Theme.shared)
2023-02-04 17:17:38 +01:00
}
}