2020-08-07 20:30:09 +00:00
|
|
|
import SwiftUI
|
|
|
|
|
2020-08-12 14:36:49 +00:00
|
|
|
struct MacAccountView: View {
|
2020-08-11 18:32:45 +00:00
|
|
|
@ObservedObject var preferences: PreferencesModel
|
2020-08-11 21:03:17 +00:00
|
|
|
@ObservedObject var account: AccountModel
|
2020-08-11 18:32:45 +00:00
|
|
|
|
2020-08-07 20:30:09 +00:00
|
|
|
@State var selectedView = 0
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
TabView(selection: $selectedView) {
|
2020-08-10 17:51:07 +00:00
|
|
|
Form {
|
2020-08-10 18:30:23 +00:00
|
|
|
Section(header: Text("Login Details")) {
|
2020-08-11 21:03:17 +00:00
|
|
|
AccountView(account: account)
|
2020-08-07 20:30:09 +00:00
|
|
|
}
|
2020-08-10 17:51:07 +00:00
|
|
|
}
|
|
|
|
.tabItem {
|
|
|
|
Image(systemName: "person.crop.circle")
|
|
|
|
Text("Account")
|
|
|
|
}
|
|
|
|
.tag(0)
|
2020-08-10 18:30:23 +00:00
|
|
|
VStack {
|
2020-08-11 18:32:45 +00:00
|
|
|
PreferencesView(preferences: preferences)
|
2020-08-10 18:30:23 +00:00
|
|
|
Spacer()
|
2020-08-10 17:51:07 +00:00
|
|
|
}
|
|
|
|
.tabItem {
|
|
|
|
Image(systemName: "gear")
|
|
|
|
Text("Preferences")
|
|
|
|
}
|
|
|
|
.tag(1)
|
2020-08-07 20:30:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct SettingsView_AccountTabPreviews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
2020-08-12 14:36:49 +00:00
|
|
|
MacAccountView(preferences: PreferencesModel(), account: AccountModel(), selectedView: 0)
|
2020-08-07 20:30:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct SettingsView_PreferencesTabPreviews: PreviewProvider {
|
|
|
|
static var previews: some View {
|
2020-08-12 14:36:49 +00:00
|
|
|
MacAccountView(preferences: PreferencesModel(), account: AccountModel(), selectedView: 1)
|
2020-08-07 20:30:09 +00:00
|
|
|
}
|
|
|
|
}
|