Skip to content

Commit 6ce04d0

Browse files
authored
Merge pull request #1968 from MixinNetwork/feature/wallet
New wallet summary view
2 parents f3d03b6 + c74d9ed commit 6ce04d0

17 files changed

+178
-121
lines changed

Mixin/Resources/en.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,9 @@
16561656
"wallet_pin_pay_interval_tips" = "For the security of your assets, you need to verify your PIN for the specified interval.";
16571657
"wallet_pin_tops_desc" = "Please remember the PIN is unrecoverable if lost. The PIN is based on the Throttled Identity Protocol, which is the decentralized key derivation protocol, read the document to learn more.";
16581658
"wallet_refresh_address_failed" = "The withdrawal fee has been changed and the refresh fails, please try again.";
1659-
"wallet_summary_tip" = "Watch wallets and hidden assets are excluded from the total";
1659+
"wallet_summary_tip_all" = "Safes, watch wallets, and hidden assets are excluded from the total";
1660+
"wallet_summary_tip_created" = "Hidden assets are excluded from the total";
1661+
"wallet_summary_tip_safe" = "Co-managed Safes are excluded from the total";
16601662
"wallet_transaction_continue_count_down" = "Continue (%d)";
16611663
"wallet_transaction_tip" = "Are you sure you want to transfer %3$@ worth %2$@ to %1$@?";
16621664
"wallet_transactions_asset_key_warning" = "Asset key is NOT a deposit address!";

Mixin/Resources/es.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,9 @@
16561656
"wallet_pin_pay_interval_tips" = "Para la seguridad de tus activos, debes verificar tu PIN durante el intervalo especificado.";
16571657
"wallet_pin_tops_desc" = "Recuerda que el PIN es irrecuperable si se pierde. El PIN se basa en el Throttled Identity Protocol, que es el protocolo de derivación de claves descentralizado, lee el documento para obtener más información.";
16581658
"wallet_refresh_address_failed" = "La tarifa de retiro ha cambiado y la actualización falla, inténtalo de nuevo.";
1659-
"wallet_summary_tip" = "Watch wallets and hidden assets are excluded from the total";
1659+
"wallet_summary_tip_all" = "Safes, watch wallets, and hidden assets are excluded from the total";
1660+
"wallet_summary_tip_created" = "Hidden assets are excluded from the total";
1661+
"wallet_summary_tip_safe" = "Co-managed Safes are excluded from the total";
16601662
"wallet_transaction_continue_count_down" = "Continuar (%d)";
16611663
"wallet_transaction_tip" = "¿Estás seguro de que quieres transferir %3$@ por valor de %2$@ a %1$@?";
16621664
"wallet_transactions_asset_key_warning" = "¡La clave de activo NO es una dirección de depósito!";

Mixin/Resources/ja.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,9 @@
16561656
"wallet_pin_pay_interval_tips" = "セキュリティ保護のため、PINコードの定期的な再確認が必要です。";
16571657
"wallet_pin_tops_desc" = "PINコードを忘れた場合、ウォレットにアクセスすることができなくなるため、必ず覚えておいてください。PINコードは、分散型キー導出プロトコルであるThrottled Identity Protocolから作成されています。詳しくは、こちらをご覧ください。";
16581658
"wallet_refresh_address_failed" = "出金手数料が変更され、更新に失敗しました。もう一度やり直してください。";
1659-
"wallet_summary_tip" = "Watch wallets and hidden assets are excluded from the total";
1659+
"wallet_summary_tip_all" = "Safes, watch wallets, and hidden assets are excluded from the total";
1660+
"wallet_summary_tip_created" = "Hidden assets are excluded from the total";
1661+
"wallet_summary_tip_safe" = "Co-managed Safes are excluded from the total";
16601662
"wallet_transaction_continue_count_down" = "続ける (%d)";
16611663
"wallet_transaction_tip" = "%1$@へ%2$@相当の%3$@を送金してもよろしいですか?";
16621664
"wallet_transactions_asset_key_warning" = "資産キーは入金アドレスではありません!";

Mixin/Resources/ru.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,9 @@
16561656
"wallet_pin_pay_interval_tips" = "В целях безопасности ваших активов вам необходимо подтверждать свой PIN-код в течение указанного интервала времени.";
16571657
"wallet_pin_tops_desc" = "Пожалуйста, помните, что PIN-код невозможно восстановить, если он утерян. PIN-код основан на протоколе Throttled Identity Protocol, который представляет собой децентрализованный протокол получения ключей. Прочтите документ, чтобы узнать больше.";
16581658
"wallet_refresh_address_failed" = "Комиссия за снятие была изменена, и обновление не удалось, попробуйте еще раз.";
1659-
"wallet_summary_tip" = "Watch wallets and hidden assets are excluded from the total";
1659+
"wallet_summary_tip_all" = "Safes, watch wallets, and hidden assets are excluded from the total";
1660+
"wallet_summary_tip_created" = "Hidden assets are excluded from the total";
1661+
"wallet_summary_tip_safe" = "Co-managed Safes are excluded from the total";
16601662
"wallet_transaction_continue_count_down" = "Продолжить (%d)";
16611663
"wallet_transaction_tip" = "Вы уверены, что хотите перевести %3$@ на сумму %2$@ на %1$@?";
16621664
"wallet_transactions_asset_key_warning" = "Ключ актива НЕ является депозитным адресом!";

Mixin/Resources/zh-Hans.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,9 @@
16561656
"wallet_pin_pay_interval_tips" = "为了您的资产安全,距离上次输入支付 PIN 的时间超过以上指定时间时,再次转账时依然需要支付 PIN";
16571657
"wallet_pin_tops_desc" = "注意 PIN 丢失无法找回,6 位数字 PIN 是基于去中心化密钥派生协议 Throttled Identity Protocol,阅读文档以了解更多。";
16581658
"wallet_refresh_address_failed" = "手续费已变更且刷新失败,请重试。";
1659-
"wallet_summary_tip" = "观察钱包、隐藏的资产不计入统计";
1659+
"wallet_summary_tip_all" = "Safe 金库、观察钱包和隐藏的资产不计入统计";
1660+
"wallet_summary_tip_created" = "隐藏的资产不计入统计";
1661+
"wallet_summary_tip_safe" = "共管的 Safe 金库不计入统计";
16601662
"wallet_transaction_continue_count_down" = "继续 (%d)";
16611663
"wallet_transaction_tip" = "确定给 %1$@ 转价值 %2$@ 的 %3$@ ?";
16621664
"wallet_transactions_asset_key_warning" = "资产标识不是充值地址!";

Mixin/Resources/zh-Hant.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,9 @@
16561656
"wallet_pin_pay_interval_tips" = "為了您的資產安全,距離上次輸入支付 PIN 的時間超過以上指定時間時,再次轉賬時依然需要支付 PIN";
16571657
"wallet_pin_tops_desc" = "注意 PIN 丟失無法找回,6 位數字 PIN 是基於去中心化金鑰派生協議 Throttled Identity Protocol,閱讀檔案以瞭解更多。";
16581658
"wallet_refresh_address_failed" = "手續費已變更且重新整理失敗,請重試。";
1659-
"wallet_summary_tip" = "觀察錢包、隱藏的資產不計入統計";
1659+
"wallet_summary_tip_all" = "Safe 金庫、觀察錢包和隱藏的資產不計入統計";
1660+
"wallet_summary_tip_created" = "隱藏的資產不計入統計";
1661+
"wallet_summary_tip_safe" = "共管的 Safe 金庫不計入統計";
16601662
"wallet_transaction_continue_count_down" = "繼續 (%d)";
16611663
"wallet_transaction_tip" = "確定給 %1$@ 轉價值 %2$@ 的 %3$@ ?";
16621664
"wallet_transactions_asset_key_warning" = "資產標識不是充值地址!";

Mixin/UserInterface/Controllers/Wallet/Authentication Preview/AuthenticationPreviewViewController.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,12 @@ extension AuthenticationPreviewViewController: UITableViewDataSource {
306306
cell.nameLabel.text = wallet.name
307307
cell.iconImageView.image = R.image.safe_vault()
308308
cell.iconImageView.isHidden = false
309-
cell.walletTag = .role(wallet.role.localizedDescription)
309+
switch wallet.role.knownCase {
310+
case .owner:
311+
cell.walletTag = .safeOwner(wallet.role.localizedDescription)
312+
case .member, .none:
313+
cell.walletTag = .plain(wallet.role.localizedDescription)
314+
}
310315
}
311316
return cell
312317
case let .safe(name, role):
@@ -315,7 +320,12 @@ extension AuthenticationPreviewViewController: UITableViewDataSource {
315320
cell.nameLabel.text = name
316321
cell.iconImageView.image = R.image.safe_vault()
317322
cell.iconImageView.isHidden = false
318-
cell.walletTag = .role(role)
323+
switch role.knownCase {
324+
case .owner:
325+
cell.walletTag = .safeOwner(role.localizedDescription)
326+
case .member, .none:
327+
cell.walletTag = .plain(role.localizedDescription)
328+
}
319329
return cell
320330
case let .commonWalletReceiver(user, address):
321331
let cell = tableView.dequeueReusableCell(withIdentifier: R.reuseIdentifier.common_wallet_receiver, for: indexPath)!
@@ -460,7 +470,7 @@ extension AuthenticationPreviewViewController {
460470
case safeMultisigAmount(token: MixinTokenItem, tokenAmount: String, fiatMoneyAmount: String)
461471
case addressReceivers(MixinTokenItem, [SafeMultisigResponse.Safe.Recipient])
462472
case wallet(caption: Caption, wallet: Wallet, threshold: Int32?)
463-
case safe(name: String, role: String)
473+
case safe(name: String, role: UnknownableEnum<SafeRole>)
464474
case commonWalletReceiver(user: UserItem, address: String)
465475
case user(title: String, user: UserItem)
466476
case waivedFee(token: String, fiatMoney: String, display: AmountIntent)

Mixin/UserInterface/Controllers/Wallet/Authentication Preview/AuthenticationPreviewWalletCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class AuthenticationPreviewWalletCell: UITableViewCell {
3939
label.backgroundColor = R.color.market_red()!.withAlphaComponent(0.2)
4040
label.textColor = R.color.market_red()
4141
label.text = text
42-
case .role(let text):
42+
case .safeOwner(let text):
4343
label.backgroundColor = UIColor(displayP3RgbValue: 0xFFAA00).withAlphaComponent(0.6)
4444
label.textColor = .white
4545
label.text = text

Mixin/UserInterface/Controllers/Wallet/Cells/WalletCell.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ final class WalletCell: UICollectionViewCell, TokenProportionRepresentableCell {
123123
titleLabel.text = wallet.name
124124
iconImageView.isHidden = false
125125
iconImageView.image = R.image.safe_vault()
126-
tags = [.role(wallet.role.localizedDescription)]
126+
switch wallet.role.knownCase {
127+
case .owner:
128+
tags = [.safeOwner(wallet.role.localizedDescription)]
129+
case .member, .none:
130+
tags = [.plain(wallet.role.localizedDescription)]
131+
}
127132
loadProportions(
128133
tokens: digest.tokens,
129134
placeholder: .safeVault(chainID: wallet.chainID),
@@ -172,7 +177,7 @@ extension WalletCell {
172177
label.backgroundColor = R.color.market_red()!.withAlphaComponent(0.2)
173178
label.textColor = R.color.market_red()
174179
label.text = text
175-
case .role(let text):
180+
case .safeOwner(let text):
176181
label.backgroundColor = UIColor(displayP3RgbValue: 0xFFAA00).withAlphaComponent(0.6)
177182
label.textColor = .white
178183
label.text = text

Mixin/UserInterface/Controllers/Wallet/Cells/WalletSummaryValueCell.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ final class WalletSummaryValueCell: UICollectionViewCell {
6363
middleAssetWrapperView.alpha = 0
6464
rightAssetWrapperView.alpha = 0
6565
case 2:
66+
leftAssetSampleImageView.image = R.image.wallet.token_sample_primary()
6667
leftAssetSymbolLabel.text = components[0].symbol.localized
6768
leftAssetPercentLabel.text = NumberFormatter.simplePercentage.string(decimal: components[0].percentage)
6869
middleAssetWrapperView.alpha = 1
6970
middleAssetSymbolLabel.text = components[1].symbol.localized
7071
middleAssetPercentLabel.text = NumberFormatter.simplePercentage.string(decimal: components[1].percentage)
7172
rightAssetWrapperView.alpha = 0
7273
default:
74+
leftAssetSampleImageView.image = R.image.wallet.token_sample_primary()
7375
leftAssetSymbolLabel.text = components[0].symbol.localized
7476
leftAssetPercentLabel.text = NumberFormatter.simplePercentage.string(decimal: components[0].percentage)
7577
middleAssetWrapperView.alpha = 1

0 commit comments

Comments
 (0)