Consolidate images and files

This commit is contained in:
Christoph Hagen
2024-12-09 12:18:55 +01:00
parent 394cf7a2e4
commit 4f08526978
77 changed files with 1970 additions and 1619 deletions

View File

@ -10,11 +10,24 @@ struct PostContentView: View {
@Environment(\.language)
private var language
init(post: Post) {
self.post = post
}
var body: some View {
LocalizedPostContentView(post: post)
}
}
extension PostContentView: MainContentView {
init(item: Post) {
self.post = item
}
static let itemDescription = "a post"
}
private struct LocalizedTitle: View {
@ObservedObject
@ -44,9 +57,13 @@ private struct LocalizedContentEditor: View {
var body: some View {
TextEditor(text: $post.content)
// HighlightedTextEditor(
// text: $post.content,
// highlightRules: .markdown)
.font(.body)
.frame(minHeight: 150)
.textEditorStyle(.plain)
.padding(.vertical, 8)
.padding(.leading, 3)
.background(Color.gray.opacity(0.1))
.cornerRadius(8)
}
}
@ -76,10 +93,7 @@ struct LocalizedPostContentView: View {
LocalizedTitle(post: post.localized(in: language))
FlowHStack {
ForEach(post.tags, id: \.id) { tag in
TagView(tag: .init(
en: tag.english.name,
de: tag.german.name)
)
TagView(text: tag.localized(in: language).name)
.foregroundStyle(.white)
}
Button(action: { showTagPicker = true }) {