IceCubes/IceCubesApp/App/Tabs/Settings/AboutView.swift
Gareth Simpson 5621b243a0
About screen + Open Dyslexic font close #599 (#626)
* Add dyslexia and hyper-legible fonts

* AboutView to satisfy font licensing requirements, and generally credit libraries in use.

* Fix background

---------

Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
2023-02-03 07:03:32 +01:00

103 lines
2.6 KiB
Swift

import SwiftUI
import Env
import DesignSystem
struct AboutView: View {
@EnvironmentObject private var routerPath: RouterPath
@EnvironmentObject private var theme: Theme
let versionNumber:String
init() {
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
versionNumber = version + " "
}
else {
versionNumber = ""
}
}
var body: some View {
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("""
• [EmojiText](https://github.com/divadretlaw/EmojiText)
• [HTML2Markdown](https://gitlab.com/mflint/HTML2Markdown)
• [KeychainSwift](https://github.com/evgenyneu/keychain-swift)
• [LRUCache](https://github.com/nicklockwood/LRUCache)
• [Nuke](https://github.com/kean/Nuke)
• [SwiftSoup](https://github.com/scinfu/SwiftSoup.git)
• [TextView](https://github.com/Dimillian/TextView)
• [Atkinson Hyperlegible](https://github.com/googlefonts/atkinson-hyperlegible)
• [OpenDyslexic](http://opendyslexic.org)
""")
.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 {
static var previews: some View {
AboutView()
}
}