Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display pay-invoice amount title dynamically #1716

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions mobile/lib/features/wallet/send/send_lightning_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ class _SendLightningScreenState extends State<SendLightningScreen> {
]),
),
const SizedBox(height: 25),
const Text(
"Enter amount",
Text(
isZeroValueInvoice ? "Enter amount" : "Amount",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, color: Colors.grey),
style: const TextStyle(fontSize: 14, color: Colors.grey),
),
const SizedBox(height: 10),
Container(
Expand Down Expand Up @@ -362,7 +362,7 @@ class _SendLightningScreenState extends State<SendLightningScreen> {
)),
style: const TextStyle(fontSize: 40),
textAlignVertical: TextAlignVertical.center,
enabled: widget.destination.amount.sats == 0,
enabled: isZeroValueInvoice,
onChanged: (value) {
setState(() {
_usdpAmount = Amount.parseAmount(value);
Expand Down Expand Up @@ -506,4 +506,6 @@ class _SendLightningScreenState extends State<SendLightningScreen> {

return (Amount(balance), Amount(max(balance - channelReserve, 0)));
}

bool get isZeroValueInvoice => widget.destination.amount.sats == 0;
}
Loading