mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Refactor macOS/SettingsView tab view into MacAccountView
This commit is contained in:
parent
dfbbed12f8
commit
e2efecb210
@ -24,11 +24,7 @@ struct WriteFreely_MultiPlatformApp: App {
|
||||
#if os(macOS)
|
||||
Settings {
|
||||
TabView(selection: $selectedTab) {
|
||||
Form {
|
||||
Section(header: Text("Login Details")) {
|
||||
AccountView(account: account)
|
||||
}
|
||||
}
|
||||
MacAccountView(account: account)
|
||||
.tabItem {
|
||||
Image(systemName: "person.crop.circle")
|
||||
Text("Account")
|
||||
|
@ -34,7 +34,7 @@
|
||||
1756AE8124CB844500FD7257 /* View+Keyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756AE8024CB844500FD7257 /* View+Keyboard.swift */; };
|
||||
1765F62A24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; };
|
||||
1765F62B24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; };
|
||||
17A5388824DDA31F00DEFF9A /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388724DDA31F00DEFF9A /* SettingsView.swift */; };
|
||||
17A5388824DDA31F00DEFF9A /* MacAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388724DDA31F00DEFF9A /* MacAccountView.swift */; };
|
||||
17A5388C24DDC83F00DEFF9A /* AccountModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388B24DDC83F00DEFF9A /* AccountModel.swift */; };
|
||||
17A5388F24DDEC7400DEFF9A /* AccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5388D24DDEC7400DEFF9A /* AccountView.swift */; };
|
||||
17A5389324DDED0000DEFF9A /* PreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A5389124DDED0000DEFF9A /* PreferencesView.swift */; };
|
||||
@ -86,7 +86,7 @@
|
||||
1756AE7924CB65DF00FD7257 /* PostList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostList.swift; sourceTree = "<group>"; };
|
||||
1756AE8024CB844500FD7257 /* View+Keyboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Keyboard.swift"; sourceTree = "<group>"; };
|
||||
1765F62924E18EA200C9EBF0 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = "<group>"; };
|
||||
17A5388724DDA31F00DEFF9A /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
|
||||
17A5388724DDA31F00DEFF9A /* MacAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacAccountView.swift; sourceTree = "<group>"; };
|
||||
17A5388B24DDC83F00DEFF9A /* AccountModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountModel.swift; sourceTree = "<group>"; };
|
||||
17A5388D24DDEC7400DEFF9A /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = "<group>"; };
|
||||
17A5389124DDED0000DEFF9A /* PreferencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesView.swift; sourceTree = "<group>"; };
|
||||
@ -176,7 +176,7 @@
|
||||
17A5388924DDA50500DEFF9A /* Settings */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
17A5388724DDA31F00DEFF9A /* SettingsView.swift */,
|
||||
17A5388724DDA31F00DEFF9A /* MacAccountView.swift */,
|
||||
1753F6AB24E431CC00309365 /* MacPreferencesView.swift */,
|
||||
);
|
||||
path = Settings;
|
||||
@ -562,7 +562,7 @@
|
||||
1756AE6C24CB1E4B00FD7257 /* Post.swift in Sources */,
|
||||
17A5388F24DDEC7400DEFF9A /* AccountView.swift in Sources */,
|
||||
1756AE7524CB26FA00FD7257 /* PostCell.swift in Sources */,
|
||||
17A5388824DDA31F00DEFF9A /* SettingsView.swift in Sources */,
|
||||
17A5388824DDA31F00DEFF9A /* MacAccountView.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -7,12 +7,12 @@
|
||||
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
19
macOS/Settings/MacAccountView.swift
Normal file
19
macOS/Settings/MacAccountView.swift
Normal file
@ -0,0 +1,19 @@
|
||||
import SwiftUI
|
||||
|
||||
struct MacAccountView: View {
|
||||
@ObservedObject var account: AccountModel
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
Section(header: Text("Login Details")) {
|
||||
AccountView(account: account)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct MacAccountView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
MacAccountView(account: AccountModel())
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsView: View {
|
||||
struct MacAccountView: View {
|
||||
@ObservedObject var preferences: PreferencesModel
|
||||
@ObservedObject var account: AccountModel
|
||||
|
||||
@ -33,12 +33,12 @@ struct SettingsView: View {
|
||||
|
||||
struct SettingsView_AccountTabPreviews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SettingsView(preferences: PreferencesModel(), account: AccountModel(), selectedView: 0)
|
||||
MacAccountView(preferences: PreferencesModel(), account: AccountModel(), selectedView: 0)
|
||||
}
|
||||
}
|
||||
|
||||
struct SettingsView_PreferencesTabPreviews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SettingsView(preferences: PreferencesModel(), account: AccountModel(), selectedView: 1)
|
||||
MacAccountView(preferences: PreferencesModel(), account: AccountModel(), selectedView: 1)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user