DayByDay/Quiz/ClothingTile.swift
27 lines · 784 bytes
1 symbol in this file
1//
2// ClothingTile.swift
3// DayByDay
4//
5
6import SwiftUI
7
8/// A thing to wear, white on the weather topic color.
9struct ClothingTile: View {
10 let item: QuizItem
11
12 var body: some View {
13 let clothing = Clothing.from(item)
14 VStack(spacing: 10) {
15 Image(systemName: clothing?.symbol ?? "questionmark")
16 .font(.system(size: 56))
17 .frame(height: 64)
18 Text(item.name)
19 .font(.heading(22))
20 }
21 .foregroundStyle(.white)
22 .frame(maxWidth: .infinity, maxHeight: .infinity)
23 .padding(12)
24 .background(RoundedRectangle(cornerRadius: 32, style: .continuous).fill(Category.weather.color))
25 .contentShape(RoundedRectangle(cornerRadius: 32, style: .continuous))
26 }
27}