@@ -157,81 +157,78 @@ public struct PushNotificationListView: View {
157157 }
158158
159159 private var headerView : some View {
160- ScrollView ( . horizontal) {
161- HStack ( spacing: 8 ) {
162- if 0 < store. appliedFilterCount {
163- Menu {
164- Text (
165- String . localizedStringWithFormat (
166- String ( localized: " push_filters_applied_format " ) ,
167- Int64 ( store. appliedFilterCount)
168- )
169- )
170- Button ( role: . destructive) {
171- store. send ( . view( . resetFilters) )
172- } label: {
173- Text ( String ( localized: " push_clear_all_filters " ) )
174- }
175- } label: {
176- HStack ( spacing: 6 ) {
177- Image ( systemName: " line.3.horizontal.decrease " )
178- filterBadge
179- }
180- . adaptiveButtonStyle ( )
181- }
182- }
183-
184- Button {
185- DispatchQueue . main. async {
186- store. send ( . view( . toggleSortOption) )
187- }
188- } label: {
189- let condition = store. query. sortOrder == . oldest
160+ HStack ( spacing: 8 ) {
161+ if 0 < store. appliedFilterCount {
162+ Menu {
190163 Text (
191164 String . localizedStringWithFormat (
192- String ( localized: " push_sort_format " ) ,
193- store. query . sortOrder . title
165+ String ( localized: " push_filters_applied_format " ) ,
166+ Int64 ( store. appliedFilterCount )
194167 )
195168 )
196- . foregroundStyle ( condition ? . white : Color ( . label) )
197- . adaptiveButtonStyle ( color: condition ? . blue : . clear)
198- }
199- . frame ( height: headerHeight)
200-
201- Menu {
202- Picker ( selection: $store. query. timeFilter) {
203- ForEach ( PushNotificationQuery . TimeFilter. availableOptions, id: \. self) { option in
204- Text ( option. title) . tag ( option)
205- }
169+ Button ( role: . destructive) {
170+ store. send ( . view( . resetFilters) )
206171 } label: {
207- Text ( String ( localized: " push_period " ) )
172+ Text ( String ( localized: " push_clear_all_filters " ) )
208173 }
209174 } label: {
210- let condition = store. query. timeFilter == . none
211- HStack {
212- Text ( String ( localized: " push_period " ) )
213- Image ( systemName: " chevron.down " )
175+ HStack ( spacing: 6 ) {
176+ Image ( systemName: " line.3.horizontal.decrease " )
177+ filterBadge
214178 }
215- . foregroundStyle ( condition ? Color ( . label) : . white)
216- . adaptiveButtonStyle ( color: condition ? . clear : . blue)
179+ . adaptiveButtonStyle ( )
180+ }
181+ }
182+
183+ Button {
184+ DispatchQueue . main. async {
185+ store. send ( . view( . toggleSortOption) )
217186 }
187+ } label: {
188+ let condition = store. query. sortOrder == . oldest
189+ Text (
190+ String . localizedStringWithFormat (
191+ String ( localized: " push_sort_format " ) ,
192+ store. query. sortOrder. title
193+ )
194+ )
195+ . foregroundStyle ( condition ? . white : Color ( . label) )
196+ . adaptiveButtonStyle ( color: condition ? . blue : . clear)
197+ }
198+ . frame ( height: headerHeight)
218199
219- Button {
220- DispatchQueue . main. async {
221- store. send ( . view( . toggleUnreadOnly) )
200+ Menu {
201+ Picker ( selection: $store. query. timeFilter) {
202+ ForEach ( PushNotificationQuery . TimeFilter. availableOptions, id: \. self) { option in
203+ Text ( option. title) . tag ( option)
222204 }
223205 } label: {
224- let condition = store. query. unreadOnly
225- Text ( String ( localized: " push_unread " ) )
226- . foregroundStyle ( condition ? . white : Color ( . label) )
227- . adaptiveButtonStyle ( color: condition ? . blue : . clear)
206+ Text ( String ( localized: " push_period " ) )
207+ }
208+ } label: {
209+ let condition = store. query. timeFilter == . none
210+ HStack {
211+ Text ( String ( localized: " push_period " ) )
212+ Image ( systemName: " chevron.down " )
228213 }
229- . frame ( height: headerHeight)
214+ . foregroundStyle ( condition ? Color ( . label) : . white)
215+ . adaptiveButtonStyle ( color: condition ? . clear : . blue)
216+ }
217+
218+ Button {
219+ DispatchQueue . main. async {
220+ store. send ( . view( . toggleUnreadOnly) )
221+ }
222+ } label: {
223+ let condition = store. query. unreadOnly
224+ Text ( String ( localized: " push_unread " ) )
225+ . foregroundStyle ( condition ? . white : Color ( . label) )
226+ . adaptiveButtonStyle ( color: condition ? . blue : . clear)
230227 }
228+ . frame ( height: headerHeight)
231229 }
232- . scrollIndicators ( . never)
233- . scrollDisabled ( !isScrollTrackingEnabled)
234- . contentMargins ( . leading, 16 , for: . scrollContent)
230+ . padding ( . leading, 16 )
231+ . frame ( maxWidth: . infinity, alignment: . leading)
235232 . frame ( height: headerHeight)
236233 . onAppear {
237234 headerOffset = 0
0 commit comments