Add option to rename wallet straight from a dotted menu in the top right #3689

pull/3698/head
Krypto Pank 3 years ago
parent 92691cb7b4
commit d7efc2d4ed
  1. 2
      AlphaWallet/Localization/en.lproj/Localizable.strings
  2. 2
      AlphaWallet/Localization/es.lproj/Localizable.strings
  3. 2
      AlphaWallet/Localization/ja.lproj/Localizable.strings
  4. 2
      AlphaWallet/Localization/ko.lproj/Localizable.strings
  5. 2
      AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings
  6. 24
      AlphaWallet/Tokens/Coordinators/TokensCoordinator.swift

@ -774,3 +774,5 @@
"add.multiple.customRpc.failed" = "%@ entries failed to add. ";
"add.multiple.customRpc.duplicates" = "%@ duplicate entries not added. ";
"add.multiple.customRpc.removed" = "These entries have been temporarily removed. ";
"tokens.wallet.renameThisWallet" = "Rename This Wallet";

@ -774,4 +774,4 @@
"add.multiple.customRpc.failed" = "%@ entries failed to add. ";
"add.multiple.customRpc.duplicates" = "%@ duplicate entries not added. ";
"add.multiple.customRpc.removed" = "These entries have been temporarily removed. ";
"tokens.wallet.renameThisWallet" = "Rename This Wallet";

@ -774,4 +774,4 @@
"add.multiple.customRpc.failed" = "%@ entries failed to add. ";
"add.multiple.customRpc.duplicates" = "%@ duplicate entries not added. ";
"add.multiple.customRpc.removed" = "These entries have been temporarily removed. ";
"tokens.wallet.renameThisWallet" = "Rename This Wallet";

@ -774,4 +774,4 @@
"add.multiple.customRpc.failed" = "%@ entries failed to add. ";
"add.multiple.customRpc.duplicates" = "%@ duplicate entries not added. ";
"add.multiple.customRpc.removed" = "These entries have been temporarily removed. ";
"tokens.wallet.renameThisWallet" = "Rename This Wallet";

@ -774,4 +774,4 @@
"add.multiple.customRpc.failed" = "%@ entries failed to add. ";
"add.multiple.customRpc.duplicates" = "%@ duplicate entries not added. ";
"add.multiple.customRpc.removed" = "These entries have been temporarily removed. ";
"tokens.wallet.renameThisWallet" = "Rename This Wallet";

@ -288,6 +288,12 @@ extension TokensCoordinator: TokensViewControllerDelegate {
}
alertController.addAction(addHideTokensAction)
let renameThisWalletAction = UIAlertAction(title: R.string.localizable.tokensWalletRenameThisWallet(), style: .default) { [weak self] _ in
guard let strongSelf = self else { return }
strongSelf.didPressRenameThisWallet()
}
alertController.addAction(renameThisWalletAction)
let cancelAction = UIAlertAction(title: R.string.localizable.cancel(), style: .cancel) { _ in }
alertController.addAction(cancelAction)
@ -298,6 +304,17 @@ extension TokensCoordinator: TokensViewControllerDelegate {
walletConnectCoordinator.showSessionDetails(in: navigationController)
}
private func didPressRenameThisWallet() {
let viewModel = RenameWalletViewModel(account: sessions.anyValue.account.address)
let viewController = RenameWalletViewController(viewModel: viewModel, analyticsCoordinator: analyticsCoordinator, config: config)
viewController.delegate = self
viewController.navigationItem.largeTitleDisplayMode = .never
viewController.hidesBottomBarWhenPushed = true
navigationController.pushViewController(viewController, animated: true)
}
private func didPressAddHideTokens(viewModel: TokensViewModel) {
let coordinator: AddHideTokensCoordinator = .init(
tokens: viewModel.tokens,
@ -346,6 +363,13 @@ extension TokensCoordinator: TokensViewControllerDelegate {
}
}
extension TokensCoordinator: RenameWalletViewControllerDelegate {
func didFinish(in viewController: RenameWalletViewController) {
navigationController.popViewController(animated: true)
}
}
extension TokensCoordinator: SelectTokenCoordinatorDelegate {
func coordinator(_ coordinator: SelectTokenCoordinator, didSelectToken token: TokenObject) {

Loading…
Cancel
Save