mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-13 08:43:27 +01:00
[CHANGE] UI fixes and SwiftUI previews for easier development
This commit is contained in:
@@ -418,3 +418,16 @@ struct AppDetailView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct AppDetailView_Previews: PreviewProvider {
|
||||
|
||||
static let context = DatabaseManager.shared.viewContext
|
||||
static let app = StoreApp.makeAltStoreApp(in: context)
|
||||
|
||||
static var previews: some View {
|
||||
NavigationView {
|
||||
AppDetailView(storeApp: app)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,17 @@ extension AppScreenshotsPreview: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
//struct AppScreenshotsPreview_Previews: PreviewProvider {
|
||||
// static var previews: some View {
|
||||
// AppScreenshotsPreview()
|
||||
// }
|
||||
//}
|
||||
struct AppScreenshotsPreview_Previews: PreviewProvider {
|
||||
|
||||
static let context = DatabaseManager.shared.viewContext
|
||||
static let app = StoreApp.makeAltStoreApp(in: context)
|
||||
|
||||
static var previews: some View {
|
||||
Color.clear
|
||||
.sheet(isPresented: .constant(true)) {
|
||||
NavigationView {
|
||||
AppScreenshotsPreview(urls: app.screenshotURLs)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,3 +56,16 @@ extension Int: Identifiable {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
import AltStoreCore
|
||||
|
||||
struct AppScreenshotsScrollView_Previews: PreviewProvider {
|
||||
|
||||
static let context = DatabaseManager.shared.viewContext
|
||||
static let app = StoreApp.makeAltStoreApp(in: context)
|
||||
|
||||
static var previews: some View {
|
||||
AppScreenshotsScrollView(urls: app.screenshotURLs)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,14 @@ struct AppVersionHistoryView: View {
|
||||
}
|
||||
}
|
||||
|
||||
//struct AppVersionHistoryView_Previews: PreviewProvider {
|
||||
// static var previews: some View {
|
||||
// AppVersionHistoryView(storeApp: )
|
||||
// }
|
||||
//}
|
||||
struct AppVersionHistoryView_Previews: PreviewProvider {
|
||||
|
||||
static let context = DatabaseManager.shared.viewContext
|
||||
static let app = StoreApp.makeAltStoreApp(in: context)
|
||||
|
||||
static var previews: some View {
|
||||
NavigationView {
|
||||
AppVersionHistoryView(storeApp: app)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user