Consolidate images and files
This commit is contained in:
@ -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 }) {
|
||||
|
Reference in New Issue
Block a user