From 1d4a9f93cc9aec12619c6ce6c4a9ad2f12fc5afd Mon Sep 17 00:00:00 2001 From: mkyq <53115730+mkyq@users.noreply.github.com> Date: Wed, 20 Jul 2022 18:33:34 +0100 Subject: [PATCH] Cw 131 (#426) * UI fixes for ionia. * Changed tips for ionia. * Fixes for IoniaBuyGiftCardDetailPage screen. Renamed 'Manage Cards' to 'Gift Cards'. Hide discount badge label for 0 discount. --- .../cards/ionia_buy_card_detail_page.dart | 71 +++---------------- .../ionia/cards/ionia_manage_cards_page.dart | 2 +- res/values/strings_de.arb | 2 +- res/values/strings_en.arb | 2 +- res/values/strings_es.arb | 2 +- res/values/strings_fr.arb | 2 +- res/values/strings_hi.arb | 2 +- res/values/strings_hr.arb | 2 +- res/values/strings_it.arb | 2 +- res/values/strings_ja.arb | 2 +- res/values/strings_ko.arb | 2 +- res/values/strings_nl.arb | 2 +- res/values/strings_pl.arb | 2 +- res/values/strings_pt.arb | 2 +- res/values/strings_ru.arb | 2 +- res/values/strings_uk.arb | 2 +- res/values/strings_zh.arb | 2 +- 17 files changed, 27 insertions(+), 76 deletions(-) diff --git a/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart b/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart index 01a912568..6eab3aa19 100644 --- a/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart +++ b/lib/src/screens/ionia/cards/ionia_buy_card_detail_page.dart @@ -1,7 +1,6 @@ import 'dart:ui'; import 'package:cake_wallet/anypay/any_pay_payment_committed_info.dart'; import 'package:cake_wallet/core/execution_state.dart'; -import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/ionia/ionia_merchant.dart'; import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/palette.dart'; @@ -14,9 +13,6 @@ import 'package:cake_wallet/src/widgets/discount_badge.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/standart_list_row.dart'; -import 'package:cake_wallet/store/settings_store.dart'; -import 'package:cake_wallet/themes/dark_theme.dart'; -import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/ionia/ionia_purchase_merch_view_model.dart'; @@ -24,48 +20,14 @@ import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; +import 'package:cake_wallet/src/screens/base_page.dart'; -class IoniaBuyGiftCardDetailPage extends StatelessWidget { +class IoniaBuyGiftCardDetailPage extends BasePage { IoniaBuyGiftCardDetailPage(this.ioniaPurchaseViewModel); final IoniaMerchPurchaseViewModel ioniaPurchaseViewModel; - ThemeBase get currentTheme => getIt.get().currentTheme; - - Color get backgroundLightColor => Colors.white; - - Color get backgroundDarkColor => PaletteDark.backgroundColor; - - void onClose(BuildContext context) => Navigator.of(context).pop(); - - Widget leading(BuildContext context) { - if (ModalRoute.of(context).isFirst) { - return null; - } - - final _backButton = Icon( - Icons.arrow_back_ios, - color: Theme.of(context).primaryTextTheme.title.color, - size: 16, - ); - return Padding( - padding: const EdgeInsets.only(left: 10.0), - child: SizedBox( - height: 37, - width: 37, - child: ButtonTheme( - minWidth: double.minPositive, - child: FlatButton( - highlightColor: Colors.transparent, - splashColor: Colors.transparent, - padding: EdgeInsets.all(0), - onPressed: () => onClose(context), - child: _backButton), - ), - ), - ); - } - + @override Widget middle(BuildContext context) { return Text( ioniaPurchaseViewModel.ioniaMerchant.legalName, @@ -74,10 +36,13 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget { } @override - Widget build(BuildContext context) { - final merchant = ioniaPurchaseViewModel.ioniaMerchant; - final _backgroundColor = currentTheme.type == ThemeType.dark ? backgroundDarkColor : backgroundLightColor; + Widget trailing(BuildContext context) + => ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount > 0 + ? DiscountBadge(percentage: ioniaPurchaseViewModel.ioniaMerchant.minimumDiscount) + : null; + @override + Widget body(BuildContext context) { reaction((_) => ioniaPurchaseViewModel.invoiceCreationState, (ExecutionState state) { if (state is FailureState) { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -120,25 +85,12 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget { } }); - return Scaffold( - backgroundColor: _backgroundColor, - body: ScrollableWithBottomSection( + return ScrollableWithBottomSection( contentPadding: EdgeInsets.zero, content: Observer(builder: (_) { final tipAmount = ioniaPurchaseViewModel.tipAmount; return Column( children: [ - SizedBox(height: 60), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - leading(context), - middle(context), - DiscountBadge( - percentage: merchant.minimumDiscount, - ) - ], - ), SizedBox(height: 36), Container( padding: EdgeInsets.symmetric(vertical: 24), @@ -234,7 +186,7 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 24.0), child: TextIconButton( label: S.of(context).how_to_use_card, - onTap: () => _showHowToUseCard(context, merchant), + onTap: () => _showHowToUseCard(context, ioniaPurchaseViewModel.ioniaMerchant), ), ), ], @@ -266,7 +218,6 @@ class IoniaBuyGiftCardDetailPage extends StatelessWidget { SizedBox(height: 16) ], ), - ), ); } diff --git a/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart b/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart index 2d0d0db1c..5c9d8f28d 100644 --- a/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart +++ b/lib/src/screens/ionia/cards/ionia_manage_cards_page.dart @@ -90,7 +90,7 @@ class IoniaManageCardsPage extends BasePage { @override Widget middle(BuildContext context) { return Text( - S.of(context).manage_cards, + S.of(context).gift_cards, style: textLargeSemiBold( color: Theme.of(context).accentTextTheme.display3.backgroundColor, ), diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index e8e043af4..a6c938631 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -543,7 +543,7 @@ "sign_up": "Anmelden", "forgot_password": "Passwort vergessen", "reset_password": "Passwort zurücksetzen", - "manage_cards": "Karten verwalten", + "gift_cards": "Geschenkkarten", "setup_your_debit_card": "Richten Sie Ihre Debitkarte ein", "no_id_required": "Keine ID erforderlich. Upgraden und überall ausgeben", "how_to_use_card": "Wie man diese Karte benutzt", diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index fa81ce8c3..6048b7b67 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -543,7 +543,7 @@ "sign_up": "Sign Up", "forgot_password": "Forgot Password", "reset_password": "Reset Password", - "manage_cards": "Manage Cards", + "gift_cards": "Gift Cards", "setup_your_debit_card": "Set up your debit card", "no_id_required": "No ID required. Top up and spend anywhere", "how_to_use_card": "How to use this card", diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index cc34236ef..fa2c558ec 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -543,7 +543,7 @@ "sign_up": "Registrarse", "forgot_password": "Olvidé mi contraseña", "reset_password": "Restablecer contraseña", - "manage_cards": "Administrar tarjetas", + "gift_cards": "Tarjetas de regalo", "setup_your_debit_card": "Configura tu tarjeta de débito", "no_id_required": "No se requiere identificación. Recargue y gaste en cualquier lugar", "how_to_use_card": "Cómo usar esta tarjeta", diff --git a/res/values/strings_fr.arb b/res/values/strings_fr.arb index 4758478da..03818ed1f 100644 --- a/res/values/strings_fr.arb +++ b/res/values/strings_fr.arb @@ -541,7 +541,7 @@ "sign_up": "S'inscrire", "forgot_password": "Mot de passe oublié", "reset_password": "Réinitialiser le mot de passe", - "manage_cards": "Gérer les cartes", + "manage_cards": "Cartes cadeaux", "setup_your_debit_card": "Configurer votre carte de débit", "no_id_required": "Aucune pièce d'identité requise. Rechargez et dépensez n'importe où", "how_to_use_card": "Comment utiliser cette carte", diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index 922e3e81f..4d32b1181 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -543,7 +543,7 @@ "sign_up": "साइन अप करें", "forgot_password": "पासवर्ड भूल गए", "reset_password": "पासवर्ड रीसेट करें", - "manage_cards": "कार्ड मैनेज करें", + "gift_cards": "उपहार कार्ड", "setup_your_debit_card": "अपना डेबिट कार्ड सेट करें", "no_id_required": "कोई आईडी आवश्यक नहीं है। टॉप अप करें और कहीं भी खर्च करें", "how_to_use_card": "इस कार्ड का उपयोग कैसे करें", diff --git a/res/values/strings_hr.arb b/res/values/strings_hr.arb index 2d06d88ab..a4e0f277f 100644 --- a/res/values/strings_hr.arb +++ b/res/values/strings_hr.arb @@ -543,7 +543,7 @@ "sign_up": "Prijavite se", "forgot_password": "Zaboravljena lozinka", "reset_password": "Poništi lozinku", - "manage_cards": "Upravljanje karticama", + "gift_cards": "Ajándékkártya", "setup_your_debit_card": "Postavite svoju debitnu karticu", "no_id_required": "Nije potreban ID. Nadopunite i potrošite bilo gdje", "how_to_use_card": "Kako koristiti ovu karticu", diff --git a/res/values/strings_it.arb b/res/values/strings_it.arb index 133f2113b..d3d8cf8db 100644 --- a/res/values/strings_it.arb +++ b/res/values/strings_it.arb @@ -543,7 +543,7 @@ "sign_up": "Registrati", "forgot_password": "Password dimenticata", "reset_password": "Reimposta password", - "manage_cards": "Gestisci carte", + "gift_cards": "Carte regalo", "setup_your_debit_card": "Configura la tua carta di debito", "no_id_required": "Nessun ID richiesto. Ricarica e spendi ovunque", "how_to_use_card": "Come usare questa carta", diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index 262113673..72c228ddd 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -543,7 +543,7 @@ "sign_up": "サインアップ", "forgot_password": "パスワードを忘れた", "reset_password": "パスワードのリセット", - "manage_cards": "カードの管理", + "gift_cards": "ギフトカード", "setup_your_debit_card": "デビットカードを設定してください", "no_id_required": "IDは必要ありません。どこにでも補充して使用できます", "how_to_use_card": "このカードの使用方法", diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index 165584f29..dca10c91d 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -543,7 +543,7 @@ "sign_up": "가입", "forgot_password": "비밀번호 찾기", "reset_password": "비밀번호 재설정", - "manage_cards": "카드 관리", + "gift_cards": "기프트 카드", "setup_your_debit_card": "직불카드 설정", "no_id_required": "신분증이 필요하지 않습니다. 충전하고 어디에서나 사용하세요", "how_to_use_card": "이 카드를 사용하는 방법", diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index ca9654917..8f6de0e79 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -543,7 +543,7 @@ "sign_up": "Aanmelden", "forgot_password": "Wachtwoord vergeten", "reset_password": "Wachtwoord resetten", - "manage_cards": "Kaarten beheren", + "gift_cards": "Cadeaubonnen", "setup_your_debit_card": "Stel uw debetkaart in", "no_id_required": "Geen ID vereist. Opwaarderen en overal uitgeven", "how_to_use_card": "Hoe deze kaart te gebruiken", diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index 5bfe763c7..6556c63cd 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -546,7 +546,7 @@ "sign_up": "Zarejestruj się", "forgot_password": "Zapomniałem hasła", "reset_password": "Zresetuj hasło", - "manage_cards": "Zarządzaj kartami", + "gift_cards": "Karty podarunkowe", "setup_your_debit_card": "Skonfiguruj swoją kartę debetową", "no_id_required": "Nie wymagamy ID. Doładuj i wydawaj gdziekolwiek", "how_to_use_card": "Jak korzystać z tej karty", diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index 016346df3..1c12f960d 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -543,7 +543,7 @@ "create_account": "Registar-se", "forgot_password": "Esqueci a senha", "reset_password": "Redefinir senha", - "manage_cards": "Gerenciar Cartões", + "gift_cards": "Cartões de presente", "setup_your_debit_card": "Configure seu cartão de débito", "no_id_required": "Não é necessário ID. Recarregue e gaste em qualquer lugar", "how_to_use_card": "Como usar este cartão", diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index 964a94511..6003369e4 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -543,7 +543,7 @@ "sign_up": "Зарегистрироваться", "forgot_password": "Забыли пароль", "reset_password": "Сбросить пароль", - "manage_cards": "Управление картами", + "gift_cards": "Подарочные карты", "setup_your_debit_card": "Настройте свою дебетовую карту", "no_id_required": "Идентификатор не требуется. Пополняйте и тратьте где угодно", "how_to_use_card": "Как использовать эту карту", diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index e0a7f6820..de524071a 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -542,7 +542,7 @@ "sign_up": "Зареєструватися", "forgot_password": "Забули пароль", "reset_password": "Скинути пароль", - "manage_cards": "Керувати картками", + "gift_cards": "Подарункові карти", "setup_your_debit_card": "Налаштуйте свою дебетову картку", "no_id_required": "Ідентифікатор не потрібен. Поповнюйте та витрачайте будь-де", "how_to_use_card": "Як використовувати цю картку", diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index 678874329..e0e4b678a 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -541,7 +541,7 @@ "sign_up": "注册", "forgot_password": "忘记密码", "reset_password": "重置密码", - "manage_cards": "管理卡片", + "gift_cards": "礼品卡", "setup_your_debit_card": "设置你的借记卡", "no_id_required": "不需要身份证。充值并在任何地方消费", "how_to_use_card": "如何使用这张卡",