Skip to content

Commit

Permalink
chore: Truncate subtitle of qr code on funding screen
Browse files Browse the repository at this point in the history
  • Loading branch information
holzeis committed May 24, 2024
1 parent aa62dc0 commit 19a23f6
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -82,6 +83,12 @@ class _ChannelFunding extends State<ChannelFunding> {
)
};

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(
Expand Down Expand Up @@ -186,11 +193,11 @@ class _ChannelFunding extends State<ChannelFunding> {
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,
Expand Down

0 comments on commit 19a23f6

Please sign in to comment.