[ADD] Badge in AppDetailView for apps from the official source and (WIP) trusted sources

This commit is contained in:
Fabian Thies
2023-01-13 12:00:00 +01:00
committed by Joe Mattiello
parent 875453533b
commit f17d00c0bc

View File

@@ -9,6 +9,7 @@
import SwiftUI
import AsyncImage
import ExpandableText
import SFSafeSymbols
import AltStoreCore
struct AppDetailView: View {
@@ -93,6 +94,10 @@ struct AppDetailView: View {
var contentView: some View {
VStack(alignment: .leading, spacing: 32) {
if storeApp.sourceIdentifier == Source.altStoreIdentifier {
officialAppBadge
}
if let subtitle = storeApp.subtitle {
Text(subtitle)
.multilineTextAlignment(.center)
@@ -129,6 +134,26 @@ struct AppDetailView: View {
)
}
var officialAppBadge: some View {
HStack {
Spacer()
Image(systemSymbol: .checkmarkSealFill)
Text("Official App")
Spacer()
}
.foregroundColor(.accentColor)
}
var trustedAppBadge: some View {
HStack {
Spacer()
Image(systemSymbol: .shieldLefthalfFill)
Text("From Trusted Source")
Spacer()
}
.foregroundColor(.accentColor)
}
var currentVersionView: some View {
VStack(alignment: .leading, spacing: 8) {
HStack(alignment: .bottom) {