mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-15 09:43:34 +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:
30
AltStore/View Components/RatingStars.swift
Normal file
30
AltStore/View Components/RatingStars.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// RatingStars.swift
|
||||
// SideStore
|
||||
//
|
||||
// Created by Fabian Thies on 18.11.22.
|
||||
// Copyright © 2022 Fabian Thies. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct RatingStars: View {
|
||||
|
||||
let rating: Int
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
ForEach(0..<5) { i in
|
||||
Image(systemName: i < rating ? "star.fill" : "star")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct RatingStars_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
RatingStars(rating: 4)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user