fix: Remove walletModel reference from AccountSelector

Remove all `walletModel` references from the `AccountSelector` component, as the component should not be aware of the API's existence.

Pass currency to `AccountSelector` component.
This commit is contained in:
emizzle 2020-08-06 12:33:30 +10:00 committed by Pascal Precht
parent 40e8802218
commit 6df29da7b0
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
2 changed files with 4 additions and 2 deletions

View File

@ -114,6 +114,7 @@ Item {
AccountSelector {
id: selectFromAccount
accounts: walletModel.accounts
currency: walletModel.defaultCurrency
anchors.top: selectAsset.bottom
anchors.topMargin: Style.current.padding
anchors.left: parent.left

View File

@ -11,6 +11,7 @@ Item {
property var selectedAccount: {
"address": "", "name": "", "iconColor": "", "fiatBalance": ""
}
property string currency: "usd"
height: select.height + selectedAccountDetails.height
// set to asset symbol to display asset's balance top right
// NOTE: if this asset is not selected as a wallet token in the UI, then
@ -99,7 +100,7 @@ Item {
color: Style.current.secondaryText
}
StyledText {
text: selectedAccount.fiatBalance + " " + walletModel.defaultCurrency.toUpperCase()
text: selectedAccount.fiatBalance + " " + root.currency.toUpperCase()
font.pixelSize: 12
height: 16
color: Style.current.secondaryText
@ -175,7 +176,7 @@ Item {
font.pixelSize: 15
height: 22
color: Style.current.secondaryText
text: walletModel.defaultCurrency.toUpperCase()
text: root.currency.toUpperCase()
}
background: Rectangle {
color: itemContainer.highlighted ? Style.current.backgroundHover : Style.current.background