Add hiding short videos

This commit is contained in:
Arkadiusz Fal
2023-02-25 16:42:18 +01:00
parent ef401168ec
commit 2b18f0cffa
18 changed files with 163 additions and 20 deletions

View File

@@ -10,6 +10,7 @@ struct TrendingView: View {
@Default(.trendingCountry) private var country
@Default(.trendingListingStyle) private var trendingListingStyle
@Default(.hideShorts) private var hideShorts
@State private var presentingCountrySelection = false
@@ -51,6 +52,7 @@ struct TrendingView: View {
#endif
}
.environment(\.listingStyle, trendingListingStyle)
.environment(\.hideShorts, hideShorts)
}
.toolbar {
@@ -133,6 +135,10 @@ struct TrendingView: View {
ToolbarItem {
ListingStyleButtons(listingStyle: $trendingListingStyle)
}
ToolbarItem {
HideShortsButtons(hide: $hideShorts)
}
}
#else
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
@@ -182,6 +188,10 @@ struct TrendingView: View {
ListingStyleButtons(listingStyle: $trendingListingStyle)
Section {
HideShortsButtons(hide: $hideShorts)
}
Section {
SettingsButtons()
}