Skip to content

Commit

Permalink
Merge pull request #1473 from p2p-org/feature/remove-unused-code-2
Browse files Browse the repository at this point in the history
Feature/remove unused code 2
  • Loading branch information
bigearsenal authored Jul 18, 2023
2 parents 54ced05 + 8933189 commit 19d33b5
Show file tree
Hide file tree
Showing 33 changed files with 37 additions and 1,241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "6213ba7a06febe8fef60563a4a7d26a4085783cf",
"version" : "2.54.0"
"revision" : "5f542894dd8efbd766d8adf73ef2f947b0cd5e21",
"version" : "2.56.0"
}
},
{
Expand Down
4 changes: 0 additions & 4 deletions p2p_wallet/Common/Coordinator/Coordinator.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import Combine
import Foundation

enum CoordinatorError: Error {
case isAlreadyStarted
}

@MainActor
open class Coordinator<ResultType>: NSObject {
// MARK: - Properties
Expand Down
33 changes: 0 additions & 33 deletions p2p_wallet/Common/Coordinator/SmartCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,6 @@ class SmartCoordinatorPushPresentation: SmartCoordinatorPresentation {
}
}

class SmartCoordinatorBottomSheetPresentation: SmartCoordinatorPresentation {
var presentingViewController: UIViewController

private var subscriptions = [AnyCancellable]()
private let transition: PanelTransition = .init()
private let height: CGFloat

init(from currentPresentation: SmartCoordinatorPresentation, height: CGFloat) {
presentingViewController = currentPresentation.presentingViewController
self.height = height
}

init(_ presentingViewController: UIViewController, height: CGFloat) {
self.presentingViewController = presentingViewController
self.height = height
}

func run(presentedViewController: UIViewController) {
// Prepare
transition.containerHeight = height
transition.dimmClicked
.sink(receiveValue: { _ in presentedViewController.dismiss(animated: true) })
.store(in: &subscriptions)

presentedViewController.view.layer.cornerRadius = 16
presentedViewController.transitioningDelegate = transition
presentedViewController.modalPresentationStyle = .custom

// Presentation
presentingViewController.present(presentedViewController, animated: true)
}
}

class SmartCoordinator<T>: Coordinator<T> {
let presentation: SmartCoordinatorPresentation

Expand Down
4 changes: 4 additions & 0 deletions p2p_wallet/Common/Extensions/View+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ extension View {
func uiView() -> UIView {
asViewController().view
}

func castToAnyView() -> AnyView {
AnyView(self)
}
}

// MARK: - Font
Expand Down
18 changes: 0 additions & 18 deletions p2p_wallet/Common/Models/DApps/DApp.swift

This file was deleted.

19 changes: 0 additions & 19 deletions p2p_wallet/Common/Models/DApps/DAppChannelError.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import AnalyticsManager
import BEPureLayout
import Combine
import Foundation
import KeyAppUI
import Resolver
import UIKit
import Combine
import BEPureLayout

protocol NotificationService {
typealias DeviceTokenResponse = JsonRpcResponseDto<DeviceTokenResponseDto>

func sendRegisteredDeviceToken(_ deviceToken: Data, ethAddress: String?) async throws
func deleteDeviceToken(ethAddress: String?) async throws
func showInAppNotification(_ notification: InAppNotification)
Expand Down Expand Up @@ -71,7 +69,7 @@ final class NotificationServiceImpl: NSObject, NotificationService {
func sendRegisteredDeviceToken(_ deviceToken: Data, ethAddress: String? = nil) async throws {
guard let publicKey = accountStorage.account?.publicKey.base58EncodedString else { return }
let token = deviceToken.formattedDeviceToken

let result = try await notificationRepository.sendDeviceToken(model: .init(
deviceToken: token,
clientId: publicKey,
Expand All @@ -82,7 +80,7 @@ final class NotificationServiceImpl: NSObject, NotificationService {
deviceModel: UIDevice.current.model
)
))

print(result)

Defaults.lastDeviceToken = deviceToken
Expand Down Expand Up @@ -117,7 +115,7 @@ final class NotificationServiceImpl: NSObject, NotificationService {
title: title ?? "😓",
text: text ?? L10n.SomethingWentWrong.pleaseTryAgain
)
.showInKeyWindow()
.showInKeyWindow()
}
}

Expand All @@ -127,7 +125,7 @@ final class NotificationServiceImpl: NSObject, NotificationService {
title: title ?? "😓",
text: text ?? L10n.SomethingWentWrong.pleaseTryAgain
)
.showInKeyWindow(autoHide: withAutoHidden)
.showInKeyWindow(autoHide: withAutoHidden)
}
}

Expand Down Expand Up @@ -156,7 +154,7 @@ final class NotificationServiceImpl: NSObject, NotificationService {
title: "😓",
text: L10n.SomethingWentWrong.pleaseTryAgain
)
.showInKeyWindow()
.showInKeyWindow()
}
}

Expand Down
20 changes: 0 additions & 20 deletions p2p_wallet/Common/Services/SystemVersion.swift

This file was deleted.

14 changes: 7 additions & 7 deletions p2p_wallet/Scenes/Main/Buy/ActivityIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@

import SwiftUI

public struct ActivityIndicator: UIViewRepresentable {
public typealias UIView = UIActivityIndicatorView
public var isAnimating: Bool = true
public var configuration = { (_: UIView) in }
struct ActivityIndicator: UIViewRepresentable {
typealias UIView = UIActivityIndicatorView
var isAnimating: Bool = true
var configuration = { (_: UIView) in }

public init(isAnimating: Bool, configuration: ((UIView) -> Void)? = nil) {
init(isAnimating: Bool, configuration: ((UIView) -> Void)? = nil) {
self.isAnimating = isAnimating
if let configuration = configuration {
self.configuration = configuration
}
}

public func makeUIView(context _: UIViewRepresentableContext<Self>) -> UIView {
func makeUIView(context _: UIViewRepresentableContext<Self>) -> UIView {
UIView()
}

public func updateUIView(_ uiView: UIView, context _: UIViewRepresentableContext<Self>) {
func updateUIView(_ uiView: UIView, context _: UIViewRepresentableContext<Self>) {
isAnimating ? uiView.startAnimating() : uiView.stopAnimating()
configuration(uiView)
}
Expand Down
11 changes: 0 additions & 11 deletions p2p_wallet/Scenes/Main/Buy/BuyViewModel.Models.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ import SolanaSwift
import UIKit

extension BuyViewModel {
struct TotalResult {
var total: String
var totalCurrency: Fiat
var token: Token
var fiat: Fiat
var tokenAmount: String
var fiatAmmount: String
}

// MARK: -

struct BuyForm: Equatable {
var token: Token
var tokenAmount: Double?
Expand Down
2 changes: 0 additions & 2 deletions p2p_wallet/Scenes/Main/Buy/BuyViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ private extension String {
}

final class BuyViewModel: ObservableObject {
typealias IpInfo = Moonpay.Provider.IpAddressResponse

var coordinatorIO = CoordinatorIO()

// MARK: - To View
Expand Down

This file was deleted.

Loading

0 comments on commit 19d33b5

Please sign in to comment.