2023-04-26 15:53:49 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
2023-05-11 10:29:19 +00:00
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2023-05-11 10:29:19 +00:00
|
|
|
import AppLayouts.Wallet.panels 1.0
|
|
|
|
import AppLayouts.Wallet.controls 1.0
|
2023-04-26 15:53:49 +00:00
|
|
|
import AppLayouts.Chat.panels 1.0
|
2024-10-24 08:41:28 +00:00
|
|
|
import AppLayouts.Wallet.stores 1.0 as WalletStores
|
2023-04-26 15:53:49 +00:00
|
|
|
|
2023-05-11 10:29:19 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
2024-10-24 08:41:28 +00:00
|
|
|
import shared.stores 1.0 as SharedStores
|
2023-04-26 15:53:49 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
|
|
|
|
property bool globalUtilsReady: false
|
|
|
|
property bool mainModuleReady: false
|
|
|
|
|
2024-10-24 08:41:28 +00:00
|
|
|
SharedStores.NetworkConnectionStore {
|
|
|
|
id: connectionStore
|
|
|
|
|
|
|
|
property bool accountBalanceNotAvailable: false
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: WalletStores.RootStore is singleton and therefore it's not mockable
|
|
|
|
// Once store is converted to regular, non-singleton store it can be mocked as follows
|
|
|
|
// WalletStores.RootStore {
|
|
|
|
// id: walletStore
|
|
|
|
|
|
|
|
// property var filteredFlatModel: SortFilterProxyModel {
|
|
|
|
// sourceModel: NetworksModel.flatNetworks
|
|
|
|
// filters: ValueFilter { roleName: "isTest"; value: false }
|
|
|
|
// }
|
|
|
|
// function toggleNetwork(chainId) {
|
|
|
|
// print ("toggleNetwork called with chainId: " + chainId)
|
|
|
|
// }
|
|
|
|
|
|
|
|
// function getAllNetworksSupportedString(hovered) {
|
|
|
|
// return hovered ? "<font color=\"" + "#627EEA" + "\">" + "eth:" + "</font>" +
|
|
|
|
// "<font color=\"" + "#E90101" + "\">" + "oeth:" + "</font>" +
|
|
|
|
// "<font color=\"" + "#27A0EF" + "\">" + "arb1:" + "</font>" : "eth:oeth:arb1:"
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
// globalUtilsInst mock
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.globalUtilsInst = this
|
|
|
|
root.globalUtilsReady = true
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
root.globalUtilsReady = false
|
|
|
|
Utils.globalUtilsInst = {}
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property string emptyString: ""
|
|
|
|
|
2023-05-11 10:29:19 +00:00
|
|
|
property var dummyOverview: updateDummyView(StatusColors.colors['black'])
|
|
|
|
|
|
|
|
function updateDummyView(color) {
|
2023-06-18 12:47:24 +00:00
|
|
|
const clr = Utils.getIdForColor(color)
|
2023-05-11 10:29:19 +00:00
|
|
|
dummyOverview = ({
|
|
|
|
name: "helloworld",
|
|
|
|
mixedcaseAddress: "0xcdc2ea3b6ba8fed3a3402f8db8b2fab53e7b7421",
|
|
|
|
ens: emptyString,
|
2023-06-18 12:47:24 +00:00
|
|
|
colorId: clr,
|
2023-05-11 10:29:19 +00:00
|
|
|
emoji: "⚽",
|
|
|
|
balanceLoading: false,
|
|
|
|
currencyBalance: ({amount: 1.25,
|
|
|
|
symbol: "USD",
|
|
|
|
displayDecimals: 4,
|
|
|
|
stripTrailingZeroes: false}),
|
|
|
|
isAllAccounts: false,
|
|
|
|
})
|
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
|
|
|
|
property var dummyAllAccountsOverview:({
|
2023-05-11 10:29:19 +00:00
|
|
|
name: "",
|
|
|
|
mixedcaseAddress: "0xcdc2ea3b6ba8fed3a3402f8db8b2fab53e7b7421",
|
|
|
|
ens: emptyString,
|
2023-06-18 12:47:24 +00:00
|
|
|
colorId: "",
|
2023-05-11 10:29:19 +00:00
|
|
|
emoji: "",
|
|
|
|
balanceLoading: false,
|
|
|
|
currencyBalance: ({amount: 1.25,
|
|
|
|
symbol: "USD",
|
|
|
|
displayDecimals: 4,
|
|
|
|
stripTrailingZeroes: false}),
|
|
|
|
isAllAccounts: true,
|
2023-06-18 12:47:24 +00:00
|
|
|
colorIds: "purple;pink;magenta"
|
2023-05-11 10:29:19 +00:00
|
|
|
})
|
2023-04-26 15:53:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// mainModuleInst mock
|
|
|
|
QtObject {
|
|
|
|
function getContactDetailsAsJson(publicKey, getVerificationRequest) {
|
|
|
|
return JSON.stringify({ ensVerified: false })
|
|
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
|
|
Utils.mainModuleInst = this
|
|
|
|
root.mainModuleReady = true
|
|
|
|
}
|
|
|
|
Component.onDestruction: {
|
|
|
|
root.mainModuleReady = false
|
|
|
|
Utils.mainModuleInst = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Item {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
2023-05-22 15:55:47 +00:00
|
|
|
Item {
|
2023-05-11 10:29:19 +00:00
|
|
|
width: 800
|
|
|
|
height: 200
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
|
|
|
AccountHeaderGradient {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
|
|
|
width: parent.width
|
2023-04-26 15:53:49 +00:00
|
|
|
overview: allAccountsCheckbox.checked ? d.dummyAllAccountsOverview : d.dummyOverview
|
2023-05-11 10:29:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.left: parent.left
|
2023-04-26 15:53:49 +00:00
|
|
|
width: parent.width
|
2023-05-11 10:29:19 +00:00
|
|
|
active: globalUtilsReady && mainModuleReady
|
|
|
|
|
|
|
|
sourceComponent: WalletHeader {
|
2024-10-24 08:41:28 +00:00
|
|
|
networkConnectionStore: connectionStore
|
2023-05-11 10:29:19 +00:00
|
|
|
overview: allAccountsCheckbox.checked ? d.dummyAllAccountsOverview : d.dummyOverview
|
2024-10-24 08:41:28 +00:00
|
|
|
walletStore: walletStore
|
2023-05-11 10:29:19 +00:00
|
|
|
width: parent.width
|
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 200
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
|
2023-05-11 10:29:19 +00:00
|
|
|
Column {
|
|
|
|
spacing: 20
|
2023-05-22 15:55:47 +00:00
|
|
|
CheckBox {
|
|
|
|
id: allAccountsCheckbox
|
|
|
|
text: "All Accounts"
|
|
|
|
checked: false
|
2023-05-11 10:29:19 +00:00
|
|
|
}
|
|
|
|
Row {
|
|
|
|
spacing: 10
|
|
|
|
id: row
|
|
|
|
Repeater {
|
|
|
|
id: repeater
|
2023-05-22 15:55:47 +00:00
|
|
|
model: Theme.palette.customisationColorsArray
|
2023-05-11 10:29:19 +00:00
|
|
|
delegate: StatusColorRadioButton {
|
2023-06-18 12:47:24 +00:00
|
|
|
radioButtonColor: modelData
|
2023-05-11 10:29:19 +00:00
|
|
|
checked: index === 0
|
2023-06-18 12:47:24 +00:00
|
|
|
onToggled: d.updateDummyView(modelData)
|
2023-05-11 10:29:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-04-26 15:53:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Wallet
|