Skip to content

Commit c6b86e9

Browse files
authored
Merge pull request #701 from Syn-McJ/feat/dashspend-pay-ui
feat(dashspend): buy gift card UI
2 parents 0932837 + 987829d commit c6b86e9

90 files changed

Lines changed: 3013 additions & 521 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DashWallet.xcodeproj/project.pbxproj

Lines changed: 49 additions & 23 deletions
Large diffs are not rendered by default.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "blockchair.logo.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "blockchair.logo@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "blockchair.logo@3x.png",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}
724 Bytes
Loading
1.37 KB
Loading
1.87 KB
Loading

DashWallet/Sources/Models/DWGlobalOptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
4545
@property (nonatomic, assign) BOOL localNotificationsEnabled;
4646

4747
@property (nonatomic, assign) BOOL balanceHidden;
48+
@property (nonatomic, assign) BOOL tapToHideBalanceShown;
4849

4950
@property (nonatomic, assign) BOOL shouldDisplayOnboarding;
5051
@property (nonatomic, assign) BOOL shouldDisplayReclassifyYourTransactionsFlow;

DashWallet/Sources/Models/DWGlobalOptions.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ @implementation DWGlobalOptions
3535
@dynamic autoLockAppInterval;
3636
@dynamic shortcuts;
3737
@dynamic balanceHidden;
38+
@dynamic tapToHideBalanceShown;
3839
@dynamic shouldDisplayOnboarding;
3940
@dynamic paymentsScreenCurrentTab;
4041
@dynamic resyncingWallet;
@@ -147,6 +148,7 @@ - (void)restoreToDefaults {
147148
self.shortcuts = nil;
148149
self.localNotificationsEnabled = YES;
149150
self.balanceHidden = NO;
151+
self.tapToHideBalanceShown = NO;
150152
self.resyncingWallet = NO;
151153
self.selectedPaymentCurrency = DWPaymentCurrencyDash;
152154
self.shouldDisplayReclassifyYourTransactionsFlow = YES;

DashWallet/Sources/Models/Explore Dash/Model/Entites/ExplorePointOfUse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extension ExplorePointOfUse {
5757
let paymentMethod: PaymentMethod
5858
let type: `Type`
5959
let deeplink: String?
60-
let savingsPercentage: Int
60+
let savingsBasisPoints: Int // in basis points 1 = 0.001%
6161
}
6262

6363
var merchant: Merchant? {
@@ -221,7 +221,7 @@ extension ExplorePointOfUse: RowDecodable {
221221
let savingsPercentage = row[ExplorePointOfUse.savingPercentage]
222222
category = .merchant(Merchant(merchantId: merchantId,
223223
paymentMethod: Merchant.PaymentMethod(rawValue: paymentMethodRaw)!,
224-
type: type, deeplink: deeplink, savingsPercentage: savingsPercentage))
224+
type: type, deeplink: deeplink, savingsBasisPoints: savingsPercentage))
225225
} else if let manufacturer = try? row.get(ExplorePointOfUse.manufacturer) {
226226
let type: Atm.`Type`! = .init(rawValue: row[ExplorePointOfUse.type])
227227
category = .atm(Atm(manufacturer: manufacturer, type: type))

DashWallet/Sources/Models/Uphold/DWUpholdMainnetConstants.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ + (NSString *)transactionURLFormat {
4747

4848
+ (NSString *)logoutURLString {
4949
return @"https://uphold.com/";
50+
5051
}
5152

5253
@end

DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/PointOfUseDetailsViewController.swift

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ extension PointOfUseDetailsViewController {
138138
wSelf.navigationController?.pushViewController(vc, animated: true)
139139
}
140140
detailsView.buyGiftCardHandler = { [weak self] in
141+
self?.showDashSpendPayScreen()
142+
}
143+
detailsView.dashSpendAuthHandler = { [weak self] in
141144
self?.showCTXSpendLoginInfo()
142145
}
143146

@@ -180,15 +183,33 @@ extension PointOfUseDetailsViewController {
180183
}
181184

182185
private func showCTXSpendTerms() {
183-
let hostingController = UIHostingController(rootView: CTXSpendTermsScreen())
186+
let hostingController = UIHostingController(
187+
rootView: CTXSpendTermsScreen {
188+
self.navigationController?.popToViewController(ofType: PointOfUseDetailsViewController.self, animated: false)
189+
self.showDashSpendPayScreen(justAuthenticated: true)
190+
}
191+
)
184192
hostingController.modalPresentationStyle = .fullScreen
185193
self.navigationController?.pushViewController(hostingController, animated: true)
186194
}
187195

188196
private func showCTXSpendAuth(authType: CTXSpendUserAuthType) {
189197
let hostingController = UIHostingController(
190198
rootView: NavigationView {
191-
CTXSpendUserAuthScreen(authType: authType)
199+
CTXSpendUserAuthScreen(authType: authType) {
200+
self.navigationController?.popViewController(animated: false)
201+
self.showDashSpendPayScreen(justAuthenticated: true)
202+
}
203+
}
204+
)
205+
206+
self.navigationController?.pushViewController(hostingController, animated: true)
207+
}
208+
209+
private func showDashSpendPayScreen(justAuthenticated: Bool = false) {
210+
let hostingController = UIHostingController(
211+
rootView: NavigationView {
212+
DashSpendPayScreen(merchant: self.pointOfUse, justAuthenticated: justAuthenticated)
192213
}
193214
)
194215

0 commit comments

Comments
 (0)