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