ChWebsiteApp/CHDataManagement/Views/Settings/PostFeedSettingsView.swift
2025-01-07 11:26:59 +01:00

56 lines
1.8 KiB
Swift

import SwiftUI
struct PostFeedSettingsView: View {
@Environment(\.language)
private var language
@ObservedObject
var postSettings: PostSettings
var body: some View {
ScrollView {
VStack(alignment: .leading) {
DetailTitle(title: "Post Feed Settings",
text: "Change the way the posts are displayed")
IntegerPropertyView(
title: "Content Width",
value: $postSettings.contentWidth,
footer: "The maximum width of the content the post feed (in pixels)")
IntegerPropertyView(
title: "Posts Per Page",
value: $postSettings.postsPerPage,
footer: "The maximum number of posts displayed on a single page")
FilePropertyView(
title: "Default CSS File",
footer: "The CSS file containing the styling of all post pages",
selectedFile: $postSettings.defaultCssFile)
FilePropertyView(
title: "Swiper CSS File",
footer: "The CSS file containing the styling of image galleries in post feeds",
selectedFile: $postSettings.swiperCssFile)
FilePropertyView(
title: "Swiper JavaScript File",
footer: "The JavaScript file to load the image gallery code in post feeds",
selectedFile: $postSettings.swiperJsFile)
LocalizedPostFeedSettingsView(
settings: postSettings.localized(in: language))
.id(language)
}
.padding()
}
}
}
#Preview {
PostFeedSettingsView(postSettings: .default)
.padding()
}