From 19a23f68e879eeba7426bb65c9838408ead0a1f3 Mon Sep 17 00:00:00 2001 From: Richard Holzeis Date: Fri, 24 May 2024 20:22:39 +0200 Subject: [PATCH] chore: Truncate subtitle of qr code on funding screen --- .../channel_creation_flow/channel_funding_screen.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mobile/lib/features/trade/channel_creation_flow/channel_funding_screen.dart b/mobile/lib/features/trade/channel_creation_flow/channel_funding_screen.dart index d953ca1ce..180e4de67 100644 --- a/mobile/lib/features/trade/channel_creation_flow/channel_funding_screen.dart +++ b/mobile/lib/features/trade/channel_creation_flow/channel_funding_screen.dart @@ -12,6 +12,7 @@ import 'package:get_10101/features/trade/application/order_service.dart'; import 'package:get_10101/features/trade/channel_creation_flow/channel_configuration_screen.dart'; import 'package:get_10101/features/trade/submit_order_change_notifier.dart'; import 'package:get_10101/features/trade/trade_screen.dart'; +import 'package:get_10101/features/wallet/application/util.dart'; import 'package:go_router/go_router.dart'; import 'package:provider/provider.dart'; @@ -82,6 +83,12 @@ class _ChannelFunding extends State { ) }; + final qrCodeSubTitle = switch (selectedBox) { + FundingType.lightning => widget.funding.paymentRequest, + FundingType.onchain => widget.funding.bitcoinAddress, + FundingType.unified || FundingType.external => "Follow us on social media for updates", + }; + return Scaffold( body: SafeArea( child: Container( @@ -186,11 +193,11 @@ class _ChannelFunding extends State { onTap: () { Clipboard.setData(ClipboardData(text: qrCode.data)).then((_) { showSnackBar(ScaffoldMessenger.of(context), - "Copied: ${qrCode.data}"); + "Copied: $qrCodeSubTitle"); }); }, child: Text( - qrCode.data, + truncateWithEllipsis(44, qrCodeSubTitle), style: const TextStyle(fontSize: 14), textAlign: TextAlign.center, maxLines: 1,