Fix issue where keyboard covers custom zap comment
Changelog-Fixed: Fix issue where keyboard covers custom zap comment
This commit is contained in:
@@ -150,11 +150,13 @@ struct CustomizeZapView: View {
|
|||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
}
|
}
|
||||||
|
|
||||||
var MainContent: some View {
|
var TheForm: some View {
|
||||||
VStack(alignment: .leading) {
|
Form {
|
||||||
Form {
|
|
||||||
|
Group {
|
||||||
Section(content: {
|
Section(content: {
|
||||||
AmountPicker
|
AmountPicker
|
||||||
|
.frame(height: 120)
|
||||||
}, header: {
|
}, 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.")
|
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: {
|
}, header: {
|
||||||
Text("Custom Zap Amount", comment: "Header text to indicate that the text field below it is to enter a custom zap amount.")
|
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: {
|
Section(content: {
|
||||||
TextField(NSLocalizedString("Awesome post!", comment: "Placeholder text for a comment to send as part of a zap to the user."), text: $comment)
|
TextField(NSLocalizedString("Awesome post!", comment: "Placeholder text for a comment to send as part of a zap to the user."), text: $comment)
|
||||||
}, header: {
|
}, 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.")
|
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: {
|
Section(content: {
|
||||||
ZapTypePicker
|
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.")
|
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 {
|
struct CustomizeZapView_Previews: PreviewProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user