diff --git a/lib/swap/fee_popup.dart b/lib/swap/fee_popup.dart index 82eb5ab0..fb393fbf 100644 --- a/lib/swap/fee_popup.dart +++ b/lib/swap/fee_popup.dart @@ -7,20 +7,17 @@ import 'package:gap/gap.dart'; class FeePopUp extends StatelessWidget { const FeePopUp({ super.key, - required this.fromWalletName, required this.lockupFees, required this.claimFees, required this.boltzFees, }); - final String fromWalletName; final int lockupFees; final int claimFees; final int boltzFees; static Future openPopup( BuildContext context, - String walletName, int lockupFees, int claimFees, int boltzFees, @@ -28,7 +25,6 @@ class FeePopUp extends StatelessWidget { return showBBBottomSheet( context: context, child: FeePopUp( - fromWalletName: walletName, lockupFees: lockupFees, claimFees: claimFees, boltzFees: boltzFees, diff --git a/lib/swap/send.dart b/lib/swap/send.dart index 480e283d..8622022f 100644 --- a/lib/swap/send.dart +++ b/lib/swap/send.dart @@ -78,11 +78,6 @@ class _SwapFees extends StatelessWidget { ), ); - final walletName = context.select( - (SendCubit cubit) => - cubit.state.selectedWalletBloc?.state.wallet?.name ?? '', - ); - return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -97,7 +92,6 @@ class _SwapFees extends StatelessWidget { onPressed: () { FeePopUp.openPopup( context, - walletName, lockupFee, swaptx.claimFees ?? 0, swaptx.boltzFees ?? 0, @@ -338,34 +332,3 @@ class SendTick extends StatelessWidget { ); } } - -class _OnChainWarning extends StatelessWidget { - const _OnChainWarning({required this.swapTx}); - - final SwapTx swapTx; - - @override - Widget build(BuildContext context) { - if (swapTx.isLiquid()) return const SizedBox.shrink(); - - return Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - FontAwesomeIcons.triangleExclamation, - color: context.colour.primary, - size: 20, - ), - const Gap(8), - const SizedBox( - width: 250, - child: BBText.bodySmall( - 'Your onchain payment has been sent, but the swap is still in progress. It will take on on-chain confirmation before the Lightning payment succeeds.', - isRed: true, - fontSize: 10, - ), - ), - ], - ); - } -} diff --git a/lib/swap/swap_confirmation.dart b/lib/swap/swap_confirmation.dart index 33b9906c..e34c9d89 100644 --- a/lib/swap/swap_confirmation.dart +++ b/lib/swap/swap_confirmation.dart @@ -191,7 +191,6 @@ class _Screen extends StatelessWidget { onPressed: () { FeePopUp.openPopup( context, - walletName, senderFee, swapTx.claimFees ?? 0, swapTx.boltzFees ?? 0, diff --git a/lib/transaction/transaction_page.dart b/lib/transaction/transaction_page.dart index b42691fd..261002af 100644 --- a/lib/transaction/transaction_page.dart +++ b/lib/transaction/transaction_page.dart @@ -20,6 +20,7 @@ import 'package:bb_mobile/locator.dart'; import 'package:bb_mobile/network/bloc/network_cubit.dart'; import 'package:bb_mobile/network_fees/bloc/networkfees_cubit.dart'; import 'package:bb_mobile/styles.dart'; +import 'package:bb_mobile/swap/fee_popup.dart'; import 'package:bb_mobile/swap/watcher_bloc/watchtxs_bloc.dart'; import 'package:bb_mobile/transaction/bloc/state.dart'; import 'package:bb_mobile/transaction/bloc/transaction_cubit.dart'; @@ -505,6 +506,9 @@ class _SwapDetails extends StatelessWidget { ), ]; + final lockupFee = swap.isReverse() ? 0 : tx.fee; + final claimFee = swap.isReverse() ? tx.fee : swap.claimFees; + return Padding( padding: const EdgeInsets.all(24.0), child: AnimatedContainer( @@ -543,7 +547,26 @@ class _SwapDetails extends StatelessWidget { ), if (fees != 0) ...[ const Gap(24), - const BBText.title('Total fees'), + Row( + children: [ + const BBText.title('Total fees'), + IconButton( + icon: const Icon(Icons.info_outline), + iconSize: 22.0, + padding: EdgeInsets.zero, + color: context.colour.onPrimaryContainer, + onPressed: () { + FeePopUp.openPopup( + context, + lockupFee ?? 0, + claimFee ?? 0, + swap.boltzFees ?? 0, + ); + // show popup + }, + ), + ], + ), const Gap(4), Row( children: [ @@ -899,6 +922,9 @@ class _OnchainSwapDetails extends StatelessWidget { const Gap(24), ]; + final lockupFee = swap.isChainReceive() ? 0 : tx.fee; + final claimFee = swap.isChainReceive() ? tx.fee : swap.claimFees; + return Padding( padding: const EdgeInsets.all(12.0), child: AnimatedContainer( @@ -940,7 +966,26 @@ class _OnchainSwapDetails extends StatelessWidget { ), const Gap(24), if (fees != 0) ...[ - const BBText.title('Total fees'), + Row( + children: [ + const BBText.title('Total fees'), + IconButton( + icon: const Icon(Icons.info_outline), + iconSize: 22.0, + padding: EdgeInsets.zero, + color: context.colour.onPrimaryContainer, + onPressed: () { + FeePopUp.openPopup( + context, + lockupFee ?? 0, + claimFee ?? 0, + swap.boltzFees ?? 0, + ); + // show popup + }, + ), + ], + ), const Gap(4), Row( children: [