mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-22 21:08:15 +01:00
Add quick access button to explore screen
This commit is contained in:
parent
ab834be2f3
commit
4943a1708c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user