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
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-05-11 10:29:19 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
hasBalanceCache: true,
|
|
|
|
currencyBalance: ({amount: 1.25,
|
|
|
|
symbol: "USD",
|
|
|
|
displayDecimals: 4,
|
|
|
|
stripTrailingZeroes: false}),
|
|
|
|
isAllAccounts: false,
|
|
|
|
hideWatchAccounts: 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,
|
|
|
|
hasBalanceCache: true,
|
|
|
|
currencyBalance: ({amount: 1.25,
|
|
|
|
symbol: "USD",
|
|
|
|
displayDecimals: 4,
|
|
|
|
stripTrailingZeroes: false}),
|
|
|
|
isAllAccounts: true,
|
|
|
|
hideWatchAccounts: 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
|
|
|
|
|
|
|
readonly property QtObject connectionStore: QtObject {
|
|
|
|
property bool accountBalanceNotAvailable: false
|
|
|
|
}
|
|
|
|
|
|
|
|
readonly property QtObject walletStore: QtObject {
|
|
|
|
property var allNetworks: enabledNetworks
|
|
|
|
property var layer1Networks: NetworksModel.layer1Networks
|
|
|
|
property var layer2Networks: NetworksModel.layer2Networks
|
|
|
|
property var testNetworks: NetworksModel.testNetworks
|
|
|
|
property var enabledNetworks: NetworksModel.enabledNetworks
|
|
|
|
function toggleNetwork(chainId) {
|
|
|
|
}
|
|
|
|
|
|
|
|
function getAllNetworksSupportedString(hovered) {
|
|
|
|
return hovered ? "<font color=\"" + "#627EEA" + "\">" + "eth:" + "</font>" +
|
|
|
|
"<font color=\"" + "#E90101" + "\">" + "opt:" + "</font>" +
|
|
|
|
"<font color=\"" + "#27A0EF" + "\">" + "arb:" + "</font>" : "eth:opt:arb:"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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 {
|
|
|
|
networkConnectionStore: d.connectionStore
|
|
|
|
overview: allAccountsCheckbox.checked ? d.dummyAllAccountsOverview : d.dummyOverview
|
|
|
|
walletStore: d.walletStore
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|