Skip to content

Commit

Permalink
add LocationFilterToolbarContent to summary toolbar (#970)
Browse files Browse the repository at this point in the history
The summary will have this if the category is location filterable.
  • Loading branch information
bolsinga authored Oct 12, 2024
1 parent 7eb6fb1 commit 792ec2a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
17 changes: 17 additions & 0 deletions Sources/Site/Music/UI/ArchiveCategory+LocationFilterable.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// ArchiveCategory+LocationFilterable.swift
// site
//
// Created by Greg Bolsinga on 10/11/24.
//

extension ArchiveCategory {
var isLocationFilterable: Bool {
switch self {
case .today, .stats:
false
case .shows, .venues, .artists:
true
}
}
}
4 changes: 4 additions & 0 deletions Sources/Site/Music/UI/ArchiveCategoryDetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ struct ArchiveCategoryDetail: View {
}
)
.toolbar {
if category.isLocationFilterable {
@Bindable var bindableNearbyModel = nearbyModel
LocationFilterToolbarContent(isOn: $bindableNearbyModel.locationFilter.toggle)
}
ArchiveSharableToolbarContent(
item: ArchiveCategoryLinkable(vault: model.vault, category: category))
}
Expand Down
1 change: 0 additions & 1 deletion Sources/Site/Music/UI/ArtistsSummary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct ArtistsSummary: View {
locationAuthorization: model.locationAuthorization,
geocodingProgress: model.geocodingProgress, filteredDataIsEmpty: artistDigests.isEmpty
)
.locationFilter(nearbyModel)
}
}

Expand Down
24 changes: 0 additions & 24 deletions Sources/Site/Music/UI/LocationFilterModifier.swift

This file was deleted.

1 change: 0 additions & 1 deletion Sources/Site/Music/UI/ShowsSummary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ struct ShowsSummary: View {
locationAuthorization: model.locationAuthorization,
geocodingProgress: model.geocodingProgress, filteredDataIsEmpty: decadesMap.isEmpty
)
.locationFilter(nearbyModel)
}
}

Expand Down
1 change: 0 additions & 1 deletion Sources/Site/Music/UI/VenuesSummary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct VenuesSummary: View {
locationAuthorization: model.locationAuthorization,
geocodingProgress: model.geocodingProgress, filteredDataIsEmpty: venueDigests.isEmpty
)
.locationFilter(nearbyModel)
}
}

Expand Down

0 comments on commit 792ec2a

Please sign in to comment.