Bubble/Threaded/Views/Settings/UpdateView.swift

100 lines
3.3 KiB
Swift

//Made by Lumaa
import SwiftUI
struct UpdateView: View {
@Environment(\.dismiss) private var dismiss
var body: some View {
ZStack {
Color.appBackground
.ignoresSafeArea()
VStack(alignment: .center) {
Text("update.title")
.font(.title.bold())
.padding(.top)
Text("about.version-\(AppInfo.appVersion)")
.font(.caption)
.foregroundStyle(Color.gray)
Spacer()
features
Spacer()
Button {
dismiss()
} label: {
Text("update.hide")
}
.buttonStyle(LargeButton(filled: true))
}
}
}
var features: some View {
VStack(spacing: 40) {
newFeature(systemImage: "sparkle.magnifyingglass", title: "Account officials", text: "In the Discovery tab, A new section \"\(String(localized: "discovery.app"))\" displays official accounts")
newFeature(systemImage: "accessibility", title: "Accessibility interactors", text: "The like, repost, bookmark, and share buttons are now displayed at the same font size")
newFeature(systemImage: "photo.on.rectangle", title: "Attachments viewer", text: "Tapping on an attachment will display a brand new screen, with ALT text and downloading")
}
.frame(height: 500)
}
@ViewBuilder
private func newFeature(systemImage: String, title: String, text: String) -> some View {
ViewThatFits {
HStack(alignment: .center) {
Image(systemName: systemImage)
.resizable()
.scaledToFit()
.frame(width: 60, height: 60)
.foregroundStyle(Color(uiColor: UIColor.label))
Spacer()
.frame(width: 30)
VStack(alignment: .leading) {
Text(title)
.bold()
.foregroundStyle(Color(uiColor: UIColor.label))
.multilineTextAlignment(.leading)
.lineLimit(1)
Text(text)
.foregroundStyle(Color(uiColor: UIColor.label).opacity(0.7))
.font(.callout)
.multilineTextAlignment(.leading)
.lineLimit(4)
}
Spacer()
}
.frame(width: 330)
VStack(alignment: .leading) {
Text(title)
.bold()
.foregroundStyle(Color(uiColor: UIColor.label))
.multilineTextAlignment(.leading)
.lineLimit(1)
Text(text)
.foregroundStyle(Color(uiColor: UIColor.label))
.multilineTextAlignment(.leading)
.lineLimit(4)
}
.padding(.horizontal)
}
}
}
#Preview {
UpdateView()
}