Rename ZapButton to NoteZapButton and ZapButtonView to ProfileZapLinkView (no-op)

This is a non-functional refactor to rename two views with similar names, to avoid confusion.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
Daniel D’Aquino
2023-10-23 23:32:43 +00:00
committed by William Casarin
parent a324523b85
commit 139df33cb7
6 changed files with 19 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
//
// ZapButton.swift
// NoteZapButton.swift
// damus
//
// Created by William Casarin on 2023-01-17.
@@ -26,7 +26,7 @@ struct ZappingEvent {
let target: ZapTarget
}
struct ZapButton: View {
struct NoteZapButton: View {
let damus_state: DamusState
let target: ZapTarget
let lnurl: String
@@ -144,7 +144,7 @@ struct ZapButton_Previews: PreviewProvider {
let pending_zap = PendingZap(amount_msat: 1000, target: ZapTarget.note(id: test_note.id, author: test_note.pubkey), request: .normal(test_zap_request), type: .pub, state: .external(.init(state: .fetching_invoice)))
let zaps = ZapsDataModel([.pending(pending_zap)])
ZapButton(damus_state: test_damus_state, target: ZapTarget.note(id: test_note.id, author: test_note.pubkey), lnurl: "lnurl", zaps: zaps)
NoteZapButton(damus_state: test_damus_state, target: ZapTarget.note(id: test_note.id, author: test_note.pubkey), lnurl: "lnurl", zaps: zaps)
}
}

View File

@@ -84,7 +84,7 @@ struct EventActionBar: View {
if let lnurl = self.lnurl {
Spacer()
ZapButton(damus_state: damus_state, target: ZapTarget.note(id: event.id, author: event.pubkey), lnurl: lnurl, zaps: self.damus_state.events.get_cache_data(self.event.id).zaps_model)
NoteZapButton(damus_state: damus_state, target: ZapTarget.note(id: event.id, author: event.pubkey), lnurl: lnurl, zaps: self.damus_state.events.get_cache_data(self.event.id).zaps_model)
}
Spacer()

View File

@@ -222,7 +222,7 @@ struct ProfileView: View {
}
func lnButton(unownedProfile: Profile?, record: ProfileRecord?) -> some View {
return ZapButtonView(unownedProfileRecord: record, profileModel: self.profile) { reactions_enabled, lud16, lnurl in
return ProfileZapLinkView(unownedProfileRecord: record, profileModel: self.profile) { reactions_enabled, lud16, lnurl in
Image(reactions_enabled ? "zap.fill" : "zap")
.foregroundColor(reactions_enabled ? .orange : Color.primary)
.profile_button_style(scheme: colorScheme)

View File

@@ -61,7 +61,7 @@ struct ProfileActionSheetView: View {
if let lnurl = self.profile_data()?.lnurl, lnurl != "" {
return AnyView(
VStack(alignment: .center, spacing: 10) {
ZapButtonView(damus_state: damus_state, pubkey: self.profile.pubkey, action: { dismiss() }) { reactions_enabled, lud16, lnurl in
ProfileZapLinkView(damus_state: damus_state, pubkey: self.profile.pubkey, action: { dismiss() }) { reactions_enabled, lud16, lnurl in
Image(reactions_enabled ? "zap.fill" : "zap")
.foregroundColor(reactions_enabled ? .orange : Color.primary)
.profile_button_style(scheme: colorScheme)

View File

@@ -1,5 +1,5 @@
//
// ZapButtonView.swift
// ProfileZapLinkView.swift
// damus
//
// Created by Daniel DAquino on 2023-10-20.
@@ -7,7 +7,7 @@
import SwiftUI
struct ZapButtonView<Content: View>: View {
struct ProfileZapLinkView<Content: View>: View {
typealias ContentViewFunction = (_ reactions_enabled: Bool, _ lud16: String?, _ lnurl: String?) -> Content
typealias ActionFunction = () -> Void
@@ -86,7 +86,7 @@ struct ZapButtonView<Content: View>: View {
}
#Preview {
ZapButtonView(pubkey: test_pubkey, reactions_enabled: true, lud16: make_test_profile().lud16, lnurl: "test@sendzaps.lol", label: { reactions_enabled, lud16, lnurl in
ProfileZapLinkView(pubkey: test_pubkey, reactions_enabled: true, lud16: make_test_profile().lud16, lnurl: "test@sendzaps.lol", label: { reactions_enabled, lud16, lnurl in
Image("zap.fill")
})
}