File tree 1 file changed +11
-9
lines changed
PocketKit/Sources/PocketKit/Home/Views/Card groups
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -19,17 +19,19 @@ struct SlateView: View {
19
19
@EnvironmentObject var navigation : HomeNavigation
20
20
21
21
var body : some View {
22
- VStack ( alignment: . leading, spacing: 0 ) {
23
- VStack ( alignment: . leading, spacing: 16 ) {
24
- if let slateTitle {
25
- makeHeader ( slateTitle)
22
+ if !cards. isEmpty {
23
+ VStack ( alignment: . leading, spacing: 0 ) {
24
+ VStack ( alignment: . leading, spacing: 16 ) {
25
+ if let slateTitle {
26
+ makeHeader ( slateTitle)
27
+ }
28
+ HeroView ( remoteID: remoteID, cards: heroCards)
26
29
}
27
- HeroView ( remoteID: remoteID, cards: heroCards)
30
+ . padding ( EdgeInsets ( top: 16 , leading: 16 , bottom: 0 , trailing: 16 ) )
31
+ CarouselView ( cards: carouselCards, useGrid: layoutWidth. isRegular)
28
32
}
29
- . padding ( EdgeInsets ( top: 16 , leading: 16 , bottom: 0 , trailing: 16 ) )
30
- CarouselView ( cards: carouselCards, useGrid: layoutWidth. isRegular)
33
+ . padding ( . bottom, 32 )
31
34
}
32
- . padding ( . bottom, 32 )
33
35
}
34
36
}
35
37
@@ -49,7 +51,7 @@ private extension SlateView {
49
51
50
52
/// Determines how many hero cells should be used
51
53
var heroCount : Int {
52
- Self . heroCount ( layoutWidth. isRegular)
54
+ min ( Self . heroCount ( layoutWidth. isRegular) , cards . count )
53
55
}
54
56
55
57
/// Extract the Hero recommendations
You can’t perform that action at this time.
0 commit comments