Remove images, select tags

This commit is contained in:
Christoph Hagen
2024-11-24 17:04:01 +01:00
parent 7e91b4b08c
commit 64b6d88a41
5 changed files with 169 additions and 43 deletions

View File

@@ -1,22 +1,5 @@
import SwiftUI
private struct CenteredPost<Content>: View where Content: View {
let content: Content
init(@ViewBuilder content: () -> Content) {
self.content = content()
}
var body: some View {
HorizontalCenter {
content
}
.listRowBackground(ColorPalette.listBackground)
}
}
struct PostList: View {
@EnvironmentObject
@@ -25,13 +8,13 @@ struct PostList: View {
var body: some View {
List {
if content.posts.isEmpty {
CenteredPost {
HorizontalCenter {
Text("No posts yet.")
.padding()
}
.listRowSeparator(.hidden)
}
CenteredPost {
HorizontalCenter {
Button(action: addNewPost) {
Text("Add post")
}
@@ -39,7 +22,7 @@ struct PostList: View {
.listRowSeparator(.hidden)
}
ForEach(content.posts) { post in
CenteredPost {
HorizontalCenter {
PostView(post: post)
.frame(maxWidth: 600)
}
@@ -48,8 +31,7 @@ struct PostList: View {
}
}
.listStyle(.plain)
.background(ColorPalette.listBackground)
.scrollContentBackground(.hidden)
//.scrollContentBackground(.hidden)
}
private func addNewPost() {