diff --git a/Shared/WriteFreely_MultiPlatformApp.swift b/Shared/WriteFreely_MultiPlatformApp.swift index ddc58cf..53fee33 100644 --- a/Shared/WriteFreely_MultiPlatformApp.swift +++ b/Shared/WriteFreely_MultiPlatformApp.swift @@ -24,16 +24,12 @@ 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") } - } - .tabItem { - Image(systemName: "person.crop.circle") - Text("Account") - } - .tag(0) + .tag(0) MacPreferencesView(preferences: preferences) .tabItem { Image(systemName: "gear") diff --git a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj index 3580b6d..3b1fbe8 100644 --- a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj +++ b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj @@ -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 = ""; }; 1756AE8024CB844500FD7257 /* View+Keyboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Keyboard.swift"; sourceTree = ""; }; 1765F62924E18EA200C9EBF0 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = ""; }; - 17A5388724DDA31F00DEFF9A /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; + 17A5388724DDA31F00DEFF9A /* MacAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacAccountView.swift; sourceTree = ""; }; 17A5388B24DDC83F00DEFF9A /* AccountModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountModel.swift; sourceTree = ""; }; 17A5388D24DDEC7400DEFF9A /* AccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountView.swift; sourceTree = ""; }; 17A5389124DDED0000DEFF9A /* PreferencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesView.swift; sourceTree = ""; }; @@ -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; }; diff --git a/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist b/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist index 2723ebe..6cd8075 100644 --- a/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,12 +7,12 @@ WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_ orderHint - 0 + 1 WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_ orderHint - 1 + 0 diff --git a/macOS/Settings/MacAccountView.swift b/macOS/Settings/MacAccountView.swift new file mode 100644 index 0000000..b37b6da --- /dev/null +++ b/macOS/Settings/MacAccountView.swift @@ -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()) + } +} diff --git a/macOS/Settings/SettingsView.swift b/macOS/Settings/SettingsView.swift index 83f29e8..16c7df8 100644 --- a/macOS/Settings/SettingsView.swift +++ b/macOS/Settings/SettingsView.swift @@ -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) } }