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:
committed by
William Casarin
parent
a324523b85
commit
139df33cb7
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// ZapButtonView.swift
|
||||
// ProfileZapLinkView.swift
|
||||
// damus
|
||||
//
|
||||
// Created by Daniel D’Aquino 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")
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user