summaryrefslogtreecommitdiff
path: root/Sora/Views/SettingsView.swift
blob: 5a42cd1d37fb5a183e2f4928e45d6b13c4b655c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import SwiftUI

struct SettingsView: View {
    @EnvironmentObject var settings: Settings

    var body: some View {
        Form {
            Section(header: Text("Provider")) {
                SettingsProviderView()
            }

            Section(header: Text("Thumbnails")) {
                SettingsThumbnailsView()
            }

            Section(header: Text("Details")) {
                SettingsDetailsView()
            }

            Section(header: Text("Search")) {
                SettingsSearchView()
            }

            Section(header: Text("Settings")) {
                Button("Reset to Defaults") {
                    self.settings.resetToDefaults()
                }
            }

            Section(header: Text("Attributions")) {
                SettingsAttributionsView()
            }
        }
        #if os(macOS)
        .formStyle(.grouped)
        #endif
        .navigationTitle("Settings")
    }
}

#Preview {
    SettingsView()
        .environmentObject(Settings())
}