Skip to content

Commit 83725b3

Browse files
committed
chore: final fixes
1 parent 5133283 commit 83725b3

10 files changed

Lines changed: 242 additions & 131 deletions

File tree

DashWallet.xcodeproj/project.pbxproj

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,9 @@
536536
752D03B02E2F758B00B88784 /* MainMenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752D03A72E2F758B00B88784 /* MainMenuViewController.swift */; };
537537
752D03B22E2F7B3C00B88784 /* MainMenuViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752D03B12E2F7B3C00B88784 /* MainMenuViewControllerDelegate.swift */; };
538538
752D03B32E2F7B3C00B88784 /* MainMenuViewControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752D03B12E2F7B3C00B88784 /* MainMenuViewControllerDelegate.swift */; };
539-
752F81982E30F55E00ADA76D /* SecurityScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81962E30F55E00ADA76D /* SecurityScreen.swift */; };
539+
752F81982E30F55E00ADA76D /* SecurityMenuScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81962E30F55E00ADA76D /* SecurityMenuScreen.swift */; };
540540
752F81992E30F55E00ADA76D /* SecurityMenuViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81972E30F55E00ADA76D /* SecurityMenuViewModel.swift */; };
541-
752F819A2E30F55E00ADA76D /* SecurityScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81962E30F55E00ADA76D /* SecurityScreen.swift */; };
541+
752F819A2E30F55E00ADA76D /* SecurityMenuScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81962E30F55E00ADA76D /* SecurityMenuScreen.swift */; };
542542
752F819B2E30F55E00ADA76D /* SecurityMenuViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81972E30F55E00ADA76D /* SecurityMenuViewModel.swift */; };
543543
752F81A92E323FDB00ADA76D /* ToolsMenuViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81A82E323FD000ADA76D /* ToolsMenuViewModel.swift */; };
544544
752F81AA2E323FDB00ADA76D /* ToolsMenuViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 752F81A82E323FD000ADA76D /* ToolsMenuViewModel.swift */; };
@@ -2450,7 +2450,7 @@
24502450
752D03A72E2F758B00B88784 /* MainMenuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuViewController.swift; sourceTree = "<group>"; };
24512451
752D03A82E2F758B00B88784 /* MainMenuViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuViewModel.swift; sourceTree = "<group>"; };
24522452
752D03B12E2F7B3C00B88784 /* MainMenuViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenuViewControllerDelegate.swift; sourceTree = "<group>"; };
2453-
752F81962E30F55E00ADA76D /* SecurityScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityScreen.swift; sourceTree = "<group>"; };
2453+
752F81962E30F55E00ADA76D /* SecurityMenuScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityMenuScreen.swift; sourceTree = "<group>"; };
24542454
752F81972E30F55E00ADA76D /* SecurityMenuViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecurityMenuViewModel.swift; sourceTree = "<group>"; };
24552455
752F81A82E323FD000ADA76D /* ToolsMenuViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolsMenuViewModel.swift; sourceTree = "<group>"; };
24562456
75303FE42AE7B70500870D8B /* CrowdNode.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CrowdNode.storyboard; sourceTree = "<group>"; };
@@ -4199,7 +4199,7 @@
41994199
children = (
42004200
2A7F3B18238C643D00DEA3EF /* Advanced Security */,
42014201
2A10EB3F2358D29500C38B61 /* ResetWalletInfo */,
4202-
752F81962E30F55E00ADA76D /* SecurityScreen.swift */,
4202+
752F81962E30F55E00ADA76D /* SecurityMenuScreen.swift */,
42034203
752F81972E30F55E00ADA76D /* SecurityMenuViewModel.swift */,
42044204
);
42054205
path = Security;
@@ -8870,7 +8870,7 @@
88708870
2A74EFF52305333000C475EB /* DWSeedUIConstants.m in Sources */,
88718871
2A0C69B32312E8A0001B8C90 /* DWWindow.m in Sources */,
88728872
472D13E3299E23B7006903F1 /* BalanceNotifier.swift in Sources */,
8873-
752F819A2E30F55E00ADA76D /* SecurityScreen.swift in Sources */,
8873+
752F819A2E30F55E00ADA76D /* SecurityMenuScreen.swift in Sources */,
88748874
752F819B2E30F55E00ADA76D /* SecurityMenuViewModel.swift in Sources */,
88758875
2AD1CE6422D9127600C99324 /* DWSeedWordModel.m in Sources */,
88768876
7592AA7C2B9B08C000417F9E /* SupportedTopperPaymentMethods.swift in Sources */,
@@ -9539,7 +9539,7 @@
95399539
C9D2C7C22A320AA000D15901 /* (null) in Sources */,
95409540
C9D2C7C32A320AA000D15901 /* DWDPRegistrationStatus.m in Sources */,
95419541
C9D2C7C42A320AA000D15901 /* CurrencyExchanger_Objc.m in Sources */,
9542-
752F81982E30F55E00ADA76D /* SecurityScreen.swift in Sources */,
9542+
752F81982E30F55E00ADA76D /* SecurityMenuScreen.swift in Sources */,
95439543
752F81992E30F55E00ADA76D /* SecurityMenuViewModel.swift in Sources */,
95449544
7573C2E12B01103900F4C347 /* VotingFilterItemSelectableCell.swift in Sources */,
95459545
C943B32B2A408CED00AF23C5 /* DWAvatarExternalLoadingView.m in Sources */,
@@ -10667,7 +10667,7 @@
1066710667
EXCLUDED_ARCHS = "";
1066810668
IBSC_MODULE = WatchApp_Extension;
1066910669
INFOPLIST_FILE = WatchApp/Info.plist;
10670-
MARKETING_VERSION = 8.4.0;
10670+
MARKETING_VERSION = 8.4.1;
1067110671
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1067210672
PRODUCT_NAME = "$(TARGET_NAME)";
1067310673
SDKROOT = watchos;
@@ -10689,7 +10689,7 @@
1068910689
EXCLUDED_ARCHS = "";
1069010690
IBSC_MODULE = WatchApp_Extension;
1069110691
INFOPLIST_FILE = WatchApp/Info.plist;
10692-
MARKETING_VERSION = 8.4.0;
10692+
MARKETING_VERSION = 8.4.1;
1069310693
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1069410694
PRODUCT_NAME = "$(TARGET_NAME)";
1069510695
SDKROOT = watchos;
@@ -10714,7 +10714,7 @@
1071410714
"@executable_path/Frameworks",
1071510715
"@executable_path/../../Frameworks",
1071610716
);
10717-
MARKETING_VERSION = 8.4.0;
10717+
MARKETING_VERSION = 8.4.1;
1071810718
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1071910719
PRODUCT_NAME = "${TARGET_NAME}";
1072010720
SDKROOT = watchos;
@@ -10741,7 +10741,7 @@
1074110741
"@executable_path/Frameworks",
1074210742
"@executable_path/../../Frameworks",
1074310743
);
10744-
MARKETING_VERSION = 8.4.0;
10744+
MARKETING_VERSION = 8.4.1;
1074510745
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1074610746
PRODUCT_NAME = "${TARGET_NAME}";
1074710747
SDKROOT = watchos;
@@ -11650,7 +11650,7 @@
1165011650
EXCLUDED_ARCHS = "";
1165111651
IBSC_MODULE = WatchApp_Extension;
1165211652
INFOPLIST_FILE = WatchApp/Info.plist;
11653-
MARKETING_VERSION = 8.4.0;
11653+
MARKETING_VERSION = 8.4.1;
1165411654
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1165511655
PRODUCT_NAME = "$(TARGET_NAME)";
1165611656
SDKROOT = watchos;
@@ -11675,7 +11675,7 @@
1167511675
"@executable_path/Frameworks",
1167611676
"@executable_path/../../Frameworks",
1167711677
);
11678-
MARKETING_VERSION = 8.4.0;
11678+
MARKETING_VERSION = 8.4.1;
1167911679
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1168011680
PRODUCT_NAME = "${TARGET_NAME}";
1168111681
SDKROOT = watchos;
@@ -11959,7 +11959,7 @@
1195911959
EXCLUDED_ARCHS = "";
1196011960
IBSC_MODULE = WatchApp_Extension;
1196111961
INFOPLIST_FILE = WatchApp/Info.plist;
11962-
MARKETING_VERSION = 8.4.0;
11962+
MARKETING_VERSION = 8.4.1;
1196311963
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp;
1196411964
PRODUCT_NAME = "$(TARGET_NAME)";
1196511965
SDKROOT = watchos;
@@ -11984,7 +11984,7 @@
1198411984
"@executable_path/Frameworks",
1198511985
"@executable_path/../../Frameworks",
1198611986
);
11987-
MARKETING_VERSION = 8.4.0;
11987+
MARKETING_VERSION = 8.4.1;
1198811988
PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension;
1198911989
PRODUCT_NAME = "${TARGET_NAME}";
1199011990
SDKROOT = watchos;

DashWallet/Sources/UI/Home/Views/Home Balance View/BalanceModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ final class BalanceModel: ObservableObject {
7272
}
7373

7474
options.userHasBalance = balanceValue > 0
75+
isBalanceHidden = DWGlobalOptions.sharedInstance().balanceHidden
7576
}
7677

7778
func toggleBalanceVisibility() {

DashWallet/Sources/UI/Menu/Main/MainMenuViewController.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class MainMenuViewController: UIViewController {
9696
self.presentSupportEmailController()
9797
}
9898
#else
99-
let swiftUIView = MainMenuView(
99+
let swiftUIView = MainMenuScreen(
100100
vc: navigationController!,
101101
delegate: delegate as? MainMenuViewControllerDelegate,
102102
wipeDelegate: delegate
@@ -182,12 +182,14 @@ struct MainMenuScreen: View {
182182
) {
183183
self.vc = vc
184184
self.onContactSupport = onContactSupport
185-
self.viewModel = MainMenuViewModel()
185+
let viewModel = MainMenuViewModel()
186186
self.delegateInternal = DelegateInternal(
187187
delegate: delegate,
188188
wipeDelegate: wipeDelegate,
189-
viewModel: viewModel
189+
viewModel: viewModel,
190+
showCreditsWarning: { _, _ in }
190191
)
192+
self.viewModel = viewModel
191193
}
192194
#endif
193195

@@ -204,7 +206,7 @@ struct MainMenuScreen: View {
204206
Spacer()
205207
}
206208
.padding(.horizontal, 20)
207-
.padding(.top, 10)
209+
.padding(.top, 5)
208210

209211
#if DASHPAY
210212
if viewModel.userProfileModel?.showJoinDashpay == true {
@@ -280,6 +282,7 @@ struct MainMenuScreen: View {
280282
.padding(.bottom, 30)
281283
}
282284

285+
#if DASHPAY
283286
if viewModel.showCreditsWarning {
284287
ModalDialog(
285288
style: .warning,
@@ -303,6 +306,7 @@ struct MainMenuScreen: View {
303306
.background(Color.black.opacity(0.7))
304307
.edgesIgnoringSafeArea(.all)
305308
}
309+
#endif
306310

307311
NavigationLink(
308312
destination: SettingsScreen(vc: vc, onDidRescan: {
@@ -325,7 +329,7 @@ struct MainMenuScreen: View {
325329
}
326330

327331
NavigationLink(
328-
destination: SecurityScreen(vc: vc),
332+
destination: SecurityMenuScreen(vc: vc),
329333
isActive: $showSecurity
330334
) {
331335
EmptyView()
@@ -338,6 +342,7 @@ struct MainMenuScreen: View {
338342
.onReceive(viewModel.$navigationDestination) { destination in
339343
handleNavigation(destination)
340344
}
345+
#if DASHPAY
341346
.sheet(isPresented: $showMixDialog) {
342347
let dialog = MixDashDialog(
343348
positiveAction: {
@@ -372,6 +377,7 @@ struct MainMenuScreen: View {
372377
dialog
373378
}
374379
}
380+
#endif
375381
}
376382

377383
#if DASHPAY

DashWallet/Sources/UI/Menu/MenuItemModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class MenuItemModel: Identifiable, Equatable, Hashable {
2626
var icon: IconName? = nil
2727
var showInfo: Bool = false
2828
var showToggle: Bool = false
29-
@State var isToggled: Bool = false
29+
var isToggled: Bool = false
3030
var action: (() -> Void)? = nil
3131

3232
init(title: String, subtitle: String? = nil, details: String? = nil, icon: IconName? = nil, showInfo: Bool = false, showToggle: Bool = false, isToggled: Bool = false, action: (() -> Void)? = nil) {
@@ -36,7 +36,7 @@ class MenuItemModel: Identifiable, Equatable, Hashable {
3636
self.icon = icon
3737
self.showInfo = showInfo
3838
self.showToggle = showToggle
39-
self._isToggled = State<Bool>.init(initialValue: isToggled)
39+
self.isToggled = isToggled
4040
self.action = action
4141
}
4242

DashWallet/Sources/UI/Menu/Security/SecurityScreen.swift renamed to DashWallet/Sources/UI/Menu/Security/SecurityMenuScreen.swift

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import SwiftUI
1919
import UIKit
2020

21-
struct SecurityScreen: View {
21+
struct SecurityMenuScreen: View {
2222
private let vc: UINavigationController
2323
private let delegateInternal: DelegateInternal
2424

@@ -34,6 +34,35 @@ struct SecurityScreen: View {
3434

3535
var body: some View {
3636
VStack(alignment: .leading, spacing: 0) {
37+
// Back button
38+
HStack {
39+
Button(action: {
40+
vc.popViewController(animated: true)
41+
}) {
42+
Image(systemName: "chevron.left")
43+
.font(.system(size: 18, weight: .medium))
44+
.foregroundColor(.black)
45+
.frame(width: 36, height: 36)
46+
.overlay(
47+
Circle().stroke(Color.gray300.opacity(0.3), lineWidth: 1)
48+
)
49+
}
50+
Spacer()
51+
}
52+
.padding(.horizontal, 5)
53+
.padding(.top, 10)
54+
55+
// Header
56+
HStack {
57+
Text(NSLocalizedString("Security", comment: ""))
58+
.font(.title)
59+
.fontWeight(.bold)
60+
.foregroundColor(.primaryText)
61+
Spacer()
62+
}
63+
.padding(.top, 30)
64+
.padding(.bottom, 20)
65+
3766
VStack(spacing: 0) {
3867
ForEach(viewModel.items) { item in
3968
MenuItem(
@@ -58,9 +87,8 @@ struct SecurityScreen: View {
5887
Spacer()
5988
}
6089
.padding(.horizontal, 20)
61-
.padding(.top, 16)
6290
.background(Color.primaryBackground)
63-
.navigationBarTitleDisplayMode(.inline)
91+
.navigationBarHidden(true)
6492
.onReceive(viewModel.$navigationDestination) { destination in
6593
handleNavigation(destination)
6694
}
@@ -86,6 +114,7 @@ struct SecurityScreen: View {
86114
model.getOrCreateNewWallet()
87115
let controller = DWPreviewSeedPhraseViewController(model: model)
88116
controller.delegate = delegateInternal
117+
controller.hidesBottomBarWhenPushed = true
89118
self.vc.pushViewController(controller, animated: true)
90119
}
91120
}
@@ -94,6 +123,7 @@ struct SecurityScreen: View {
94123
if authenticated {
95124
let controller = DWSetPinViewController(intent: .changePin)
96125
controller.delegate = delegateInternal
126+
controller.hidesBottomBarWhenPushed = true
97127
self.vc.pushViewController(controller, animated: true)
98128
}
99129
}
@@ -141,7 +171,7 @@ struct SecurityScreen: View {
141171
}
142172
}
143173

144-
extension SecurityScreen {
174+
extension SecurityMenuScreen {
145175
class DelegateInternal: NSObject, DWSecureWalletDelegate, DWSetPinViewControllerDelegate, DWWipeDelegate {
146176
let onHide: () -> ()
147177

DashWallet/Sources/UI/Menu/Security/SecurityMenuViewModel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class SecurityMenuViewModel: ObservableObject {
4444
let biometryType = biometricAuthModel.biometryType
4545
hasTouchID = biometryType == .touchID
4646
hasFaceID = biometryType == .faceID
47-
48-
setupItems()
4947
biometricsEnabled = DWGlobalOptions.sharedInstance().biometricAuthEnabled
5048
balanceHidden = DWGlobalOptions.sharedInstance().balanceHidden
49+
50+
setupItems()
5151
}
5252

5353
private func setupItems() {

DashWallet/Sources/UI/Menu/Settings/SettingsMenuViewModel.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class SettingsMenuViewModel: ObservableObject {
5454
self.notificationsEnabled = DWGlobalOptions.sharedInstance().localNotificationsEnabled
5555
refreshMenuItems()
5656
setupCoinJoinObservers()
57+
setupCurrencyChangeObserver()
5758
}
5859

5960
func resetNavigation() {
@@ -88,6 +89,15 @@ class SettingsMenuViewModel: ObservableObject {
8889
.store(in: &cancellableBag)
8990
}
9091

92+
private func setupCurrencyChangeObserver() {
93+
NotificationCenter.default.publisher(for: Notification.Name.fiatCurrencyDidChange)
94+
.receive(on: DispatchQueue.main)
95+
.sink { [weak self] _ in
96+
self?.refreshMenuItems()
97+
}
98+
.store(in: &cancellableBag)
99+
}
100+
91101
private func refreshMenuItems() {
92102
self.items = [
93103
MenuItemModel(

DashWallet/Sources/UI/Menu/Settings/SettingsScreen.swift

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,35 @@ struct SettingsScreen: View {
4040

4141
var body: some View {
4242
VStack(alignment: .leading, spacing: 0) {
43+
// Back button
44+
HStack {
45+
Button(action: {
46+
vc.popViewController(animated: true)
47+
}) {
48+
Image(systemName: "chevron.left")
49+
.font(.system(size: 18, weight: .medium))
50+
.foregroundColor(.black)
51+
.frame(width: 36, height: 36)
52+
.overlay(
53+
Circle().stroke(Color.gray300.opacity(0.3), lineWidth: 1)
54+
)
55+
}
56+
Spacer()
57+
}
58+
.padding(.horizontal, 5)
59+
.padding(.top, 10)
60+
61+
// Header
62+
HStack {
63+
Text(NSLocalizedString("Settings", comment: ""))
64+
.font(.title)
65+
.fontWeight(.bold)
66+
.foregroundColor(.primaryText)
67+
Spacer()
68+
}
69+
.padding(.top, 30)
70+
.padding(.bottom, 20)
71+
4372
VStack(spacing: 0) {
4473
ForEach(viewModel.items) { item in
4574
if let cjItem = item as? CoinJoinMenuItemModel {
@@ -75,9 +104,8 @@ struct SettingsScreen: View {
75104
Spacer()
76105
}
77106
.padding(.horizontal, 20)
78-
.padding(.top, 16)
79107
.background(Color.primaryBackground)
80-
.navigationBarTitleDisplayMode(.inline)
108+
.navigationBarHidden(true)
81109
.onReceive(viewModel.$navigationDestination) { destination in
82110
handleNavigation(destination)
83111
}
@@ -223,7 +251,9 @@ extension SettingsScreen {
223251
self.onHide = onHide
224252
}
225253

226-
func localCurrencyViewController(_ controller: DWLocalCurrencyViewController, didSelectCurrency currencyCode: String) { onHide() }
254+
func localCurrencyViewController(_ controller: DWLocalCurrencyViewController, didSelectCurrency currencyCode: String) {
255+
onHide()
256+
}
227257
func localCurrencyViewControllerDidCancel(_ controller: DWLocalCurrencyViewController) { onHide() }
228258
}
229259
}

0 commit comments

Comments
 (0)