From 177c18d4ead26ae3c422e7f63a951d0e300e1c07 Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Mon, 27 Jul 2020 13:39:39 +0530 Subject: [PATCH 1/3] Adds Menu for "Add" tool bar button --- .../Sidebar/SidebarToolbarModifier.swift | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift b/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift index c66ce0ed1..2082b2678 100644 --- a/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift +++ b/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift @@ -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 }) - ]) - } + }) }) } From 2987c9742e64bd972143a3c72fc55dfa5ca19026 Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Mon, 27 Jul 2020 13:41:23 +0530 Subject: [PATCH 2/3] Remove action sheet var on sidebar toolbar model --- Multiplatform/Shared/Sidebar/SidebarToolbarModel.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Multiplatform/Shared/Sidebar/SidebarToolbarModel.swift b/Multiplatform/Shared/Sidebar/SidebarToolbarModel.swift index d2fe4cea2..d5b3ad00d 100644 --- a/Multiplatform/Shared/Sidebar/SidebarToolbarModel.swift +++ b/Multiplatform/Shared/Sidebar/SidebarToolbarModel.swift @@ -20,7 +20,6 @@ class SidebarToolbarModel: ObservableObject { sheetToShow != .none ? (showSheet = true) : (showSheet = false) } } - @Published var showActionSheet: Bool = false @Published var showAddSheet: Bool = false } From 2528d1e9d7e9648a293d48074c6ea4fcc201ac07 Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Mon, 27 Jul 2020 13:43:07 +0530 Subject: [PATCH 3/3] Add Twitter and Reddit button actions --- Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift b/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift index 2082b2678..9d604c2a5 100644 --- a/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift +++ b/Multiplatform/Shared/Sidebar/SidebarToolbarModifier.swift @@ -70,8 +70,8 @@ struct SidebarToolbarModifier: ViewModifier { ToolbarItem(placement: .bottomBar, content: { 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 = .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)