Skip to content

Commit

Permalink
ui: price animation
Browse files Browse the repository at this point in the history
  • Loading branch information
reez authored Sep 29, 2024
1 parent 7ac9005 commit 4f0a4db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions BDKSwiftExampleWallet/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@
}
}
}
},
"$" : {

},
"12 Word Seed Phrase (Optional)" : {
"extractionState" : "stale",
Expand Down
14 changes: 11 additions & 3 deletions BDKSwiftExampleWallet/View/WalletView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,17 @@ struct WalletView: View {
.variableColor.cumulative
)
}
Text(viewModel.satsPrice, format: .currency(code: "USD"))
.contentTransition(.numericText())
.fontDesign(.rounded)
if viewModel.walletSyncState == .synced {
Text(viewModel.satsPrice, format: .currency(code: "USD"))
.fontDesign(.rounded)
.contentTransition(.numericText())
.animation(.spring(response: 0.5, dampingFraction: 0.6, blendDuration: 0.5), value: viewModel.satsPrice)
} else {
Text("$")
.foregroundStyle(.secondary)
.fontDesign(.rounded)
.transition(.opacity)
}
}
.foregroundStyle(.secondary)
.font(.subheadline)
Expand Down

0 comments on commit 4f0a4db

Please sign in to comment.