From a18304f4a32033831176903838422cd2b2e8a2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=E2=80=99Aquino?= Date: Fri, 6 Oct 2023 19:47:13 +0000 Subject: [PATCH] ui: Add merch store button to sidebar menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Features: - Merch button on sidebar menu - Damus icon at the top opens sidebar - Merch link passes `ref` param, to help with website analytics Testing ------- 1. Ensured that link appears correctly with image on both iOS versions 2. Ensured that link takes user to the store 3. Ensured that ref param is passed to the store 4. Ensured that Damus icon opens sidebar menu 5. Ensured that when sidebar is open, clicking where the damus icon would be does not close the sidebar menu (it is behind the sidebar menu) Closes: https://github.com/damus-io/damus/issues/845 Changelog-Added: Added merch store button to sidebar menu Changelog-Changed: Damus icon now opens sidebar Signed-off-by: Daniel D’Aquino Signed-off-by: William Casarin --- damus/ContentView.swift | 3 +++ damus/Views/SideMenuView.swift | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/damus/ContentView.swift b/damus/ContentView.swift index bf616659..e770a157 100644 --- a/damus/ContentView.swift +++ b/damus/ContentView.swift @@ -184,6 +184,9 @@ struct ContentView: View { .shadow(color: DamusColors.purple, radius: 2) .opacity(isSideBarOpened ? 0 : 1) .animation(isSideBarOpened ? .none : .default, value: isSideBarOpened) + .onTapGesture { + isSideBarOpened.toggle() + } } else { timelineNavItem .opacity(isSideBarOpened ? 0 : 1) diff --git a/damus/Views/SideMenuView.swift b/damus/Views/SideMenuView.swift index 429834dd..24f43027 100644 --- a/damus/Views/SideMenuView.swift +++ b/damus/Views/SideMenuView.swift @@ -76,6 +76,10 @@ struct SideMenuView: View { navLabel(title: NSLocalizedString("Bookmarks", comment: "Sidebar menu label for Bookmarks view."), img: "bookmark") } + Link(destination: URL(string: "https://store.damus.io/?ref=damus_ios_app")!) { + navLabel(title: NSLocalizedString("Merch", comment: "Sidebar menu label for merch store link."), img: "basket") + } + NavigationLink(value: Route.Config) { navLabel(title: NSLocalizedString("Settings", comment: "Sidebar menu label for accessing the app settings"), img: "settings") }