Adds Menu for "Add" tool bar button

This commit is contained in:
Rizwan Mohamed Ibrahim 2020-07-27 13:39:39 +05:30
parent dbe662b7db
commit 177c18d4ea
No known key found for this signature in database
GPG Key ID: D5BEE468D448BCC5
1 changed files with 7 additions and 14 deletions

View File

@ -68,21 +68,14 @@ struct SidebarToolbarModifier: ViewModifier {
}
ToolbarItem(placement: .bottomBar, content: {
Button {
viewModel.showActionSheet = true
} label: {
Menu(content: {
Button { viewModel.sheetToShow = .web } label: { Text("Add Web Feed") }
Button { /* TODO:- Add Twitter Feed */ } label: { Text("Add Twitter Feed") }
Button { /* TODO:- Add Reddit Feed */ } label: { Text("Add Reddit Feed") }
Button { viewModel.sheetToShow = .folder } label: { Text("Add Folder") }
}, label: {
AppAssets.addMenuImage.font(.title3)
}
.help("Add")
.actionSheet(isPresented: $viewModel.showActionSheet) {
ActionSheet(title: Text("Add"), buttons: [
.cancel(),
.default(Text("Add Web Feed"), action: { viewModel.sheetToShow = .web }),
.default(Text("Add Twitter Feed")),
.default(Text("Add Reddit Feed")),
.default(Text("Add Folder"), action: { viewModel.sheetToShow = .folder })
])
}
})
})
}