Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Error network screen #690

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/bg_connection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,5 +637,8 @@
"expiresInCustodians": "Expires in {}",
"deploymentInProgress": "Deployment in progress",
"expirationTimeDetails": "Expires in {} hours {} minutes ({} at {})",
"errorMessageMaxUnconfirmedTransactions": "Unconfirmed transactions is limited by 5"
"errorMessageMaxUnconfirmedTransactions": "Unconfirmed transactions is limited by 5",
"noRpcConnection": "No RPC connection",
"tryAgainOrContact": "Please try again or contact technical support",
"contactUs": "Contact us"
}
5 changes: 4 additions & 1 deletion assets/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,5 +637,8 @@
"expiresInCustodians": "Expires in {}",
"deploymentInProgress": "Deployment in progress",
"expirationTimeDetails": "Expires in {} hours {} minutes ({} at {})",
"errorMessageMaxUnconfirmedTransactions": "Unconfirmed transactions is limited by 5"
"errorMessageMaxUnconfirmedTransactions": "Unconfirmed transactions is limited by 5",
"noRpcConnection": "No RPC connection",
"tryAgainOrContact": "Please try again or contact technical support",
"contactUs": "Contact us"
}
54 changes: 33 additions & 21 deletions lib/feature/connection_fail/connection_fail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,44 @@ class ConnectionFailScreen extends ElementaryWidget<ConnectionFailWidgetModel> {
backgroundColor: wm.colors.background0,
body: Stack(
children: [
Assets.images.bgInternet.image(width: double.infinity),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'TODO Connection',
// LocaleKeys.oopsNoInternet.tr(),
style: wm.textStyles.headingLarge,
textAlign: TextAlign.center,
),
const SizedBox(height: DimensSize.d8),
Text(
LocaleKeys.offlineCheckConnection.tr(),
style: wm.textStyles.paragraphMedium,
textAlign: TextAlign.center,
),
],
Assets.images.bgConnection.image(width: double.infinity),
SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
LocaleKeys.noRpcConnection.tr(),
style: wm.textStyles.headingLarge,
textAlign: TextAlign.center,
),
const SizedBox(height: DimensSize.d8),
Text(
LocaleKeys.tryAgainOrContact.tr(),
style: wm.textStyles.paragraphMedium,
textAlign: TextAlign.center,
),
],
),
),
Positioned(
bottom: DimensSizeV2.d34,
left: DimensSizeV2.d16,
right: DimensSizeV2.d16,
child: PrimaryButton(
buttonShape: ButtonShape.pill,
title: LocaleKeys.tryAgain.tr(),
onPressed: wm.onPressedTryAgain,
child: Column(
children: [
PrimaryButton(
buttonShape: ButtonShape.pill,
title: LocaleKeys.tryAgain.tr(),
onPressed: wm.onPressedTryAgain,
),
const SizedBox(height: DimensSize.d12),
PrimaryButton(
buttonShape: ButtonShape.pill,
title: LocaleKeys.contactUs.tr(),
onPressed: wm.onPressedContactUs,
),
],
),
),
],
Expand Down
9 changes: 9 additions & 0 deletions lib/feature/connection_fail/connection_fail_screen_wm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:app/di/di.dart';
import 'package:app/feature/bootstrap_failed/cubit/rerun_cubit/rerun_cubit.dart';
import 'package:app/feature/connection_fail/connection_fail_screen.dart';
import 'package:app/feature/connection_fail/connection_fail_screen_model.dart';
import 'package:app/feature/contact_support/widgets/contact_support/contact_support_mode.dart';
import 'package:app/feature/contact_support/widgets/contact_support/contact_support_sheet.dart';
import 'package:elementary/elementary.dart';
import 'package:flutter/widgets.dart';
import 'package:ui_components_lib/ui_components_lib.dart';
Expand Down Expand Up @@ -39,4 +41,11 @@ class ConnectionFailWidgetModel
Future<void> onPressedTryAgain() async {
model.tryAgain(context);
}

void onPressedContactUs() {
showContactSupportSheet(
context: context,
mode: ContactSupportMode.initiatedByCrash,
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:app/feature/wallet/widgets/select_account/select_account_sheet.d
import 'package:app/feature/wallet/widgets/wallet_app_bar/wallet_app_bar_wm.dart';
import 'package:app/utils/utils.dart';
import 'package:app/widgets/network_drop_item.dart';
import 'package:app/widgets/network_icon.dart';
import 'package:app/widgets/user_avatar/user_avatar.dart';
import 'package:elementary/elementary.dart';
import 'package:elementary_helper/elementary_helper.dart';
Expand Down Expand Up @@ -61,8 +60,7 @@ class WalletAppBarWidget extends ElementaryWidget<WalletAppBarWidgetModel>
connection?.let(
(value) => GestureDetector(
onTap: wm.onNetwork,
child:
NetworkDropItem(data: value),
child: NetworkDropItem(data: value),
),
) ??
const SizedBox.shrink(),
Expand Down
5 changes: 5 additions & 0 deletions lib/generated/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/generated/locale_keys.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -662,4 +662,7 @@ abstract class LocaleKeys {
static const expirationTimeDetails = 'expirationTimeDetails';
static const errorMessageMaxUnconfirmedTransactions =
'errorMessageMaxUnconfirmedTransactions';
static const noRpcConnection = 'noRpcConnection';
static const tryAgainOrContact = 'tryAgainOrContact';
static const contactUs = 'contactUs';
}
Loading