Skip to content

Commit

Permalink
External account checks hooked up
Browse files Browse the repository at this point in the history
  • Loading branch information
yekta committed Mar 4, 2024
1 parent a4023e9 commit 790b66a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions lib/ui/accounts/accounts_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class _AppAccountsWidgetState extends State<AppAccountsWidget> {

Widget _buildAccountListItem(
BuildContext context, Account account, StateSetter setState) {
var isExternalAccount = false;
var isExternalAccount = account.index == -1;
return Slidable(
secondaryActions: _getSlideActionsForAccount(context, account, setState),
actionExtentRatio: 0.24,
Expand Down Expand Up @@ -612,7 +612,7 @@ class _AppAccountsWidgetState extends State<AppAccountsWidget> {
var deleteExternalAccountHeader = "Delete External Account";
var deleteExternalAccountParagraph =
"Deleting an external account is irreversible. If you don't have its secret phrase backed up, you won't be able to recover it later. Are you sure you want to delete the account from this device?";
var isExternalAccount = false;
var isExternalAccount = account.index == -1;
List<Widget> _actions = List();
_actions.add(SlideAction(
child: Container(
Expand All @@ -629,7 +629,7 @@ class _AppAccountsWidgetState extends State<AppAccountsWidget> {
onTap: () {
AccountDetailsSheet(account).mainBottomSheet(context);
}));
if (account.index > 0) {
if (account.index > 0 || isExternalAccount) {
_actions.add(SlideAction(
child: Container(
margin: EdgeInsetsDirectional.only(start: 2, top: 1, bottom: 1),
Expand Down
34 changes: 17 additions & 17 deletions lib/ui/accounts/import_external_account_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ class _ImportExternalAccountSheetState
autoScroll: true,
focusPadding: 40,
child: SingleChildScrollView(
padding: EdgeInsets.only(bottom: 48),
padding: EdgeInsets.only(bottom: 64),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(
left: smallScreen(context) ? 30 : 40,
right: smallScreen(context) ? 30 : 40),
left: smallScreen(context) ? 24 : 32,
right: smallScreen(context) ? 24 : 32),
alignment: Alignment.centerLeft,
child: AutoSizeText(
_seedMode
Expand All @@ -145,8 +145,8 @@ class _ImportExternalAccountSheetState
// Explanation text for secret phrase
Container(
margin: EdgeInsets.only(
left: smallScreen(context) ? 30 : 40,
right: smallScreen(context) ? 30 : 40,
left: smallScreen(context) ? 24 : 32,
right: smallScreen(context) ? 24 : 32,
top: 6.0),
alignment: Alignment.centerLeft,
child: Text(
Expand All @@ -166,8 +166,8 @@ class _ImportExternalAccountSheetState
},
child: _seedMode
? AppTextField(
leftMargin: smallScreen(context) ? 30 : 40,
rightMargin: smallScreen(context) ? 30 : 40,
leftMargin: smallScreen(context) ? 24 : 32,
rightMargin: smallScreen(context) ? 24 : 32,
topMargin: 16,
focusNode: _seedInputFocusNode,
controller: _seedInputController,
Expand Down Expand Up @@ -277,8 +277,8 @@ class _ImportExternalAccountSheetState
})
: // Mnemonic mode
AppTextField(
leftMargin: smallScreen(context) ? 30 : 40,
rightMargin: smallScreen(context) ? 30 : 40,
leftMargin: smallScreen(context) ? 24 : 32,
rightMargin: smallScreen(context) ? 24 : 32,
topMargin: 16,
focusNode: _mnemonicFocusNode,
controller: _mnemonicController,
Expand Down Expand Up @@ -431,8 +431,8 @@ class _ImportExternalAccountSheetState
Container(
margin: EdgeInsets.only(
top: 5,
left: smallScreen(context) ? 30 : 40,
right: smallScreen(context) ? 30 : 40,
left: smallScreen(context) ? 24 : 32,
right: smallScreen(context) ? 24 : 32,
),
child: Text(
!_seedMode
Expand Down Expand Up @@ -462,8 +462,8 @@ class _ImportExternalAccountSheetState
// Header for the "Account Index"
Container(
margin: EdgeInsets.only(
left: smallScreen(context) ? 30 : 40,
right: smallScreen(context) ? 30 : 40,
left: smallScreen(context) ? 24 : 32,
right: smallScreen(context) ? 24 : 32,
top: 12),
alignment: Alignment.centerLeft,
child: AutoSizeText(
Expand All @@ -482,8 +482,8 @@ class _ImportExternalAccountSheetState
// Explanation text for index
Container(
margin: EdgeInsets.only(
left: smallScreen(context) ? 30 : 40,
right: smallScreen(context) ? 30 : 40,
left: smallScreen(context) ? 24 : 32,
right: smallScreen(context) ? 24 : 32,
top: 6.0),
alignment: Alignment.centerLeft,
child: Text(
Expand All @@ -498,8 +498,8 @@ class _ImportExternalAccountSheetState
_indexInputFocusNode.unfocus();
},
child: AppTextField(
leftMargin: smallScreen(context) ? 30 : 40,
rightMargin: smallScreen(context) ? 30 : 40,
leftMargin: smallScreen(context) ? 24 : 32,
rightMargin: smallScreen(context) ? 24 : 32,
topMargin: 16,
hintText: defaultIndex.toString(),
keyboardType: TextInputType.numberWithOptions(
Expand Down

0 comments on commit 790b66a

Please sign in to comment.