Skip to content

Commit 4f0a4db

Browse files
authored
ui: price animation
1 parent 7ac9005 commit 4f0a4db

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

BDKSwiftExampleWallet/Resources/Localizable.xcstrings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@
181181
}
182182
}
183183
}
184+
},
185+
"$" : {
186+
184187
},
185188
"12 Word Seed Phrase (Optional)" : {
186189
"extractionState" : "stale",

BDKSwiftExampleWallet/View/WalletView.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,17 @@ struct WalletView: View {
6666
.variableColor.cumulative
6767
)
6868
}
69-
Text(viewModel.satsPrice, format: .currency(code: "USD"))
70-
.contentTransition(.numericText())
71-
.fontDesign(.rounded)
69+
if viewModel.walletSyncState == .synced {
70+
Text(viewModel.satsPrice, format: .currency(code: "USD"))
71+
.fontDesign(.rounded)
72+
.contentTransition(.numericText())
73+
.animation(.spring(response: 0.5, dampingFraction: 0.6, blendDuration: 0.5), value: viewModel.satsPrice)
74+
} else {
75+
Text("$")
76+
.foregroundStyle(.secondary)
77+
.fontDesign(.rounded)
78+
.transition(.opacity)
79+
}
7280
}
7381
.foregroundStyle(.secondary)
7482
.font(.subheadline)

0 commit comments

Comments
 (0)