diff --git a/Packages/Explore/Sources/Explore/ExploreView.swift b/Packages/Explore/Sources/Explore/ExploreView.swift index 61c68ee1..24559527 100644 --- a/Packages/Explore/Sources/Explore/ExploreView.swift +++ b/Packages/Explore/Sources/Explore/ExploreView.swift @@ -19,6 +19,7 @@ public struct ExploreView: View { public var body: some View { List { if !viewModel.isLoaded { + quickAccessView loadingView } else if !viewModel.searchQuery.isEmpty { if let results = viewModel.results[viewModel.searchQuery] { @@ -48,6 +49,7 @@ public struct ExploreView: View { .listRowBackground(theme.secondaryBackgroundColor) .listRowSeparator(.hidden) } else { + quickAccessView if !viewModel.trendingTags.isEmpty { trendingTagsSection } @@ -83,6 +85,30 @@ public struct ExploreView: View { placement: .navigationBarDrawer(displayMode: .always), prompt: Text("explore.search.prompt")) } + + private var quickAccessView: some View { + ScrollView(.horizontal) { + HStack { + Button("explore.section.trending.tags") { + routerPath.navigate(to: RouterDestination.tagsList(tags: viewModel.trendingTags)) + } + .buttonStyle(.bordered) + Button("explore.section.suggested-users") { + routerPath.navigate(to: RouterDestination.accountsList(accounts: viewModel.suggestedAccounts)) + } + .buttonStyle(.bordered) + Button("explore.section.trending.posts") { + routerPath.navigate(to: RouterDestination.trendingTimeline) + } + .buttonStyle(.bordered) + } + .padding(.horizontal, 16) + } + .scrollIndicators(.never) + .listRowInsets(EdgeInsets()) + .listRowBackground(theme.secondaryBackgroundColor) + .listRowSeparator(.hidden) + } private var loadingView: some View { ForEach(Status.placeholders()) { status in