From d51fa4672adb97f9a259ab86886c08c3ca12fea3 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Wed, 6 Jan 2021 13:37:56 -0500 Subject: [PATCH] Remove unnecessary SidebarView SidebarView literally just calls CollectionListView and provides no other functionality or state management; ContentView can therefore just call CollectionListView directly. --- Shared/Navigation/ContentView.swift | 6 +++--- Shared/Navigation/SidebarView.swift | 18 ------------------ .../project.pbxproj | 6 ------ .../xcschemes/xcschememanagement.plist | 4 ++-- 4 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 Shared/Navigation/SidebarView.swift diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index e8cd97c..1b599c0 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -6,7 +6,7 @@ struct ContentView: View { var body: some View { NavigationView { #if os(macOS) - SidebarView() + CollectionListView() .toolbar { Button( action: { @@ -49,12 +49,12 @@ struct ContentView: View { .help("Create a new local draft.") } #else - SidebarView() + CollectionListView() #endif #if os(macOS) ZStack { - PostListView(selectedCollection: nil, showAllPosts: model.account.isLoggedIn) + PostListView(selectedCollection: nil, showAllPosts: false) //model.account.isLoggedIn) if model.isProcessingRequest { ZStack { Color(NSColor.controlBackgroundColor).opacity(0.75) diff --git a/Shared/Navigation/SidebarView.swift b/Shared/Navigation/SidebarView.swift deleted file mode 100644 index b4c9719..0000000 --- a/Shared/Navigation/SidebarView.swift +++ /dev/null @@ -1,18 +0,0 @@ -import SwiftUI - -struct SidebarView: View { - var body: some View { - CollectionListView() - } -} - -struct SidebarView_Previews: PreviewProvider { - static var previews: some View { - let context = LocalStorageManager.persistentContainer.viewContext - let model = WriteFreelyModel() - - return SidebarView() - .environment(\.managedObjectContext, context) - .environmentObject(model) - } -} diff --git a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj index d8287f1..40e0dde 100644 --- a/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj +++ b/WriteFreely-MultiPlatform.xcodeproj/project.pbxproj @@ -48,8 +48,6 @@ 1756DC0224FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DBFF24FEE18400207AB8 /* WFACollection+CoreDataClass.swift */; }; 1756DC0324FEE18400207AB8 /* WFACollection+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */; }; 1756DC0424FEE18400207AB8 /* WFACollection+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */; }; - 1765F62A24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; }; - 1765F62B24E18EA200C9EBF0 /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1765F62924E18EA200C9EBF0 /* SidebarView.swift */; }; 17681E412519410E00D394AE /* UINavigationController+Appearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17681E402519410E00D394AE /* UINavigationController+Appearance.swift */; }; 1780F6EF25895EDB00FE45FF /* PostCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1780F6EE25895EDB00FE45FF /* PostCommands.swift */; }; 17A4FEDA25924AF70037E96B /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 17A4FED925924AF70037E96B /* Sparkle */; }; @@ -146,7 +144,6 @@ 1756DBB924FED45500207AB8 /* LocalStorageManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalStorageManager.swift; sourceTree = ""; }; 1756DBFF24FEE18400207AB8 /* WFACollection+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WFACollection+CoreDataClass.swift"; sourceTree = SOURCE_ROOT; }; 1756DC0024FEE18400207AB8 /* WFACollection+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WFACollection+CoreDataProperties.swift"; sourceTree = SOURCE_ROOT; }; - 1765F62924E18EA200C9EBF0 /* SidebarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SidebarView.swift; sourceTree = ""; }; 17681E402519410E00D394AE /* UINavigationController+Appearance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UINavigationController+Appearance.swift"; sourceTree = ""; }; 1780F6EE25895EDB00FE45FF /* PostCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostCommands.swift; sourceTree = ""; }; 17A4FEDF25924E810037E96B /* MacSoftwareUpdater.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = MacSoftwareUpdater.md; sourceTree = ""; }; @@ -457,7 +454,6 @@ isa = PBXGroup; children = ( 17DF328224C87D3300BCE2E3 /* ContentView.swift */, - 1765F62924E18EA200C9EBF0 /* SidebarView.swift */, ); path = Navigation; sourceTree = ""; @@ -745,7 +741,6 @@ 1756AE7724CB2EDD00FD7257 /* PostEditorView.swift in Sources */, 17DF32D524C8CA3400BCE2E3 /* PostStatusBadgeView.swift in Sources */, 17D435E824E3128F0036B539 /* PreferencesModel.swift in Sources */, - 1765F62A24E18EA200C9EBF0 /* SidebarView.swift in Sources */, 1756AE7A24CB65DF00FD7257 /* PostListView.swift in Sources */, 17B996D82502D23E0017B536 /* WFAPost+CoreDataClass.swift in Sources */, 1756DC0124FEE18400207AB8 /* WFACollection+CoreDataClass.swift in Sources */, @@ -769,7 +764,6 @@ buildActionMask = 2147483647; files = ( 17DF32AD24C87D3500BCE2E3 /* ContentView.swift in Sources */, - 1765F62B24E18EA200C9EBF0 /* SidebarView.swift in Sources */, 1756DBBB24FED45500207AB8 /* LocalStorageManager.swift in Sources */, 17A4FEED25927E730037E96B /* AppDelegate.swift in Sources */, 174D313324EC2831006CA9EE /* WriteFreelyModel.swift in Sources */, 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