Skip to content
Open
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
204 changes: 134 additions & 70 deletions novawallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions novawallet/Common/Extension/SettingsExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ enum SettingsKey: String {
case ahmAssetDetailsAlertClosedChains
case ahmStakingAlertClosedChains
case privacyModeSettings
case appStoreMigrationShown
}

extension SettingsManagerProtocol {
Expand Down Expand Up @@ -425,4 +426,14 @@ extension SettingsManagerProtocol {
)
}
}

var appStoreMigrationShown: Bool {
get {
bool(for: SettingsKey.appStoreMigrationShown.rawValue) ?? false
}

set {
set(value: newValue, for: SettingsKey.appStoreMigrationShown.rawValue)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
import Foundation
import Foundation_iOS

protocol InlinableAlertViewModelFactoryProtocol {
func createWOAssetListAlertViewModel(for locale: Locale) -> InlinableAlertView.Model

func createStakingDetailsAlertViewModel(
info: AHMFullInfo,
locale: Locale
) -> InlinableAlertView.Model

func createAssetDetailsAlertViewModel(
info: AHMFullInfo,
locale: Locale
) -> InlinableAlertView.Model
}

final class InlinableAlertViewModelFactory {}
final class InlinableAlertViewModelFactory {
private let dateFormatter: LocalizableResource<DateFormatter>

init(dateFormatter: LocalizableResource<DateFormatter> = DateFormatter.fullDate) {
self.dateFormatter = dateFormatter
}
}

extension InlinableAlertViewModelFactory: InlinableAlertViewModelFactoryProtocol {
func createWOAssetListAlertViewModel(for locale: Locale) -> InlinableAlertView.Model {
Expand All @@ -29,4 +46,93 @@ extension InlinableAlertViewModelFactory: InlinableAlertViewModelFactoryProtocol
showCloseButton: false
)
}

func createStakingDetailsAlertViewModel(
info: AHMFullInfo,
locale: Locale
) -> InlinableAlertView.Model {
let sourceChainAsset = ChainAsset(
chain: info.sourceChain,
asset: info.asset
)
let languages = locale.rLanguages

let date = Date(timeIntervalSince1970: TimeInterval(info.info.timestamp))

let formattedDate = dateFormatter
.value(for: locale)
.string(from: date)

let title = R.string(
preferredLanguages: locale.rLanguages
).localizable.ahmInfoAlertStakingDetailsMessage(
sourceChainAsset.chainAssetName,
info.destinationChain.name,
formattedDate
)
let learnMoreModel = LearnMoreViewModel(
iconViewModel: nil,
title: R.string(
preferredLanguages: locale.rLanguages
).localizable.commonLearnMore()
)

return InlinableAlertView.Model(
type: .ahmStakingDetails,
title: title,
message: nil,
learnMore: learnMoreModel,
actionTitle: nil,
icon: R.image.iconInfoAccent()!,
showCloseButton: true
)
}

func createAssetDetailsAlertViewModel(
info: AHMFullInfo,
locale: Locale
) -> InlinableAlertView.Model {
let languages = locale.rLanguages

let date = Date(timeIntervalSince1970: TimeInterval(info.info.timestamp))

let formattedDate = dateFormatter
.value(for: locale)
.string(from: date)

let title = R.string(
preferredLanguages: locale.rLanguages
).localizable.ahmInfoAlertAssetDetailsTitle(
info.asset.symbol,
info.destinationChain.name
)
let message = R.string(
preferredLanguages: locale.rLanguages
).localizable.ahmInfoAlertAssetDetailsMessage(
formattedDate,
info.asset.symbol,
info.destinationChain.name
)
let learnMoreModel = LearnMoreViewModel(
iconViewModel: nil,
title: R.string(
preferredLanguages: locale.rLanguages
).localizable.commonLearnMore()
)
let actionTitle = R.string(
preferredLanguages: locale.rLanguages
).localizable.ahmInfoAlertAssetDetailsAction(
info.destinationChain.name
)

return InlinableAlertView.Model(
type: .ahmAssetDetails,
title: title,
message: message,
learnMore: learnMoreModel,
actionTitle: actionTitle,
icon: R.image.iconInfoAccent()!,
showCloseButton: true
)
}
}
38 changes: 0 additions & 38 deletions novawallet/Modules/AHMInfo/AHMInfoInteractor.swift

This file was deleted.

120 changes: 0 additions & 120 deletions novawallet/Modules/AHMInfo/AHMInfoPresenter.swift

This file was deleted.

25 changes: 0 additions & 25 deletions novawallet/Modules/AHMInfo/AHMInfoProtocols.swift

This file was deleted.

10 changes: 0 additions & 10 deletions novawallet/Modules/AHMInfo/AHMInfoWireframe.swift

This file was deleted.

27 changes: 0 additions & 27 deletions novawallet/Modules/AHMInfo/Model/AHMInfoViewModel.swift

This file was deleted.

Loading