Implement hack to hide disclosure chevrons

This commit is contained in:
Maurice Parker 2020-07-05 19:21:23 -05:00
parent 9126ec424d
commit 6c5655191e
2 changed files with 16 additions and 4 deletions

View File

@ -25,18 +25,27 @@ struct SidebarView: View {
if let containerID = sidebarItem.containerID {
DisclosureGroup(isExpanded: $expandedContainers[containerID]) {
ForEach(sidebarItem.children) { sidebarItem in
NavigationLink(destination: (TimelineContainerView(feed: sidebarItem.feed))) {
ZStack {
SidebarItemView(sidebarItem: sidebarItem)
NavigationLink(destination: (TimelineContainerView(feed: sidebarItem.feed))) {
EmptyView()
}.buttonStyle(PlainButtonStyle())
}
}
} label: {
NavigationLink(destination: (TimelineContainerView(feed: sidebarItem.feed))) {
ZStack {
SidebarItemView(sidebarItem: sidebarItem)
NavigationLink(destination: (TimelineContainerView(feed: sidebarItem.feed))) {
EmptyView()
}.buttonStyle(PlainButtonStyle())
}
}
} else {
NavigationLink(destination: (TimelineContainerView(feed: sidebarItem.feed))) {
ZStack {
SidebarItemView(sidebarItem: sidebarItem)
NavigationLink(destination: (TimelineContainerView(feed: sidebarItem.feed))) {
EmptyView()
}.buttonStyle(PlainButtonStyle())
}
}
}

View File

@ -14,11 +14,14 @@ struct TimelineView: View {
var body: some View {
List(timelineModel.timelineItems) { timelineItem in
NavigationLink(destination: (ArticleContainerView(article: timelineItem.article))) {
ZStack {
TimelineItemView(timelineItem: timelineItem)
.onAppear {
timelineModel.loadMoreTimelineItemsIfNecessary(timelineItem)
}
NavigationLink(destination: (ArticleContainerView(article: timelineItem.article))) {
EmptyView()
}.buttonStyle(PlainButtonStyle())
}
}
}