-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathCSVExportSheet.swift
More file actions
99 lines (89 loc) · 3.5 KB
/
CSVExportSheet.swift
File metadata and controls
99 lines (89 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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: {})
}
}