summaryrefslogtreecommitdiff
path: root/WeatherView.swift
blob: e3b848bb2b9bf1f6d8f4cfc20639fc44a5d9896b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
//  WeatherView.swift
//  DayByDay
//

import SwiftUI

/// Displays all 8 weather types as large, tappable cards in a scrollable grid.
struct WeatherView: View {
    private let columns = [
        GridItem(.adaptive(minimum: 280), spacing: 24)
    ]

    var body: some View {
        ScrollView {
            LazyVGrid(columns: columns, spacing: 24) {
                ForEach(LearnWeather.allCases) { weather in
                    WeatherCard(weather: weather)
                        .frame(height: 200)
                }
            }
            .padding(32)
        }
    }
}

#Preview {
    WeatherView()
}