From 0492a256334ea50da8323e8a37eb9693b153d18e Mon Sep 17 00:00:00 2001 From: ericholguin Date: Sun, 7 May 2023 12:09:35 -0600 Subject: [PATCH] Changed look of Repost and Quote buttons Changelog-Changed: Changed look of Repost and Quote buttons Closes: #1104 --- damus/Views/ActionBar/EventActionBar.swift | 2 +- damus/Views/ActionBar/RepostAction.swift | 59 ++++++++++++---------- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/damus/Views/ActionBar/EventActionBar.swift b/damus/Views/ActionBar/EventActionBar.swift index 9da5c0e9..f774173a 100644 --- a/damus/Views/ActionBar/EventActionBar.swift +++ b/damus/Views/ActionBar/EventActionBar.swift @@ -120,7 +120,7 @@ struct EventActionBar: View { if #available(iOS 16.0, *) { RepostAction(damus_state: self.damus_state, event: event) - .presentationDetents([.height(300)]) + .presentationDetents([.height(220)]) .presentationDragIndicator(.visible) } else { RepostAction(damus_state: self.damus_state, event: event) diff --git a/damus/Views/ActionBar/RepostAction.swift b/damus/Views/ActionBar/RepostAction.swift index b14341a7..189ba2a3 100644 --- a/damus/Views/ActionBar/RepostAction.swift +++ b/damus/Views/ActionBar/RepostAction.swift @@ -12,39 +12,44 @@ struct RepostAction: View { let event: NostrEvent @Environment(\.dismiss) var dismiss + @Environment(\.colorScheme) var colorScheme var body: some View { - VStack { - Text("Repost Note", comment: "Title text to indicate that the buttons below are meant to be used to repost a note to others.") - .padding() - .font(.system(size: 17, weight: .bold)) + VStack(alignment: .leading) { - Spacer() + Button { + dismiss() + + guard let privkey = self.damus_state.keypair.privkey else { + return + } + + let boost = make_boost_event(pubkey: damus_state.keypair.pubkey, privkey: privkey, boosted: self.event) + + damus_state.postbox.send(boost) + } label: { + Label(NSLocalizedString("Repost", comment: "Button to repost a note"), systemImage: "arrow.2.squarepath") + .frame(maxWidth: .infinity, minHeight: 50, maxHeight: 50, alignment: .leading) - HStack(alignment: .top, spacing: 100) { - - ShareActionButton(img: "arrow.2.squarepath", text: NSLocalizedString("Repost", comment: "Button to repost a note")) { - dismiss() - - guard let privkey = self.damus_state.keypair.privkey else { - return - } - - let boost = make_boost_event(pubkey: damus_state.keypair.pubkey, privkey: privkey, boosted: self.event) - - damus_state.postbox.send(boost) - } - - ShareActionButton(img: "quote.opening", text: NSLocalizedString("Quote", comment: "Button to compose a quoted note")) { - dismiss() - DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { - notify(.compose, PostAction.quoting(self.event)) - } - } - } + .font(.system(size: 20, weight: .regular)) + .foregroundColor(colorScheme == .light ? Color("DamusBlack") : Color("DamusWhite")) + .padding(EdgeInsets(top: 25, leading: 50, bottom: 0, trailing: 50)) - Spacer() + Button { + dismiss() + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + notify(.compose, PostAction.quoting(self.event)) + } + + } label: { + Label(NSLocalizedString("Quote", comment: "Button to compose a quoted note"), systemImage: "quote.opening") + .frame(maxWidth: .infinity, minHeight: 50, maxHeight: 50, alignment: .leading) + + } + .font(.system(size: 20, weight: .regular)) + .foregroundColor(colorScheme == .light ? Color("DamusBlack") : Color("DamusWhite")) + .padding(EdgeInsets(top: 0, leading: 50, bottom: 0, trailing: 50)) HStack { BigButton(NSLocalizedString("Cancel", comment: "Button to cancel a repost.")) {