@@ -22,19 +22,15 @@ struct WidgetHeatmapGrid: View {
2222 showsMonthTitles: showsMonthTitles
2323 )
2424
25- HStack ( alignment: . top, spacing: layout. weekdayLabelSpacing) {
26- WidgetHeatmapWeekdayLabels ( layout: layout)
27-
28- HStack ( alignment: . top, spacing: layout. monthSpacing) {
29- ForEach ( months, id: \. monthStart) { month in
30- WidgetHeatmapMonthGrid (
31- month: month,
32- layout: layout,
33- selectedActivityKindRawValues: selectedActivityKindRawValues,
34- maxCount: maxCount,
35- showsMonthTitle: showsMonthTitles
36- )
37- }
25+ HStack ( alignment: . top, spacing: layout. monthSpacing) {
26+ ForEach ( months, id: \. monthStart) { month in
27+ WidgetHeatmapMonthGrid (
28+ month: month,
29+ layout: layout,
30+ selectedActivityKindRawValues: selectedActivityKindRawValues,
31+ maxCount: maxCount,
32+ showsMonthTitle: showsMonthTitles
33+ )
3834 }
3935 }
4036 . frame ( maxWidth: . infinity, maxHeight: . infinity, alignment: . topLeading)
@@ -71,45 +67,6 @@ struct WidgetHeatmapPlaceholderGrid: View {
7167 }
7268}
7369
74- private struct WidgetHeatmapWeekdayLabels : View {
75- let layout : WidgetHeatmapLayout
76- private let orderedWeekdays = Array ( 1 ... 7 )
77- private let weekdayLabels = [
78- 2 : " 월 " ,
79- 4 : " 수 " ,
80- 6 : " 금 "
81- ]
82-
83- var body : some View {
84- VStack ( alignment: . leading, spacing: layout. cellSpacing) {
85- ForEach ( orderedWeekdays, id: \. self) { weekday in
86- weekdayLabel ( for: weekday)
87- }
88- }
89- . padding ( . top, layout. weekdayTopPadding)
90- }
91-
92- @ViewBuilder
93- private func weekdayLabel( for weekday: Int ) -> some View {
94- if let label = weekdayLabels [ weekday] {
95- Text ( label)
96- . font ( . caption2)
97- . foregroundStyle ( . secondary)
98- . frame (
99- width: layout. weekdayLabelWidth,
100- height: layout. cellSize,
101- alignment: . leading
102- )
103- } else {
104- Color . clear
105- . frame (
106- width: layout. weekdayLabelWidth,
107- height: layout. cellSize
108- )
109- }
110- }
111- }
112-
11370private struct WidgetHeatmapMonthGrid : View {
11471 let month : WidgetHeatmapMonthSnapshot
11572 let layout : WidgetHeatmapLayout
0 commit comments