|
@ -118,25 +118,23 @@ struct ProfileView: View { |
|
|
@State private var selected_tab: ProfileTab = .posts |
|
|
@State private var selected_tab: ProfileTab = .posts |
|
|
@StateObject var profile: ProfileModel |
|
|
@StateObject var profile: ProfileModel |
|
|
@StateObject var followers: FollowersModel |
|
|
@StateObject var followers: FollowersModel |
|
|
@StateObject var user_settings = UserSettingsStore() |
|
|
|
|
|
@State private var showingEditProfile = false |
|
|
@State private var showingEditProfile = false |
|
|
@State var showingSelectWallet: Bool = false |
|
|
@State var showing_select_wallet: Bool = false |
|
|
@State var inv: String = "" |
|
|
|
|
|
@State var is_zoomed: Bool = false |
|
|
@State var is_zoomed: Bool = false |
|
|
|
|
|
@StateObject var user_settings = UserSettingsStore() |
|
|
|
|
|
|
|
|
@Environment(\.dismiss) var dismiss |
|
|
@Environment(\.dismiss) var dismiss |
|
|
@Environment(\.colorScheme) var colorScheme |
|
|
@Environment(\.colorScheme) var colorScheme |
|
|
|
|
|
|
|
|
//@EnvironmentObject var profile: ProfileModel |
|
|
//@EnvironmentObject var profile: ProfileModel |
|
|
|
|
|
|
|
|
func LNButton(lud06: String?, lud16: String?, profile: Profile) -> some View { |
|
|
func LNButton(lnurl: String, profile: Profile) -> some View { |
|
|
Button(action: { |
|
|
Button(action: { |
|
|
if let l = lud06 { |
|
|
if user_settings.show_wallet_selector { |
|
|
inv = l |
|
|
showing_select_wallet = true |
|
|
} else { |
|
|
} else { |
|
|
inv = lud16 ?? "" |
|
|
open_with_wallet(wallet: user_settings.default_wallet.model, invoice: lnurl) |
|
|
} |
|
|
} |
|
|
showingSelectWallet = true |
|
|
|
|
|
}) { |
|
|
}) { |
|
|
Image(systemName: "bolt.circle") |
|
|
Image(systemName: "bolt.circle") |
|
|
.symbolRenderingMode(.palette) |
|
|
.symbolRenderingMode(.palette) |
|
@ -149,8 +147,8 @@ struct ProfileView: View { |
|
|
Label("Copy LNURL", systemImage: "doc.on.doc") |
|
|
Label("Copy LNURL", systemImage: "doc.on.doc") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}.sheet(isPresented: $showingSelectWallet, onDismiss: {showingSelectWallet = false}) { |
|
|
}.sheet(isPresented: $showing_select_wallet, onDismiss: {showing_select_wallet = false}) { |
|
|
SelectWalletView(showingSelectWallet: $showingSelectWallet, invoice: $inv) |
|
|
SelectWalletView(showingSelectWallet: $showing_select_wallet, invoice: lnurl) |
|
|
.environmentObject(user_settings) |
|
|
.environmentObject(user_settings) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -183,8 +181,8 @@ struct ProfileView: View { |
|
|
Spacer() |
|
|
Spacer() |
|
|
|
|
|
|
|
|
if let profile = data { |
|
|
if let profile = data { |
|
|
if (profile.lud06 != nil || profile.lud16 != nil) { |
|
|
if let lnurl = profile.lnurl { |
|
|
LNButton(lud06: profile.lud06, lud16: profile.lud16, profile: profile) |
|
|
LNButton(lnurl: lnurl, profile: profile) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|