@@ -15,77 +15,74 @@ struct AmountView: View {
15
15
16
16
var body : some View {
17
17
18
- NavigationView {
19
-
20
- ZStack {
21
- Color ( uiColor: . systemBackground)
22
-
23
- VStack ( spacing: 50 ) {
24
- Spacer ( )
25
- VStack ( spacing: 4 ) {
26
- Text ( " \( numpadAmount. formattedWithSeparator) sats " )
27
- . textStyle ( BitcoinTitle1 ( ) )
28
- if let balance = viewModel. balanceTotal {
29
- HStack ( spacing: 2 ) {
30
- Text ( balance. delimiter)
31
- Text ( " total " )
32
- }
33
- . fontWeight ( . semibold)
34
- . font ( . caption)
35
- . foregroundColor ( . secondary)
36
- }
37
- if let balance = viewModel. balanceConfirmed {
38
- HStack ( spacing: 2 ) {
39
- Text ( balance. delimiter)
40
- Text ( " confirmed " )
41
- }
42
- . fontWeight ( . semibold)
43
- . font ( . caption)
44
- . foregroundColor ( . secondary)
18
+ ZStack {
19
+ Color ( uiColor: . systemBackground)
20
+
21
+ VStack ( spacing: 50 ) {
22
+ Spacer ( )
23
+ VStack ( spacing: 4 ) {
24
+ Text ( " \( numpadAmount. formattedWithSeparator) sats " )
25
+ . textStyle ( BitcoinTitle1 ( ) )
26
+ if let balance = viewModel. balanceTotal {
27
+ HStack ( spacing: 2 ) {
28
+ Text ( balance. delimiter)
29
+ Text ( " total " )
45
30
}
31
+ . fontWeight ( . semibold)
32
+ . font ( . caption)
33
+ . foregroundColor ( . secondary)
46
34
}
47
-
48
- GeometryReader { geometry in
49
- let buttonSize = geometry. size. width / 4
50
- VStack ( spacing: buttonSize / 10 ) {
51
- numpadRow ( [ " 1 " , " 2 " , " 3 " ] , buttonSize: buttonSize)
52
- numpadRow ( [ " 4 " , " 5 " , " 6 " ] , buttonSize: buttonSize)
53
- numpadRow ( [ " 7 " , " 8 " , " 9 " ] , buttonSize: buttonSize)
54
- numpadRow ( [ " " , " 0 " , " < " ] , buttonSize: buttonSize)
35
+ if let balance = viewModel. balanceConfirmed {
36
+ HStack ( spacing: 2 ) {
37
+ Text ( balance. delimiter)
38
+ Text ( " confirmed " )
55
39
}
56
- . frame ( maxWidth: . infinity)
40
+ . fontWeight ( . semibold)
41
+ . font ( . caption)
42
+ . foregroundColor ( . secondary)
57
43
}
58
- . frame ( height: 300 )
59
-
60
- Spacer ( )
61
-
62
- VStack {
63
-
64
- Button {
65
- navigationPath. append (
66
- NavigationDestination . address ( amount: numpadAmount)
67
- )
68
- } label: {
69
- Label (
70
- title: { Text ( " Next " ) } ,
71
- icon: { Image ( systemName: " arrow.right " ) }
72
- )
73
- . labelStyle ( . iconOnly)
74
- }
75
- . buttonStyle ( BitcoinOutlined ( width: 100 , isCapsule: true ) )
44
+ }
76
45
46
+ GeometryReader { geometry in
47
+ let buttonSize = geometry. size. width / 4
48
+ VStack ( spacing: buttonSize / 10 ) {
49
+ numpadRow ( [ " 1 " , " 2 " , " 3 " ] , buttonSize: buttonSize)
50
+ numpadRow ( [ " 4 " , " 5 " , " 6 " ] , buttonSize: buttonSize)
51
+ numpadRow ( [ " 7 " , " 8 " , " 9 " ] , buttonSize: buttonSize)
52
+ numpadRow ( [ " " , " 0 " , " < " ] , buttonSize: buttonSize)
77
53
}
78
-
54
+ . frame ( maxWidth : . infinity )
79
55
}
80
- . padding ( )
81
- . task {
82
- viewModel. getBalance ( )
56
+ . frame ( height: 300 )
57
+
58
+ Spacer ( )
59
+
60
+ VStack {
61
+
62
+ Button {
63
+ navigationPath. append (
64
+ NavigationDestination . address ( amount: numpadAmount)
65
+ )
66
+ } label: {
67
+ Label (
68
+ title: { Text ( " Next " ) } ,
69
+ icon: { Image ( systemName: " arrow.right " ) }
70
+ )
71
+ . labelStyle ( . iconOnly)
72
+ }
73
+ . buttonStyle ( BitcoinOutlined ( width: 100 , isCapsule: true ) )
74
+
83
75
}
76
+
84
77
}
85
- . onChange ( of: navigationPath) { oldPath, newPath in
86
- if newPath. isEmpty {
87
- numpadAmount = " 0 "
88
- }
78
+ . padding ( )
79
+ . task {
80
+ viewModel. getBalance ( )
81
+ }
82
+ }
83
+ . onChange ( of: navigationPath) { oldPath, newPath in
84
+ if newPath. isEmpty {
85
+ numpadAmount = " 0 "
89
86
}
90
87
}
91
88
. alert ( isPresented: $viewModel. showingAmountViewErrorAlert) {
0 commit comments