mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-11 15:53:30 +01:00
[ADD] News, Browse and Settings views ported to SwiftUI
This commit contains WIP SwiftUI versions of most of the views in SideStore.
This commit is contained in:
committed by
Joe Mattiello
parent
79d677cf3c
commit
d3e8473f45
51
AltStore/View Components/AppRowView.swift
Normal file
51
AltStore/View Components/AppRowView.swift
Normal file
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// AppRowView.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Fabian Thies on 18.11.22.
|
||||
// Copyright © 2022 Fabian Thies. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import AltStoreCore
|
||||
|
||||
struct AppRowView: View {
|
||||
let app: AppProtocol
|
||||
|
||||
var storeApp: StoreApp? {
|
||||
(app as? StoreApp) ?? (app as? InstalledApp)?.storeApp
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center, spacing: 12) {
|
||||
AppIconView(iconUrl: storeApp?.iconURL)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(app.name)
|
||||
.bold()
|
||||
|
||||
Text(storeApp?.developerName ?? "Sideloaded")
|
||||
.font(.callout)
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
RatingStars(rating: 4)
|
||||
.frame(height: 12)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
.lineLimit(1)
|
||||
|
||||
Spacer()
|
||||
|
||||
AppPillButton(app: app)
|
||||
}
|
||||
.padding()
|
||||
.background(Color(storeApp?.tintColor ?? UIColor.black).opacity(0.5))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 30, style: .circular))
|
||||
}
|
||||
}
|
||||
|
||||
//struct AppRowView_Previews: PreviewProvider {
|
||||
// static var previews: some View {
|
||||
// AppRowView()
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user