Minor fixes
This commit is contained in:
@@ -9,14 +9,16 @@ public struct SidebarView: View {
|
||||
public init() {}
|
||||
public var body: some View {
|
||||
VStack {
|
||||
if environments.extensionProfileLoading {
|
||||
if ApplicationLibrary.inPreview {
|
||||
SidebarViewPreview()
|
||||
} else if environments.extensionProfileLoading {
|
||||
ProgressView()
|
||||
} else if let profile = environments.extensionProfile {
|
||||
SidebarView0().environmentObject(profile)
|
||||
} else {
|
||||
SidebarView1()
|
||||
}
|
||||
}.frame(minWidth: 150)
|
||||
}
|
||||
}
|
||||
|
||||
struct SidebarView0: View {
|
||||
@@ -69,4 +71,26 @@ public struct SidebarView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SidebarViewPreview: View {
|
||||
@Environment(\.selection) private var selection
|
||||
var body: some View {
|
||||
VStack {
|
||||
List(selection: selection) {
|
||||
Section(NavigationPage.dashboard.title) {
|
||||
Label("Overview", systemImage: "text.and.command.macwindow")
|
||||
.tint(.textColor)
|
||||
.tag(NavigationPage.dashboard)
|
||||
NavigationPage.groups.label.tag(NavigationPage.groups)
|
||||
}
|
||||
Divider()
|
||||
ForEach(NavigationPage.macosDefaultPages, id: \.self) { it in
|
||||
it.label
|
||||
}
|
||||
}
|
||||
.listStyle(.sidebar)
|
||||
.scrollDisabled(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user