mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 10:11:00 +00:00
Scrollable + interactive Tag Group timeline header
This commit is contained in:
parent
3407f05003
commit
bb4453c811
2 changed files with 12 additions and 11 deletions
|
@ -79,10 +79,4 @@ public struct TagGroup: Codable, Equatable, Hashable {
|
||||||
public var tags: [String] {
|
public var tags: [String] {
|
||||||
[main] + additional
|
[main] + additional
|
||||||
}
|
}
|
||||||
|
|
||||||
public var description: String {
|
|
||||||
tags
|
|
||||||
.map { "#\($0)" }
|
|
||||||
.joined(separator: " ")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,13 +212,20 @@ public struct TimelineView: View {
|
||||||
private var tagGroupHeaderView: some View {
|
private var tagGroupHeaderView: some View {
|
||||||
if let group = viewModel.tagGroup {
|
if let group = viewModel.tagGroup {
|
||||||
headerView {
|
headerView {
|
||||||
HStack {
|
ScrollView(.horizontal) {
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
Text(group.description)
|
ForEach(group.tags, id: \.self) { tag in
|
||||||
.font(.scaledHeadline)
|
Button {
|
||||||
|
routerPath.navigate(to: .hashTag(tag: tag, account: nil))
|
||||||
|
} label: {
|
||||||
|
Text("#\(tag)")
|
||||||
|
.font(.scaledHeadline)
|
||||||
|
}
|
||||||
|
.buttonStyle(.plain)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.accessibilityElement(children: .combine)
|
|
||||||
}
|
}
|
||||||
|
.scrollIndicators(.hidden)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue