diff --git a/packages/sidesail/lib/pages/tabs/testchain/mainchain/deposit_withdraw_tab_route.dart b/packages/sidesail/lib/pages/tabs/testchain/mainchain/deposit_withdraw_tab_route.dart index 0bd64a64..a4d1a28e 100644 --- a/packages/sidesail/lib/pages/tabs/testchain/mainchain/deposit_withdraw_tab_route.dart +++ b/packages/sidesail/lib/pages/tabs/testchain/mainchain/deposit_withdraw_tab_route.dart @@ -36,25 +36,20 @@ class DepositWithdrawTabPage extends StatelessWidget { spacing: SailStyleValues.padding30, children: [ DashboardGroup( - title: 'Actions', + title: 'Deposit from parent chain', widgetEnd: HelpButton(onPressed: () => viewModel.castHelp(context)), children: [ - ActionTile( - title: 'Deposit from parent chain', - category: Category.mainchain, - icon: Icons.add, - onTap: () { - viewModel.pegIn(context); - }, - ), - ActionTile( - title: 'Withdraw to parent chain', - category: Category.mainchain, - icon: Icons.remove, - onTap: () { - viewModel.pegOut(context); - }, - ), + if (viewModel._sidechain.rpc.chain.type == SidechainType.ethereum) + const PegInEthAction() + else + const PegInAction(), + ], + ), + DashboardGroup( + title: 'Withdraw to parent chain', + widgetEnd: HelpButton(onPressed: () => viewModel.castHelp(context)), + children: [ + const PegOutAction(), if (viewModel.localNetwork) ActionTile( title: 'Connect sidechain with parent chain', diff --git a/packages/sidesail/lib/pages/tabs/testchain/mainchain/transfer_mainchain_tab_route.dart b/packages/sidesail/lib/pages/tabs/testchain/mainchain/transfer_mainchain_tab_route.dart index b9d0759c..709ddbf2 100644 --- a/packages/sidesail/lib/pages/tabs/testchain/mainchain/transfer_mainchain_tab_route.dart +++ b/packages/sidesail/lib/pages/tabs/testchain/mainchain/transfer_mainchain_tab_route.dart @@ -300,8 +300,6 @@ class SendViewModel extends BaseViewModel { title: 'You sent $amount BTC to $address', subtitle: 'TXID: $sendTXID', ); - // also pop the info modal - await _router.maybePop(); } catch (error) { if (!context.mounted) { return; diff --git a/packages/sidesail/lib/widgets/containers/tabs/deposit_withdraw_tab_widgets.dart b/packages/sidesail/lib/widgets/containers/tabs/deposit_withdraw_tab_widgets.dart index 9fcee50e..8a7471ad 100644 --- a/packages/sidesail/lib/widgets/containers/tabs/deposit_withdraw_tab_widgets.dart +++ b/packages/sidesail/lib/widgets/containers/tabs/deposit_withdraw_tab_widgets.dart @@ -35,17 +35,8 @@ class PegOutAction extends StatelessWidget { return ViewModelBuilder.reactive( viewModelBuilder: () => PegOutViewModel(staticAddress: staticAddress), builder: ((context, viewModel, child) { - return DashboardActionModal( - 'Withdraw to parent chain', - endActionButton: SailButton.primary( - 'Execute withdraw', - disabled: viewModel.bitcoinAddressController.text.isEmpty || viewModel.bitcoinAmountController.text.isEmpty, - loading: viewModel.isBusy, - size: ButtonSize.regular, - onPressed: () async { - viewModel.executePegOut(context); - }, - ), + return SailColumn( + spacing: 0, children: [ LargeEmbeddedInput( controller: viewModel.bitcoinAddressController, @@ -71,6 +62,16 @@ class PegOutAction extends StatelessWidget { label: 'Total amount', value: '${viewModel.totalBitcoinAmount} BTC', ), + SailButton.primary( + 'Execute withdraw', + disabled: + viewModel.bitcoinAddressController.text.isEmpty || viewModel.bitcoinAmountController.text.isEmpty, + loading: viewModel.isBusy, + size: ButtonSize.regular, + onPressed: () async { + viewModel.executePegOut(context); + }, + ), ], ); }), @@ -208,8 +209,6 @@ class PegOutViewModel extends BaseViewModel { title: 'Submitted withdraw successfully', subtitle: 'TXID: $withdrawalTxid', ); - // also pop the info modal - await _router.maybePop(); } catch (error) { log.e('could not execute withdraw: $error', error: error); @@ -235,22 +234,22 @@ class PegInAction extends StatelessWidget { return ViewModelBuilder.reactive( viewModelBuilder: () => PegInViewModel(), builder: ((context, viewModel, child) { - return DashboardActionModal( - 'Deposit from parent chain', - endActionButton: SailButton.primary( - 'Generate new address', - loading: viewModel.isBusy, - size: ButtonSize.regular, - onPressed: () async { - await viewModel.generatePegInAddress(); - }, - ), + return SailColumn( + spacing: SailStyleValues.padding10, children: [ StaticActionField( label: 'Address', value: viewModel.pegInAddress ?? '', copyable: true, ), + SailButton.primary( + 'Generate new address', + loading: viewModel.isBusy, + size: ButtonSize.regular, + onPressed: () async { + await viewModel.generatePegInAddress(); + }, + ), ], ); }),