consolidate tags, hide date

This commit is contained in:
Christoph Hagen
2025-01-05 12:19:32 +01:00
parent 93e642c3c9
commit 5ac5a7b000
26 changed files with 284 additions and 129 deletions

View File

@ -0,0 +1,42 @@
import SwiftUI
struct TagDisplayView: View {
@Environment(\.language)
private var language
@EnvironmentObject
private var content: Content
@Binding
var tags: [Tag]
@State
private var showTagPicker = false
var body: some View {
FlowHStack {
ForEach(tags, id: \.id) { tag in
TagView(text: tag.localized(in: language).name)
.foregroundStyle(.white)
}
Button(action: { showTagPicker = true }) {
Image(systemSymbol: .squareAndPencilCircleFill)
.resizable()
.aspectRatio(1, contentMode: .fit)
.frame(height: 22)
.foregroundColor(Color.gray)
.background(Circle()
.fill(Color.white)
.padding(1))
}
.buttonStyle(.plain)
}
.sheet(isPresented: $showTagPicker) {
TagSelectionView(
presented: $showTagPicker,
selected: $tags,
tags: $content.tags)
}
}
}