Changed look of Repost and Quote buttons

Changelog-Changed: Changed look of Repost and Quote buttons
Closes: #1104
This commit is contained in:
ericholguin
2023-05-07 12:09:35 -06:00
committed by William Casarin
parent 43017828e2
commit 0492a25633
2 changed files with 33 additions and 28 deletions

View File

@@ -120,7 +120,7 @@ struct EventActionBar: View {
if #available(iOS 16.0, *) { if #available(iOS 16.0, *) {
RepostAction(damus_state: self.damus_state, event: event) RepostAction(damus_state: self.damus_state, event: event)
.presentationDetents([.height(300)]) .presentationDetents([.height(220)])
.presentationDragIndicator(.visible) .presentationDragIndicator(.visible)
} else { } else {
RepostAction(damus_state: self.damus_state, event: event) RepostAction(damus_state: self.damus_state, event: event)

View File

@@ -12,18 +12,12 @@ struct RepostAction: View {
let event: NostrEvent let event: NostrEvent
@Environment(\.dismiss) var dismiss @Environment(\.dismiss) var dismiss
@Environment(\.colorScheme) var colorScheme
var body: some View { var body: some View {
VStack { VStack(alignment: .leading) {
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))
Spacer() Button {
HStack(alignment: .top, spacing: 100) {
ShareActionButton(img: "arrow.2.squarepath", text: NSLocalizedString("Repost", comment: "Button to repost a note")) {
dismiss() dismiss()
guard let privkey = self.damus_state.keypair.privkey else { guard let privkey = self.damus_state.keypair.privkey else {
@@ -33,18 +27,29 @@ struct RepostAction: View {
let boost = make_boost_event(pubkey: damus_state.keypair.pubkey, privkey: privkey, boosted: self.event) let boost = make_boost_event(pubkey: damus_state.keypair.pubkey, privkey: privkey, boosted: self.event)
damus_state.postbox.send(boost) 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)
ShareActionButton(img: "quote.opening", text: NSLocalizedString("Quote", comment: "Button to compose a quoted note")) { }
.font(.system(size: 20, weight: .regular))
.foregroundColor(colorScheme == .light ? Color("DamusBlack") : Color("DamusWhite"))
.padding(EdgeInsets(top: 25, leading: 50, bottom: 0, trailing: 50))
Button {
dismiss() dismiss()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
notify(.compose, PostAction.quoting(self.event)) 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))
Spacer() .foregroundColor(colorScheme == .light ? Color("DamusBlack") : Color("DamusWhite"))
.padding(EdgeInsets(top: 0, leading: 50, bottom: 0, trailing: 50))
HStack { HStack {
BigButton(NSLocalizedString("Cancel", comment: "Button to cancel a repost.")) { BigButton(NSLocalizedString("Cancel", comment: "Button to cancel a repost.")) {