Home changes

This commit is contained in:
Arkadiusz Fal 2023-05-23 19:06:49 +02:00
parent 50e1491990
commit 35867ba14a

View File

@ -200,7 +200,12 @@ struct HomeView: View {
.frame(minWidth: 360) .frame(minWidth: 360)
#endif #endif
#if os(iOS) #if os(iOS)
.navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode) .navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .principal) {
homeMenu
}
}
#endif #endif
#if !os(macOS) #if !os(macOS)
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in .onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
@ -220,11 +225,34 @@ struct HomeView: View {
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
#if os(iOS)
var homeMenu: some View {
Menu {
Section {
HideWatchedButtons()
HideShortsButtons()
}
} label: {
HStack(spacing: 12) {
Text("Home")
.foregroundColor(.primary)
.font(.headline)
Image(systemName: "chevron.down.circle.fill")
.foregroundColor(.accentColor)
.imageScale(.small)
}
.transaction { t in t.animation = nil }
}
}
#endif
} }
struct Home_Previews: PreviewProvider { struct Home_Previews: PreviewProvider {
static var previews: some View { static var previews: some View {
TabView { TabView {
NavigationView {
HomeView() HomeView()
.injectFixtureEnvironmentObjects() .injectFixtureEnvironmentObjects()
.tabItem { .tabItem {
@ -232,4 +260,5 @@ struct Home_Previews: PreviewProvider {
} }
} }
} }
}
} }