Show page tags

This commit is contained in:
Christoph Hagen
2025-01-05 10:38:20 +01:00
parent 5684196ef3
commit 93e642c3c9
5 changed files with 47 additions and 11 deletions

View File

@ -43,6 +43,7 @@ private struct LocalizedTitle: View {
.foregroundStyle(Color.primary)
.textFieldStyle(.plain)
.lineLimit(2)
.frame(minHeight: 30)
}
}
@ -87,8 +88,11 @@ struct LocalizedPostContentView: View {
var body: some View {
VStack(alignment: .leading) {
Text("Images")
.font(.headline)
HStack {
Text("Images")
.font(.headline)
Button("Transfer from \(language.next.text)", action: copyImagesFromOtherLanguage)
}
PostImagesView(post: post.localized(in: language))
LocalizedTitle(post: post.localized(in: language))
FlowHStack {
@ -119,8 +123,9 @@ struct LocalizedPostContentView: View {
}
}
private func remove(tag: Tag) {
post.tags = post.tags.filter {$0.id != tag.id }
private func copyImagesFromOtherLanguage() {
let images = post.localized(in: language.next).images
post.localized(in: language).images = images
}
}