mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[ADD] App report button and trusted source badge in app detail view
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
1F0DD8432936B0F9007608A4 /* RoundedTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F0DD8422936B0F9007608A4 /* RoundedTextField.swift */; };
|
||||
1F0DD8452936B3FE007608A4 /* FilledButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F0DD8442936B3FE007608A4 /* FilledButtonStyle.swift */; };
|
||||
1F1295812989B51F0048FCB9 /* ExpandableText in Frameworks */ = {isa = PBXBuildFile; productRef = 1F1295802989B51F0048FCB9 /* ExpandableText */; };
|
||||
1F180F92298E7A1B00D1C98B /* StoreApp+Trusted.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F180F91298E7A1B00D1C98B /* StoreApp+Trusted.swift */; };
|
||||
1F180F94298E7A2500D1C98B /* Source+Trusted.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F180F93298E7A2500D1C98B /* Source+Trusted.swift */; };
|
||||
1F2EF787297C4D40002FD839 /* LicensesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2EF786297C4D40002FD839 /* LicensesView.swift */; };
|
||||
1F44634529744E570070E514 /* HintView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F44634429744E570070E514 /* HintView.swift */; };
|
||||
1F5DF9D82974426300DDAA47 /* AppScreenshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F5DF9D72974426300DDAA47 /* AppScreenshot.swift */; };
|
||||
@@ -574,6 +576,8 @@
|
||||
1F0DD84029368056007608A4 /* EnvironmentValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnvironmentValues.swift; sourceTree = "<group>"; };
|
||||
1F0DD8422936B0F9007608A4 /* RoundedTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedTextField.swift; sourceTree = "<group>"; };
|
||||
1F0DD8442936B3FE007608A4 /* FilledButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FilledButtonStyle.swift; sourceTree = "<group>"; };
|
||||
1F180F91298E7A1B00D1C98B /* StoreApp+Trusted.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StoreApp+Trusted.swift"; sourceTree = "<group>"; };
|
||||
1F180F93298E7A2500D1C98B /* Source+Trusted.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Source+Trusted.swift"; sourceTree = "<group>"; };
|
||||
1F2EF786297C4D40002FD839 /* LicensesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LicensesView.swift; sourceTree = "<group>"; };
|
||||
1F44634429744E570070E514 /* HintView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HintView.swift; sourceTree = "<group>"; };
|
||||
1F5DF9D72974426300DDAA47 /* AppScreenshot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppScreenshot.swift; sourceTree = "<group>"; };
|
||||
@@ -1929,6 +1933,8 @@
|
||||
D57F2C9326E01BC700B9FA39 /* UIDevice+Vibration.swift */,
|
||||
B376FE3D29258C8900E18883 /* OSLog+SideStore.swift */,
|
||||
1F66F5BD2938F06100A910CA /* StoreApp+Filterable.swift */,
|
||||
1F180F91298E7A1B00D1C98B /* StoreApp+Trusted.swift */,
|
||||
1F180F93298E7A2500D1C98B /* Source+Trusted.swift */,
|
||||
);
|
||||
path = Extensions;
|
||||
sourceTree = "<group>";
|
||||
@@ -2766,6 +2772,7 @@
|
||||
1F943C6D2927F90400ABE095 /* NewsViewModel.swift in Sources */,
|
||||
1FB96FF3292D0539007E68D1 /* PillButtonProgressViewStyle.swift in Sources */,
|
||||
1F6E08E829282174005059C0 /* ConfirmAddSourceView.swift in Sources */,
|
||||
1F180F92298E7A1B00D1C98B /* StoreApp+Trusted.swift in Sources */,
|
||||
1F6284D929523D340060AAD8 /* SideloadingManager.swift in Sources */,
|
||||
BFE6073A231ADF82002B0E8E /* SettingsViewController.swift in Sources */,
|
||||
1F943C6A2927F8F700ABE095 /* ViewModel.swift in Sources */,
|
||||
@@ -2861,6 +2868,7 @@
|
||||
1F5DF9D82974426300DDAA47 /* AppScreenshot.swift in Sources */,
|
||||
1F66F5BA2938CA5700A910CA /* VisualEffectView.swift in Sources */,
|
||||
BF0C4EBD22A1BD8B009A2DD7 /* AppManager.swift in Sources */,
|
||||
1F180F94298E7A2500D1C98B /* Source+Trusted.swift in Sources */,
|
||||
BF2901312318F7A800D88A45 /* AppBannerView.swift in Sources */,
|
||||
BFF00D342501BDCF00746320 /* IntentHandler.swift in Sources */,
|
||||
1F0DD81C2932D2FF007608A4 /* AppScreenshotsScrollView.swift in Sources */,
|
||||
|
||||
19
AltStore/Extensions/Source+Trusted.swift
Normal file
19
AltStore/Extensions/Source+Trusted.swift
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Source+Trusted.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Fabian Thies on 04.02.23.
|
||||
// Copyright © 2023 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import AltStoreCore
|
||||
|
||||
extension Source {
|
||||
var isOfficial: Bool {
|
||||
self.identifier == Source.altStoreIdentifier
|
||||
}
|
||||
|
||||
var isTrusted: Bool {
|
||||
UserDefaults.shared.trustedSourceIDs?.contains(self.identifier) ?? false
|
||||
}
|
||||
}
|
||||
19
AltStore/Extensions/StoreApp+Trusted.swift
Normal file
19
AltStore/Extensions/StoreApp+Trusted.swift
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// StoreApp+Trusted.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Fabian Thies on 04.02.23.
|
||||
// Copyright © 2023 SideStore. All rights reserved.
|
||||
//
|
||||
|
||||
import AltStoreCore
|
||||
|
||||
extension StoreApp {
|
||||
var isFromOfficialSource: Bool {
|
||||
self.source?.isOfficial ?? false
|
||||
}
|
||||
|
||||
var isFromTrustedSource: Bool {
|
||||
self.source?.isTrusted ?? false
|
||||
}
|
||||
}
|
||||
@@ -88,8 +88,10 @@ struct AppDetailView: View {
|
||||
var contentView: some View {
|
||||
VStack(alignment: .leading) {
|
||||
VStack(alignment: .leading, spacing: 32) {
|
||||
if storeApp.sourceIdentifier == Source.altStoreIdentifier {
|
||||
if storeApp.isFromOfficialSource {
|
||||
officialAppBadge
|
||||
} else if storeApp.isFromTrustedSource {
|
||||
trustedAppBadge
|
||||
}
|
||||
|
||||
if let subtitle = storeApp.subtitle {
|
||||
@@ -159,6 +161,12 @@ struct AppDetailView: View {
|
||||
Divider()
|
||||
|
||||
informationView
|
||||
|
||||
if !(storeApp.isFromOfficialSource || storeApp.isFromTrustedSource) {
|
||||
Divider()
|
||||
|
||||
reportButton
|
||||
}
|
||||
}
|
||||
.padding(.horizontal)
|
||||
}
|
||||
@@ -398,4 +406,12 @@ struct AppDetailView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var reportButton: some View {
|
||||
SwiftUI.Button {
|
||||
|
||||
} label: {
|
||||
Label("Report this App", systemSymbol: .exclamationmarkBubble)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user