Cleanup code
This commit is contained in:
parent
2afe98cf77
commit
1e8ba5000b
|
@ -13,7 +13,18 @@ struct AdvancedPrefsView : View {
|
|||
|
||||
var body: some View {
|
||||
List {
|
||||
Section(footer: Text("This option is only supported for Pleroma and Mastodon instances with formatting enabled. On all other instances, formatting symbols will remain in the unformatted plain text.").lineLimit(nil)) {
|
||||
formattingSection
|
||||
automationSection
|
||||
}.listStyle(.grouped)
|
||||
.navigationBarTitle(Text("Advanced"))
|
||||
}
|
||||
|
||||
var formattingFooter: some View {
|
||||
Text("This option is only supported for Pleroma and Mastodon instances with formatting enabled. On all other instances, formatting symbols will remain in the unformatted plain text.").lineLimit(nil)
|
||||
}
|
||||
|
||||
var formattingSection: some View {
|
||||
Section(footer: formattingFooter) {
|
||||
Picker(selection: _statusContentType.binding, label: Text("Post Content Type")) {
|
||||
ForEach(StatusContentType.allCases, id: \.self) { type in
|
||||
Text(type.displayName).tag(type)
|
||||
|
@ -21,15 +32,27 @@ struct AdvancedPrefsView : View {
|
|||
// see FB6838291
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var automationSection: some View {
|
||||
Section(header: Text("AUTOMATION")) {
|
||||
NavigationLink(destination: SilentActionPrefs()) {
|
||||
Text("Silent Action Permissions")
|
||||
}
|
||||
}
|
||||
}
|
||||
.listStyle(.grouped)
|
||||
.navigationBarTitle(Text("Advanced"))
|
||||
}
|
||||
|
||||
extension StatusContentType {
|
||||
var displayName: String {
|
||||
switch self {
|
||||
case .plain:
|
||||
return "Plain"
|
||||
case .markdown:
|
||||
return "Markdown"
|
||||
case .html:
|
||||
return "HTML"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,13 @@ struct BehaviorPrefsView : View {
|
|||
|
||||
var body: some View {
|
||||
List {
|
||||
section1
|
||||
section2
|
||||
}.listStyle(.grouped)
|
||||
.navigationBarTitle(Text("Behavior"))
|
||||
}
|
||||
|
||||
var section1: some View {
|
||||
Section {
|
||||
Picker(selection: _defaultPostVisibility.binding, label: Text("Default Post Visibility")) {
|
||||
ForEach(Status.Visibility.allCases, id: \.self) { visibility in
|
||||
|
@ -30,15 +37,15 @@ struct BehaviorPrefsView : View {
|
|||
Text("Automatically Save Drafts")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var section2: some View {
|
||||
Section {
|
||||
Toggle(isOn: _openLinksInApps.binding) {
|
||||
Text("Open Links in Apps")
|
||||
}
|
||||
}
|
||||
}
|
||||
.listStyle(.grouped)
|
||||
.navigationBarTitle(Text("Behavior"))
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
|
Loading…
Reference in New Issue