Skip to content

Commit

Permalink
Remove old CoinPage module
Browse files Browse the repository at this point in the history
  • Loading branch information
ealymbaev committed Jun 13, 2024
1 parent c3afe9f commit 549e24d
Show file tree
Hide file tree
Showing 52 changed files with 387 additions and 7,820 deletions.
338 changes: 24 additions & 314 deletions UnstoppableWallet/UnstoppableWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ extension MarketModule.Tab {
}
}

extension CoinPageModule.Tab {
var statTab: StatTab {
switch self {
case .overview: return .overview
case .analytics: return .analytics
// case .markets: return .markets
}
}
}

extension TransactionTypeFilter {
var statTab: StatTab {
switch self {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MarketKit
import SwiftUI

struct CoinAnalyticsIssuesView: View {
let viewItem: CoinAnalyticsViewModelNew.IssueBlockchainViewItem
let viewItem: CoinAnalyticsViewModel.IssueBlockchainViewItem
@Binding var isPresented: Bool

@State private var currentTabIndex: Int = Tab.tokenDetectors.rawValue
Expand Down Expand Up @@ -40,7 +40,7 @@ struct CoinAnalyticsIssuesView: View {

extension CoinAnalyticsIssuesView {
struct DetectorsView: View {
let items: [CoinAnalyticsViewModelNew.IssueViewItem]
let items: [CoinAnalyticsViewModel.IssueViewItem]
@Binding var expandedIndices: Set<Int>

var body: some View {
Expand Down Expand Up @@ -90,7 +90,7 @@ extension CoinAnalyticsIssuesView {
}
}

@ViewBuilder private func itemContent(item: CoinAnalyticsViewModelNew.IssueViewItem, expanded: Bool) -> some View {
@ViewBuilder private func itemContent(item: CoinAnalyticsViewModel.IssueViewItem, expanded: Bool) -> some View {
HStack(spacing: .margin8) {
HStack(spacing: .margin16) {
switch item.level {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,33 @@ import SwiftUI
import ThemeKit
import UIKit

enum CoinAnalyticsModule {
static func viewController(fullCoin: FullCoin) -> CoinAnalyticsViewController {
let service = CoinAnalyticsService(
fullCoin: fullCoin,
marketKit: App.shared.marketKit,
currencyManager: App.shared.currencyManager,
subscriptionManager: App.shared.subscriptionManager
)
let technicalIndicatorService = TechnicalIndicatorService(
coinUid: fullCoin.coin.uid,
currencyManager: App.shared.currencyManager,
marketKit: App.shared.marketKit
)
let coinIndicatorViewItemFactory = CoinIndicatorViewItemFactory()
let viewModel = CoinAnalyticsViewModel(
service: service,
technicalIndicatorService: technicalIndicatorService,
coinIndicatorViewItemFactory: coinIndicatorViewItemFactory
)
enum Previewable<T> {
case preview
case regular(value: T)

return CoinAnalyticsViewController(viewModel: viewModel)
var isPreview: Bool {
switch self {
case .preview: return true
case .regular: return false
}
}

func previewableValue<P>(mapper: (T) -> P) -> Previewable<P> {
switch self {
case .preview: return .preview
case let .regular(value): return .regular(value: mapper(value))
}
}

func value<P>(mapper: (T) -> P) -> P? {
switch self {
case .preview: return nil
case let .regular(value): return mapper(value)
}
}
}

extension CoinAnalyticsModule {
enum CoinAnalyticsModule {
enum Rating: String, CaseIterable, Identifiable {
case excellent
case good
Expand Down
Loading

0 comments on commit 549e24d

Please sign in to comment.