mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-06-05 13:28:50 +00:00
Add quick access button to explore screen
This commit is contained in:
parent
ab834be2f3
commit
4943a1708c
1 changed files with 26 additions and 0 deletions
|
@ -19,6 +19,7 @@ public struct ExploreView: View {
|
||||||
public var body: some View {
|
public var body: some View {
|
||||||
List {
|
List {
|
||||||
if !viewModel.isLoaded {
|
if !viewModel.isLoaded {
|
||||||
|
quickAccessView
|
||||||
loadingView
|
loadingView
|
||||||
} else if !viewModel.searchQuery.isEmpty {
|
} else if !viewModel.searchQuery.isEmpty {
|
||||||
if let results = viewModel.results[viewModel.searchQuery] {
|
if let results = viewModel.results[viewModel.searchQuery] {
|
||||||
|
@ -48,6 +49,7 @@ public struct ExploreView: View {
|
||||||
.listRowBackground(theme.secondaryBackgroundColor)
|
.listRowBackground(theme.secondaryBackgroundColor)
|
||||||
.listRowSeparator(.hidden)
|
.listRowSeparator(.hidden)
|
||||||
} else {
|
} else {
|
||||||
|
quickAccessView
|
||||||
if !viewModel.trendingTags.isEmpty {
|
if !viewModel.trendingTags.isEmpty {
|
||||||
trendingTagsSection
|
trendingTagsSection
|
||||||
}
|
}
|
||||||
|
@ -84,6 +86,30 @@ public struct ExploreView: View {
|
||||||
prompt: Text("explore.search.prompt"))
|
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 {
|
private var loadingView: some View {
|
||||||
ForEach(Status.placeholders()) { status in
|
ForEach(Status.placeholders()) { status in
|
||||||
StatusRowView(viewModel: { .init(status: status, client: client, routerPath: routerPath) })
|
StatusRowView(viewModel: { .init(status: status, client: client, routerPath: routerPath) })
|
||||||
|
|
Loading…
Reference in a new issue