@@ -50,39 +50,32 @@ struct TodayView: View {
5050
5151 private var summarySection : some View {
5252 Section {
53- summaryScrollView
54- }
55- . listRowInsets ( EdgeInsets ( top: 16 , leading: 0 , bottom: 16 , trailing: 0 ) )
56- }
57-
58- private var summaryScrollView : some View {
59- SwiftUI . ScrollView ( . horizontal, showsIndicators: false ) {
60- summaryCards
61- }
62- . contentMargins ( . horizontal, 16 )
63- }
53+ ScrollView ( . horizontal) {
54+ let summaryCounts = store. summaryCounts
55+ let selectedSectionScope = store. selectedSectionScope
6456
65- private var summaryCards : some View {
66- let summaryCounts = store. summaryCounts
67- let selectedSectionScope = store. selectedSectionScope
68-
69- return HStack ( spacing: 12 ) {
70- ForEach ( TodayFeature . SectionScope. allCases, id: \. self) { scope in
71- Button {
72- withAnimation ( SwiftUI . Animation. easeInOut) {
73- _ = store. send ( . setSectionScope( scope) )
57+ HStack ( spacing: 12 ) {
58+ ForEach ( TodayFeature . SectionScope. allCases, id: \. self) { scope in
59+ Button {
60+ withAnimation ( SwiftUI . Animation. easeInOut) {
61+ _ = store. send ( . setSectionScope( scope) )
62+ }
63+ } label: {
64+ SummaryCard (
65+ title: scope. title,
66+ value: summaryCounts [ scope, default: 0 ] ,
67+ accentColor: scope. accentColor,
68+ isSelected: selectedSectionScope == scope
69+ )
70+ }
71+ . buttonStyle ( . plain)
7472 }
75- } label: {
76- SummaryCard (
77- title: scope. title,
78- value: summaryCounts [ scope, default: 0 ] ,
79- accentColor: scope. accentColor,
80- isSelected: selectedSectionScope == scope
81- )
8273 }
83- . buttonStyle ( . plain)
8474 }
75+ . scrollIndicators ( . never)
76+ . contentMargins ( . horizontal, 16 )
8577 }
78+ . listRowInsets ( EdgeInsets ( top: 16 , leading: 0 , bottom: 16 , trailing: 0 ) )
8679 }
8780
8881 @ToolbarContentBuilder
0 commit comments