damus

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

commit 2f90f2d4b75b97ff5fcdbc85a5b44fe90850be34
parent 1288732e5dc0a5578a8052ff749fb606f521fcaa
Author: William Casarin <jb55@jb55.com>
Date:   Mon, 27 Feb 2023 11:03:09 -0800

Fix issue where keyboard covers custom zap comment

Changelog-Fixed: Fix issue where keyboard covers custom zap comment

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

diff --git a/damus/Views/Zaps/CustomizeZapView.swift b/damus/Views/Zaps/CustomizeZapView.swift @@ -150,11 +150,13 @@ struct CustomizeZapView: View { .ignoresSafeArea() } - var MainContent: some View { - VStack(alignment: .leading) { - Form { + var TheForm: some View { + Form { + + Group { Section(content: { AmountPicker + .frame(height: 120) }, header: { Text("Zap Amount in sats", comment: "Header text to indicate that the picker below it is to choose a pre-defined amount of sats to zap.") }) @@ -172,14 +174,12 @@ struct CustomizeZapView: View { }, header: { Text("Custom Zap Amount", comment: "Header text to indicate that the text field below it is to enter a custom zap amount.") }) - .dismissKeyboardOnTap() Section(content: { TextField(NSLocalizedString("Awesome post!", comment: "Placeholder text for a comment to send as part of a zap to the user."), text: $comment) }, header: { Text("Comment", comment: "Header text to indicate that the text field below it is a comment that will be used to send as part of a zap to the user.") }) - .dismissKeyboardOnTap() Section(content: { ZapTypePicker @@ -187,24 +187,31 @@ struct CustomizeZapView: View { Text("Zap Type", comment: "Header text to indicate that the picker below it is to choose the type of zap to send.") }) - if zapping { - Text("Zapping...", comment: "Text to indicate that the app is in the process of sending a zap.") - } else { - Button(NSLocalizedString("Zap", comment: "Button to send a zap.")) { - let amount = custom_amount_sats ?? selected_amount.amount - send_zap(damus_state: state, event: event, lnurl: lnurl, is_custom: true, comment: comment, amount_sats: amount, zap_type: zap_type) - self.zapping = true - } - .zIndex(16) - } - - if let error { - Text(error) - .foregroundColor(.red) + } + .dismissKeyboardOnTap() + + if zapping { + Text("Zapping...", comment: "Text to indicate that the app is in the process of sending a zap.") + } else { + Button(NSLocalizedString("Zap", comment: "Button to send a zap.")) { + let amount = custom_amount_sats ?? selected_amount.amount + send_zap(damus_state: state, event: event, lnurl: lnurl, is_custom: true, comment: comment, amount_sats: amount, zap_type: zap_type) + self.zapping = true } + .zIndex(16) } + + if let error { + Text(error) + .foregroundColor(.red) + } + } } + + var MainContent: some View { + TheForm + } } struct CustomizeZapView_Previews: PreviewProvider {