-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #888 from novasamatech/develop
v7.2x and v7.3.x
- Loading branch information
Showing
105 changed files
with
1,196 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/iconCloseWithBg.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "iconCloseWithBg.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.34 KB
novawallet/Assets.xcassets/iconCloseWithBg.imageset/iconCloseWithBg.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.62 KB
novawallet/Assets.xcassets/iconsBuyProviders/iconBanxa.imageset/Banxa.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/iconsBuyProviders/iconBanxa.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Banxa.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/imagePolkadotStakingBg.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "imagePolkadotStakingBg.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+3.99 KB
novawallet/Assets.xcassets/imagePolkadotStakingBg.imageset/imagePolkadotStakingBg.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
novawallet/Assets.xcassets/imagePolkadotStakingPromo.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "imagePolkadotStakingPromo.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+211 KB
novawallet/Assets.xcassets/imagePolkadotStakingPromo.imageset/imagePolkadotStakingPromo.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import SoraFoundation | ||
|
||
protocol PurchaseFlowManaging { | ||
func startPuchaseFlow( | ||
from view: ControllerBackedProtocol?, | ||
purchaseActions: [PurchaseAction], | ||
wireframe: (PurchasePresentable & AlertPresentable)?, | ||
locale: Locale | ||
) | ||
} | ||
|
||
extension PurchaseFlowManaging where Self: ModalPickerViewControllerDelegate & PurchaseDelegate { | ||
func startPuchaseFlow( | ||
from view: ControllerBackedProtocol?, | ||
purchaseActions: [PurchaseAction], | ||
wireframe: (PurchasePresentable & AlertPresentable)?, | ||
locale: Locale | ||
) { | ||
guard !purchaseActions.isEmpty else { | ||
return | ||
} | ||
if purchaseActions.count == 1 { | ||
startPuchaseFlow(from: view, purchaseAction: purchaseActions[0], wireframe: wireframe, locale: locale) | ||
} else { | ||
wireframe?.showPurchaseProviders( | ||
from: view, | ||
actions: purchaseActions, | ||
delegate: self | ||
) | ||
} | ||
} | ||
|
||
func startPuchaseFlow( | ||
from view: ControllerBackedProtocol?, | ||
purchaseAction: PurchaseAction, | ||
wireframe: (PurchasePresentable & AlertPresentable)?, | ||
locale: Locale | ||
) { | ||
let title = R.string.localizable.commonAlertExternalLinkDisclaimerTitle(preferredLanguages: locale.rLanguages) | ||
let message = R.string.localizable.commonAlertExternalLinkDisclaimerMessage( | ||
purchaseAction.displayURL, | ||
preferredLanguages: locale.rLanguages | ||
) | ||
|
||
let closeTitle = R.string.localizable | ||
.commonCancel(preferredLanguages: locale.rLanguages) | ||
let continueTitle = R.string.localizable | ||
.commonContinue(preferredLanguages: locale.rLanguages) | ||
let continueAction = AlertPresentableAction(title: continueTitle) { | ||
wireframe?.showPurchaseTokens( | ||
from: view, | ||
action: purchaseAction, | ||
delegate: self | ||
) | ||
} | ||
|
||
wireframe?.present( | ||
viewModel: .init( | ||
title: title, | ||
message: message, | ||
actions: [continueAction], | ||
closeAction: closeTitle | ||
), | ||
style: .alert, | ||
from: view | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import Foundation | ||
|
||
protocol PurchasePresentable { | ||
func showPurchaseTokens( | ||
from view: ControllerBackedProtocol?, | ||
action: PurchaseAction, | ||
delegate: PurchaseDelegate | ||
) | ||
|
||
func showPurchaseProviders( | ||
from view: ControllerBackedProtocol?, | ||
actions: [PurchaseAction], | ||
delegate: ModalPickerViewControllerDelegate | ||
) | ||
|
||
func presentPurchaseDidComplete( | ||
view: ControllerBackedProtocol?, | ||
locale: Locale | ||
) | ||
} | ||
|
||
extension PurchasePresentable { | ||
func showPurchaseTokens( | ||
from view: ControllerBackedProtocol?, | ||
action: PurchaseAction, | ||
delegate: PurchaseDelegate | ||
) { | ||
guard let purchaseView = PurchaseViewFactory.createView( | ||
for: action, | ||
delegate: delegate | ||
) else { | ||
return | ||
} | ||
purchaseView.controller.modalPresentationStyle = .fullScreen | ||
view?.controller.present(purchaseView.controller, animated: true) | ||
} | ||
|
||
func showPurchaseProviders( | ||
from view: ControllerBackedProtocol?, | ||
actions: [PurchaseAction], | ||
delegate: ModalPickerViewControllerDelegate | ||
) { | ||
guard let pickerView = ModalPickerFactory.createPickerForList( | ||
actions, | ||
delegate: delegate, | ||
context: nil | ||
) else { | ||
return | ||
} | ||
guard let navigationController = view?.controller.navigationController else { | ||
return | ||
} | ||
navigationController.present(pickerView, animated: true) | ||
} | ||
|
||
func presentPurchaseDidComplete( | ||
view: ControllerBackedProtocol?, | ||
locale: Locale | ||
) { | ||
let languages = locale.rLanguages | ||
let message = R.string.localizable | ||
.buyCompleted(preferredLanguages: languages) | ||
|
||
let alertController = ModalAlertFactory.createMultilineSuccessAlert(message) | ||
view?.controller.present(alertController, animated: true) | ||
} | ||
} |
Oops, something went wrong.