krz/daybyday

iOS app for children to learn days of the week, months, and seasons with audio assist.

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

main: DayByDay/MonthsOfYearView.swift · raw

 1//
 2//  MonthsOfYearView.swift
 3//  DayByDay
 4//
 5
 6import SwiftUI
 7
 8/// Displays all twelve months as large, tappable cards in a scrollable grid.
 9/// Adapts between 1 and 2 columns depending on available width.
10struct MonthsOfYearView: 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(MonthOfYear.allCases) { month in
19                    MonthCard(month: month, isHighlighted: month == .current)
20                        .frame(height: 200)
21                }
22            }
23            .padding(32)
24        }
25    }
26}
27
28#Preview {
29    MonthsOfYearView()
30}