commit 0492a256334ea50da8323e8a37eb9693b153d18e
parent 43017828e2a481bc5664951a55867af314d0bf6d
Author: ericholguin <eric.holguinsanchez@gmail.com>
Date: Sun, 7 May 2023 12:09:35 -0600
Changed look of Repost and Quote buttons
Changelog-Changed: Changed look of Repost and Quote buttons
Closes: #1104
Diffstat:
2 files changed, 31 insertions(+), 26 deletions(-)
diff --git 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
@@ -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()
-
- 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)
+ Button {
+ dismiss()
+
+ guard let privkey = self.damus_state.keypair.privkey else {
+ return
}
- 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))
- }
- }
+ 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)
+
}
+ .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.")) {