krz/daybyday

clone: git clone https://gitbay.org/krz/daybyday.git

main: ShapesView.swift · raw

 1//
 2//  ShapesView.swift
 3//  DayByDay
 4//
 5
 6import SwiftUI
 7
 8/// Displays 8 shapes as large, tappable cards in a scrollable grid.
 9/// Adapts between 1 and 2 columns depending on available width.
10struct ShapesView: View {
11    private let columns = [
12        GridItem(.adaptive(minimum: 300, maximum: 500), spacing: 24)
13    ]
14
15    var body: some View {
16        ScrollView {
17            LazyVGrid(columns: columns, spacing: 24) {
18                ForEach(LearnShape.allCases) { shape in
19                    ShapeCard(shape: shape)
20                        .frame(height: 200)
21                }
22            }
23            .padding(32)
24        }
25    }
26}
27
28#Preview {
29    ShapesView()
30}