mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-06-02 21:39:36 +00:00
40 lines
1.1 KiB
Swift
40 lines
1.1 KiB
Swift
import Env
|
|
import Models
|
|
import SwiftUI
|
|
|
|
struct TimelineTagGroupheaderView: View {
|
|
@Environment(RouterPath.self) private var routerPath
|
|
|
|
@Binding var group: TagGroup?
|
|
@Binding var timeline: TimelineFilter
|
|
|
|
var body: some View {
|
|
if let group {
|
|
TimelineHeaderView {
|
|
HStack {
|
|
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)
|
|
}
|
|
}
|
|
}
|
|
.scrollIndicators(.hidden)
|
|
Button("status.action.edit") {
|
|
routerPath.presentedSheet = .editTagGroup(tagGroup: group, onSaved: { group in
|
|
timeline = .tagGroup(title: group.title, tags: group.tags, symbolName: group.symbolName)
|
|
})
|
|
}
|
|
.buttonStyle(.bordered)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|