damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 455f1f7e1f4e1ce9a05df542f88444e5ef934645
parent 797762e7d25478fd94c6ffbee40b154845f3b62e
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 22 Jun 2023 10:18:48 +0200

view/refactor: remove redundant view structs

Diffstat:
Mdamus/Views/Zaps/CustomizeZapView.swift | 81+++++++++++++++++++++++++++++++++++--------------------------------------------
1 file changed, 36 insertions(+), 45 deletions(-)

diff --git a/damus/Views/Zaps/CustomizeZapView.swift b/damus/Views/Zaps/CustomizeZapView.swift @@ -244,26 +244,43 @@ struct CustomizeZapView: View { } var body: some View { - MainContent - .sheet(isPresented: $show_zap_types) { - if #available(iOS 16.0, *) { - ZapPicker - .presentationDetents([.medium]) - .presentationDragIndicator(.visible) - } else { - ZapPicker - } - } - .sheet(isPresented: $showing_wallet_selector) { - SelectWalletView(default_wallet: state.settings.default_wallet, showingSelectWallet: $showing_wallet_selector, our_pubkey: state.pubkey, invoice: invoice) - } - .onReceive(handle_notify(.zapping)) { notif in - receive_zap(notif: notif) - } - .background(fillColor().edgesIgnoringSafeArea(.all)) - .onTapGesture { - hideKeyboard() + VStack(alignment: .center, spacing: 20) { + ZapTypeButton() + .padding(.top, 50) + + Spacer() + + CustomZapTextField + + AmountPicker + + ZapReply + + ZapButton + + Spacer() + + Spacer() + } + .sheet(isPresented: $show_zap_types) { + if #available(iOS 16.0, *) { + ZapPicker + .presentationDetents([.medium]) + .presentationDragIndicator(.visible) + } else { + ZapPicker } + } + .sheet(isPresented: $showing_wallet_selector) { + SelectWalletView(default_wallet: state.settings.default_wallet, showingSelectWallet: $showing_wallet_selector, our_pubkey: state.pubkey, invoice: invoice) + } + .onReceive(handle_notify(.zapping)) { notif in + receive_zap(notif: notif) + } + .background(fillColor().edgesIgnoringSafeArea(.all)) + .onTapGesture { + hideKeyboard() + } } func ZapTypeButton() -> some View { @@ -292,35 +309,9 @@ struct CustomizeZapView: View { .cornerRadius(15) } - var CustomZap: some View { - VStack(alignment: .center, spacing: 20) { - - ZapTypeButton() - .padding(.top, 50) - - Spacer() - - CustomZapTextField - - AmountPicker - - ZapReply - - ZapButton - - Spacer() - - Spacer() - } - } - var ZapPicker: some View { ZapTypePicker(zap_type: $zap_type, settings: state.settings, profiles: state.profiles, pubkey: target.pubkey) } - - var MainContent: some View { - CustomZap - } } extension View {