Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add LocationFilterToolbarContent to summary toolbar #970

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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