diff --git a/DashWallet.xcodeproj/project.pbxproj b/DashWallet.xcodeproj/project.pbxproj index dc1743059..399b0070f 100644 --- a/DashWallet.xcodeproj/project.pbxproj +++ b/DashWallet.xcodeproj/project.pbxproj @@ -824,6 +824,7 @@ C91E919729FBACE6003E7883 /* ExtendedPublicKeysModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91E919629FBACE6003E7883 /* ExtendedPublicKeysModel.swift */; }; C91E91AE29FFC8A1003E7883 /* ExtendedPublicKeysViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91E91AD29FFC8A1003E7883 /* ExtendedPublicKeysViewController.swift */; }; B3A1F2C4D5E6078901234568 /* ExtendedPublicKeySheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3A1F2C4D5E6078901234567 /* ExtendedPublicKeySheet.swift */; }; + C5D7E9F1A2B3C4D5E6F70012 /* CSVExportSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D7E9F1A2B3C4D5E6F70011 /* CSVExportSheet.swift */; }; C93078482A6AD4F500906E4B /* ConfirmPaymentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C956AF222A5C7D93002FAB75 /* ConfirmPaymentViewController.swift */; }; C93078492A6AD4FC00906E4B /* UpholdConfirmViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C956AF2E2A5D5F6B002FAB75 /* UpholdConfirmViewController.swift */; }; C930784A2A6AD52400906E4B /* UpholdConfirmTransferModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C956AF302A5D601C002FAB75 /* UpholdConfirmTransferModel.swift */; }; @@ -1103,6 +1104,7 @@ C9D2C6D52A320AA000D15901 /* TransactionMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4709C314287EA11900B4BD48 /* TransactionMetadata.swift */; }; C9D2C6D62A320AA000D15901 /* ExtendedPublicKeysViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91E91AD29FFC8A1003E7883 /* ExtendedPublicKeysViewController.swift */; }; B3A1F2C4D5E6078901234569 /* ExtendedPublicKeySheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3A1F2C4D5E6078901234567 /* ExtendedPublicKeySheet.swift */; }; + C5D7E9F1A2B3C4D5E6F70013 /* CSVExportSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D7E9F1A2B3C4D5E6F70011 /* CSVExportSheet.swift */; }; C9D2C6D82A320AA000D15901 /* AtmListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47AE8BDD28C1305E00490F5E /* AtmListViewController.swift */; }; C9D2C6D92A320AA000D15901 /* TxDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47A5145F2848F75B005A8E3E /* TxDetailViewController.swift */; }; C9D2C6DA2A320AA000D15901 /* NSAttributedString+Builder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 472D13E9299E5396006903F1 /* NSAttributedString+Builder.swift */; }; @@ -2705,6 +2707,7 @@ C91E919629FBACE6003E7883 /* ExtendedPublicKeysModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtendedPublicKeysModel.swift; sourceTree = ""; }; C91E91AD29FFC8A1003E7883 /* ExtendedPublicKeysViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtendedPublicKeysViewController.swift; sourceTree = ""; }; B3A1F2C4D5E6078901234567 /* ExtendedPublicKeySheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtendedPublicKeySheet.swift; sourceTree = ""; }; + C5D7E9F1A2B3C4D5E6F70011 /* CSVExportSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSVExportSheet.swift; sourceTree = ""; }; C943B2BA2A408CEC00AF23C5 /* DWUpdatingUserProfileView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWUpdatingUserProfileView.h; sourceTree = ""; }; C943B2BB2A408CEC00AF23C5 /* DWCurrentUserProfileView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWCurrentUserProfileView.h; sourceTree = ""; }; C943B2BC2A408CEC00AF23C5 /* DWErrorUpdatingUserProfileView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DWErrorUpdatingUserProfileView.m; sourceTree = ""; }; @@ -4285,6 +4288,7 @@ FB3FF0B0222641210059A9A5 /* Masternode Keys */, 7566F4822BB69498005238D2 /* ToolsMenuScreen.swift */, 752F81A82E323FD000ADA76D /* ToolsMenuViewModel.swift */, + C5D7E9F1A2B3C4D5E6F70011 /* CSVExportSheet.swift */, ); path = Tools; sourceTree = ""; @@ -8641,6 +8645,7 @@ 4709C315287EA11900B4BD48 /* TransactionMetadata.swift in Sources */, C91E91AE29FFC8A1003E7883 /* ExtendedPublicKeysViewController.swift in Sources */, B3A1F2C4D5E6078901234568 /* ExtendedPublicKeySheet.swift in Sources */, + C5D7E9F1A2B3C4D5E6F70012 /* CSVExportSheet.swift in Sources */, 47AE8BFE28C1306000490F5E /* AtmListViewController.swift in Sources */, 754D02082D155564005CA466 /* CoinJoinTransaction.swift in Sources */, 47A514602848F75B005A8E3E /* TxDetailViewController.swift in Sources */, @@ -9323,6 +9328,7 @@ C9D2C6D52A320AA000D15901 /* TransactionMetadata.swift in Sources */, C9D2C6D62A320AA000D15901 /* ExtendedPublicKeysViewController.swift in Sources */, B3A1F2C4D5E6078901234569 /* ExtendedPublicKeySheet.swift in Sources */, + C5D7E9F1A2B3C4D5E6F70013 /* CSVExportSheet.swift in Sources */, C9D2C6D82A320AA000D15901 /* AtmListViewController.swift in Sources */, C9D2C6D92A320AA000D15901 /* TxDetailViewController.swift in Sources */, C9D2C6DA2A320AA000D15901 /* NSAttributedString+Builder.swift in Sources */, @@ -10501,7 +10507,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -10641,7 +10647,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -10815,7 +10821,7 @@ EXCLUDED_ARCHS = ""; IBSC_MODULE = WatchApp_Extension; INFOPLIST_FILE = WatchApp/Info.plist; - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -10837,7 +10843,7 @@ EXCLUDED_ARCHS = ""; IBSC_MODULE = WatchApp_Extension; INFOPLIST_FILE = WatchApp/Info.plist; - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -10862,7 +10868,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; @@ -10889,7 +10895,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; @@ -10921,7 +10927,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -10950,7 +10956,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -11000,7 +11006,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -11134,7 +11140,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -11279,7 +11285,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -11422,7 +11428,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -11625,7 +11631,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -11738,7 +11744,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -11794,7 +11800,7 @@ EXCLUDED_ARCHS = ""; IBSC_MODULE = WatchApp_Extension; INFOPLIST_FILE = WatchApp/Info.plist; - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -11819,7 +11825,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; @@ -11936,7 +11942,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -12048,7 +12054,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.TodayExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -12103,7 +12109,7 @@ EXCLUDED_ARCHS = ""; IBSC_MODULE = WatchApp_Extension; INFOPLIST_FILE = WatchApp/Info.plist; - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -12128,7 +12134,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 8.5.5; + MARKETING_VERSION = 8.5.6; PRODUCT_BUNDLE_IDENTIFIER = org.dashfoundation.dash.watchkitapp.watchkitextension; PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = watchos; diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/Contents.json b/DashWallet/Resources/AppAssets.xcassets/Illustration/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/DashWallet/Resources/AppAssets.xcassets/Illustration/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/Contents.json b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/Contents.json new file mode 100644 index 000000000..f546bb73b --- /dev/null +++ b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "export.csv.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "export.csv@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "export.csv@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv.png b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv.png new file mode 100644 index 000000000..051c3d09a Binary files /dev/null and b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv.png differ diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv@2x.png b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv@2x.png new file mode 100644 index 000000000..83126f1df Binary files /dev/null and b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv@2x.png differ diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv@3x.png b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv@3x.png new file mode 100644 index 000000000..42e6fe7dc Binary files /dev/null and b/DashWallet/Resources/AppAssets.xcassets/Illustration/csv-export-large.imageset/export.csv@3x.png differ diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/Contents.json b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/Contents.json new file mode 100644 index 000000000..acfe427cd --- /dev/null +++ b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "zenledger-large.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "zenledger-large@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "zenledger-large@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large.png b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large.png new file mode 100644 index 000000000..ffa7be8ae Binary files /dev/null and b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large.png differ diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large@2x.png b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large@2x.png new file mode 100644 index 000000000..91d819c55 Binary files /dev/null and b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large@2x.png differ diff --git a/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large@3x.png b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large@3x.png new file mode 100644 index 000000000..56c58d17c Binary files /dev/null and b/DashWallet/Resources/AppAssets.xcassets/Illustration/zenledger-large.imageset/zenledger-large@3x.png differ diff --git a/DashWallet/Sources/UI/Menu/Tools/CSVExportSheet.swift b/DashWallet/Sources/UI/Menu/Tools/CSVExportSheet.swift new file mode 100644 index 000000000..802a05629 --- /dev/null +++ b/DashWallet/Sources/UI/Menu/Tools/CSVExportSheet.swift @@ -0,0 +1,99 @@ +// +// CSVExportSheet.swift +// DashWallet +// +// Copyright © 2026 Dash Core Group. All rights reserved. +// +// Licensed under the MIT License (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://opensource.org/licenses/MIT +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import SwiftUI + +struct CSVExportSheet: View { + @Environment(\.presentationMode) private var presentationMode + @Environment(\.colorScheme) private var colorScheme + let onExport: () -> Void + + var body: some View { + VStack(spacing: 0) { + // Grabber + Capsule() + .fill(colorScheme == .dark ? Color.whiteAlpha20 : Color.gray300Alpha50) + .frame(width: 36, height: 5) + .padding(.top, 6) + .padding(.bottom, 6) + + // Close button + NavBarClose { + presentationMode.wrappedValue.dismiss() + } + + // Content + VStack(spacing: 0) { + // Icon + Image("csv-export-large") + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 94, height: 100) + .padding(.top, 20) + .padding(.bottom, 10) + + // Text content + VStack(alignment: .leading, spacing: 6) { + Text(NSLocalizedString("The full transaction history will be exported as a CSV file", comment: "")) + .font(.system(size: 28, weight: .bold)) + .foregroundColor(Color.primaryText) + .multilineTextAlignment(.leading) + .fixedSize(horizontal: false, vertical: true) + + Text(NSLocalizedString("All payments will be considered as an expense and all incoming transactions will be income.\nThe owner of this wallet is responsible for making any cost basis adjustments in their chosen tax reporting system.", comment: "")) + .font(.system(size: 15)) + .foregroundColor(Color.secondaryText) + .multilineTextAlignment(.leading) + .lineSpacing(5) + .fixedSize(horizontal: false, vertical: true) + } + .padding(.horizontal, 40) + .padding(.top, 20) + .padding(.bottom, 32) + } + + Spacer() + + // Button + VStack(spacing: 0) { + DashButton( + text: NSLocalizedString("Export CSV", comment: ""), + style: .filledBlue, + size: .large, + stretch: true, + isEnabled: true, + action: { + presentationMode.wrappedValue.dismiss() + onExport() + } + ) + .padding(.horizontal, 60) + } + .padding(.top, 20) + .padding(.bottom, 20) + } + .background(Color.secondaryBackground) + } +} + +struct CSVExportSheet_Previews: PreviewProvider { + static var previews: some View { + CSVExportSheet(onExport: {}) + } +} diff --git a/DashWallet/Sources/UI/Menu/Tools/ImportWallet/ImportPrivateKeySheet.swift b/DashWallet/Sources/UI/Menu/Tools/ImportWallet/ImportPrivateKeySheet.swift index abfe8ed17..d61faa920 100644 --- a/DashWallet/Sources/UI/Menu/Tools/ImportWallet/ImportPrivateKeySheet.swift +++ b/DashWallet/Sources/UI/Menu/Tools/ImportWallet/ImportPrivateKeySheet.swift @@ -32,27 +32,9 @@ struct ImportPrivateKeySheet: View { .padding(.bottom, 6) // Close button - HStack { - Spacer() - - Button(action: { - presentationMode.wrappedValue.dismiss() - }) { - Image(colorScheme == .dark ? "icon-close-sheet-white" : "icon-close-sheet") - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: 9, height: 9) - .foregroundColor(Color.primaryText) - .frame(width: 34, height: 34) - .overlay( - Circle() - .stroke(Color.gray300.opacity(0.3), lineWidth: 1.5) - ) - } - .padding(.horizontal, 20) + NavBarClose { + presentationMode.wrappedValue.dismiss() } - .frame(height: 64) - .background(Color.secondaryBackground) // Content VStack(spacing: 0) { diff --git a/DashWallet/Sources/UI/Menu/Tools/ToolsMenuScreen.swift b/DashWallet/Sources/UI/Menu/Tools/ToolsMenuScreen.swift index 073141f54..5df4a2101 100644 --- a/DashWallet/Sources/UI/Menu/Tools/ToolsMenuScreen.swift +++ b/DashWallet/Sources/UI/Menu/Tools/ToolsMenuScreen.swift @@ -25,7 +25,7 @@ struct ToolsMenuScreen: View { private let onImportPrivateKey: () -> () @StateObject private var viewModel = ToolsMenuViewModel() - @State private var showCSVExportAlert = false + @State private var showCSVExportSheet = false @State private var showCSVExportActivity = false @State private var showZenLedgerSheet = false @State private var showImportPrivateKeySheet = false @@ -122,13 +122,17 @@ struct ToolsMenuScreen: View { .onReceive(viewModel.$showCSVExportActivity) { show in showCSVExportActivity = show } - .alert(NSLocalizedString("CSV Export", comment: ""), isPresented: $showCSVExportAlert) { - Button(NSLocalizedString("Continue", comment: "")) { - handleCSVExport() + .sheet(isPresented: $showCSVExportSheet) { + if #available(iOS 16.4, *) { + CSVExportSheet(onExport: handleCSVExport) + .presentationDetents([.large]) + .presentationCornerRadius(32) + } else if #available(iOS 16.0, *) { + CSVExportSheet(onExport: handleCSVExport) + .presentationDetents([.large]) + } else { + CSVExportSheet(onExport: handleCSVExport) } - Button(NSLocalizedString("Cancel", comment: ""), role: .cancel) { } - } message: { - Text(NSLocalizedString("All payments will be considered as an Expense and all incoming transactions will be Income. The owner of this wallet is responsible for making any cost basis adjustments in their chosen tax reporting system.", comment: "")) } .sheet(isPresented: $showCSVExportActivity) { if let csvData = viewModel.csvExportData { @@ -141,9 +145,13 @@ struct ToolsMenuScreen: View { viewModel.safariLink = nil } }) { - if #available(iOS 16.0, *) { + if #available(iOS 16.4, *) { + ZenLedgerInfoSheet(safariLink: $viewModel.safariLink) + .presentationDetents([.large]) + .presentationCornerRadius(32) + } else if #available(iOS 16.0, *) { ZenLedgerInfoSheet(safariLink: $viewModel.safariLink) - .presentationDetents([.height(450)]) + .presentationDetents([.large]) } else { ZenLedgerInfoSheet(safariLink: $viewModel.safariLink) } @@ -183,7 +191,7 @@ struct ToolsMenuScreen: View { case .masternodeKeys: showMasternodeKeys() case .csvExport: - showCSVExportAlert = true + showCSVExportSheet = true case .zenLedger: showZenLedgerSheet = true case .none: diff --git a/DashWallet/Sources/UI/Menu/Tools/ZenLedger/ZenLedgerInfoSheet.swift b/DashWallet/Sources/UI/Menu/Tools/ZenLedger/ZenLedgerInfoSheet.swift index c3a48be1d..be6fc3dea 100644 --- a/DashWallet/Sources/UI/Menu/Tools/ZenLedger/ZenLedgerInfoSheet.swift +++ b/DashWallet/Sources/UI/Menu/Tools/ZenLedger/ZenLedgerInfoSheet.swift @@ -1,4 +1,4 @@ -// +// // Created by Andrei Ashikhmin // Copyright © 2024 Dash Core Group. All rights reserved. // @@ -22,36 +22,90 @@ struct ZenLedgerInfoSheet: View { @State private var showAlert: Bool = false @State private var errorAlert: Bool = false @State private var inProgress: Bool = false - @Environment(\.openURL) private var openURL @Environment(\.presentationMode) private var presentationMode - + @Environment(\.colorScheme) private var colorScheme + @Binding var safariLink: String? - + var body: some View { - BottomSheet(showBackButton: Binding.constant(false)) { - TextIntro( - icon: .custom("zenledger_large"), - buttonLabel: NSLocalizedString("Export all transactions", comment: "ZenLedger"), - action: { showAlert = true }, - inProgress: $inProgress - ) { - FeatureTopText( - title: NSLocalizedString("Simplify your crypto taxes", comment: "ZenLedger"), - text: NSLocalizedString("Connect your crypto wallets to the ZenLedger platform. Learn more and get started with your Dash Wallet transactions.", comment: "ZenLedger"), - label: "zenledger.io", - labelIcon: .custom("external.link"), - linkAction: { + VStack(spacing: 0) { + // Grabber + Capsule() + .fill(colorScheme == .dark ? Color.whiteAlpha20 : Color.gray300Alpha50) + .frame(width: 36, height: 5) + .padding(.top, 6) + .padding(.bottom, 6) + + // Close button + NavBarClose { + presentationMode.wrappedValue.dismiss() + } + + // Content + VStack(spacing: 0) { + // Icon + Image("zenledger-large") + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 94, height: 100) + .padding(.top, 20) + .padding(.bottom, 10) + + // Text content + VStack(alignment: .center, spacing: 6) { + Text(NSLocalizedString("Simplify your crypto taxes", comment: "ZenLedger")) + .font(.system(size: 28, weight: .bold)) + .foregroundColor(Color.primaryText) + .multilineTextAlignment(.center) + .fixedSize(horizontal: false, vertical: true) + + Text(NSLocalizedString("Connect your crypto wallets to the ZenLedger platform. Learn more and get started with your Dash Wallet transactions.", comment: "ZenLedger")) + .font(.system(size: 15)) + .foregroundColor(Color.secondaryText) + .multilineTextAlignment(.center) + .lineSpacing(5) + .fixedSize(horizontal: false, vertical: true) + + // zenledger.io link + Button(action: { safariLink = "https://app.zenledger.io/new_sign_up/" presentationMode.wrappedValue.dismiss() + }) { + Text("zenledger.io") + .font(.system(size: 13, weight: .semibold)) + .foregroundColor(.blue) } + .padding(.top, 8) + } + .padding(.horizontal, 40) + .padding(.top, 20) + .padding(.bottom, 32) + } + + Spacer() + + // Button + VStack(spacing: 0) { + DashButton( + text: NSLocalizedString("Export all transactions", comment: "ZenLedger"), + style: .filledBlue, + size: .large, + stretch: true, + isEnabled: true, + isLoading: inProgress, + action: { showAlert = true } ) + .padding(.horizontal, 60) } + .padding(.top, 20) + .padding(.bottom, 20) } + .background(Color.secondaryBackground) .alert(isPresented: $showAlert) { resolveAlert() } } - + private func resolveAlert() -> Alert { if errorAlert { Alert( @@ -77,11 +131,11 @@ struct ZenLedgerInfoSheet: View { ) } } - + private func export() { Task { inProgress = true - + do { if let signupLink = try await viewModel.export() { safariLink = signupLink @@ -92,7 +146,7 @@ struct ZenLedgerInfoSheet: View { errorAlert = true showAlert = true } - + inProgress = false } } diff --git a/DashWallet/Sources/UI/SwiftUI Components/NavigationBar.swift b/DashWallet/Sources/UI/SwiftUI Components/NavigationBar.swift index f18b57389..029929885 100644 --- a/DashWallet/Sources/UI/SwiftUI Components/NavigationBar.swift +++ b/DashWallet/Sources/UI/SwiftUI Components/NavigationBar.swift @@ -1,4 +1,4 @@ -// + // // NavigationBar.swift // DashWallet // diff --git a/DashWallet/en.lproj/Localizable.strings b/DashWallet/en.lproj/Localizable.strings index eebe86dd9..d86885e7c 100644 --- a/DashWallet/en.lproj/Localizable.strings +++ b/DashWallet/en.lproj/Localizable.strings @@ -3187,6 +3187,9 @@ /* Savings percentage */ "~%.0f%%" = "~%.0f%%"; +/* CSV Export */ +"The full transaction history will be exported as a CSV file" = "The full transaction history will be exported as a CSV file"; + /* Import private key */ "Import private key" = "Import private key";