Merge pull request #2305 from rizwankce/add-toolbar-button-menu
Add toolbar button menu
This commit is contained in:
commit
c3ca910e20
|
@ -20,7 +20,6 @@ class SidebarToolbarModel: ObservableObject {
|
|||
sheetToShow != .none ? (showSheet = true) : (showSheet = false)
|
||||
}
|
||||
}
|
||||
@Published var showActionSheet: Bool = false
|
||||
@Published var showAddSheet: Bool = false
|
||||
|
||||
}
|
||||
|
|
|
@ -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 { viewModel.sheetToShow = .twitter } label: { Text("Add Twitter Feed") }
|
||||
Button { viewModel.sheetToShow = .reddit } 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 })
|
||||
])
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue