mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Separate the sidebar context menu into a standalone different file
This commit is contained in:
@@ -37,103 +37,8 @@ struct SidebarItemView: View {
|
||||
feedIconImageLoader.loadImage(for: feed)
|
||||
}
|
||||
}.contextMenu(menuItems: {
|
||||
menuItems
|
||||
SidebarContextMenu(sidebarItem: sidebarItem)
|
||||
})
|
||||
}
|
||||
|
||||
@ViewBuilder var menuItems: some View {
|
||||
if sidebarItem.representedType == .account {
|
||||
Button(action: {}) {
|
||||
Text("Get Info")
|
||||
#if os(iOS)
|
||||
AppAssets.getInfoImage
|
||||
#endif
|
||||
}
|
||||
Button(action: {}) {
|
||||
Text("Mark All As Read")
|
||||
#if os(iOS)
|
||||
AppAssets.markAllAsReadImage
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if sidebarItem.representedType == .pseudoFeed {
|
||||
Button(action: {}) {
|
||||
Text("Mark All As Read")
|
||||
#if os(iOS)
|
||||
AppAssets.markAllAsReadImage
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if sidebarItem.representedType == .webFeed {
|
||||
Button(action: {}) {
|
||||
Text("Get Info")
|
||||
#if os(iOS)
|
||||
AppAssets.getInfoImage
|
||||
#endif
|
||||
}
|
||||
Button(action: {}) {
|
||||
Text("Mark All As Read")
|
||||
#if os(iOS)
|
||||
AppAssets.markAllAsReadImage
|
||||
#endif
|
||||
}
|
||||
Divider()
|
||||
Button(action: {}) {
|
||||
Text("Open Home Page")
|
||||
#if os(iOS)
|
||||
AppAssets.openInBrowserImage
|
||||
#endif
|
||||
}
|
||||
Divider()
|
||||
Button(action: {}) {
|
||||
Text("Copy Feed URL")
|
||||
#if os(iOS)
|
||||
AppAssets.copyImage
|
||||
#endif
|
||||
}
|
||||
Button(action: {}) {
|
||||
Text("Copy Home Page URL")
|
||||
#if os(iOS)
|
||||
AppAssets.copyImage
|
||||
#endif
|
||||
}
|
||||
Divider()
|
||||
Button(action: {}) {
|
||||
Text("Rename")
|
||||
#if os(iOS)
|
||||
AppAssets.renameImage
|
||||
#endif
|
||||
}
|
||||
Button(action: {}) {
|
||||
Text("Delete")
|
||||
#if os(iOS)
|
||||
AppAssets.deleteImage
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if sidebarItem.representedType == .folder {
|
||||
Button(action: {}) {
|
||||
Text("Mark All As Read")
|
||||
#if os(iOS)
|
||||
AppAssets.markAllAsReadImage
|
||||
#endif
|
||||
}
|
||||
Divider()
|
||||
Button(action: {}) {
|
||||
Text("Rename")
|
||||
#if os(iOS)
|
||||
AppAssets.renameImage
|
||||
#endif
|
||||
}
|
||||
Button(action: {}) {
|
||||
Text("Delete")
|
||||
#if os(iOS)
|
||||
AppAssets.deleteImage
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user