Remove images, select tags
This commit is contained in:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user