2023-02-03 07:03:32 +01:00
|
|
|
import DesignSystem
|
2023-02-04 17:17:38 +01:00
|
|
|
import Env
|
|
|
|
import SwiftUI
|
2023-02-03 07:03:32 +01:00
|
|
|
|
|
|
|
struct AboutView: View {
|
|
|
|
@EnvironmentObject private var routerPath: RouterPath
|
|
|
|
@EnvironmentObject private var theme: Theme
|
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
let versionNumber: String
|
|
|
|
|
2023-02-03 07:03:32 +01:00
|
|
|
init() {
|
|
|
|
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
|
2023-02-04 17:17:38 +01:00
|
|
|
versionNumber = version + " "
|
|
|
|
} else {
|
2023-02-03 07:03:32 +01:00
|
|
|
versionNumber = ""
|
|
|
|
}
|
|
|
|
}
|
2023-02-04 17:17:38 +01:00
|
|
|
|
2023-02-03 07:03:32 +01:00
|
|
|
var body: some View {
|
2023-02-04 17:17:38 +01:00
|
|
|
ScrollView {
|
2023-02-03 07:03:32 +01:00
|
|
|
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-03 07:03:32 +01:00
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
• [HTML2Markdown](https://gitlab.com/mflint/HTML2Markdown)
|
2023-02-03 07:03:32 +01:00
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
• [KeychainSwift](https://github.com/evgenyneu/keychain-swift)
|
2023-02-03 07:03:32 +01:00
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
• [LRUCache](https://github.com/nicklockwood/LRUCache)
|
2023-02-05 08:02:44 +01:00
|
|
|
|
|
|
|
• [Boutique](https://github.com/mergesort/Boutique)
|
2023-02-03 07:03:32 +01:00
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
• [Nuke](https://github.com/kean/Nuke)
|
2023-02-03 07:03:32 +01:00
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
• [SwiftSoup](https://github.com/scinfu/SwiftSoup.git)
|
2023-02-03 07:03:32 +01:00
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
• [Atkinson Hyperlegible](https://github.com/googlefonts/atkinson-hyperlegible)
|
2023-02-03 07:03:32 +01:00
|
|
|
|
2023-02-04 17:17:38 +01:00
|
|
|
• [OpenDyslexic](http://opendyslexic.org)
|
|
|
|
""")
|
2023-02-03 07:03:32 +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-02-03 07:03:32 +01:00
|
|
|
}
|