2023-05-10 11:54:06 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import Storybook 1.0
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import shared.controls 1.0
|
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
import Models 1.0
|
|
|
|
|
2023-05-10 11:54:06 +00:00
|
|
|
SplitView {
|
|
|
|
id: root
|
|
|
|
|
2024-02-08 12:49:12 +00:00
|
|
|
// mirrors ActivityEntry defined in src/app/modules/main/wallet_section/activity/entry.nim
|
2023-05-10 11:54:06 +00:00
|
|
|
readonly property QtObject mockupModelData: QtObject {
|
2023-10-05 15:37:47 +00:00
|
|
|
readonly property int timestamp: Date.now() / 1000
|
|
|
|
readonly property int status: ctrlStatus.currentValue
|
|
|
|
readonly property double amount: 123.45
|
|
|
|
readonly property double inAmount: amount
|
|
|
|
readonly property double outAmount: amount
|
|
|
|
readonly property string symbol: "SNT"
|
|
|
|
readonly property string inSymbol: symbol
|
|
|
|
readonly property string outSymbol: symbol
|
|
|
|
readonly property bool isMultiTransaction: ctrlMultiTrans.checked
|
|
|
|
|
|
|
|
readonly property int txType: ctrlType.currentValue
|
|
|
|
readonly property string sender: "0xfB8131c260749c7835a08ccBdb64728De432858E"
|
|
|
|
readonly property string recipient: "0x3fb81384583b3910BB14Cc72582E8e8a56E83ae9"
|
|
|
|
readonly property bool isNFT: ctrlIsNft.checked
|
2024-01-18 18:19:07 +00:00
|
|
|
readonly property bool isCommunityAssetViaAirdrop: isCommunityAssetViaAirdrop.checked
|
|
|
|
readonly property string communityName: "Doodles"
|
|
|
|
readonly property string communityImageUrl: Style.png("collectibles/HappyMeow")
|
2023-10-05 15:37:47 +00:00
|
|
|
readonly property string tokenID: "4981676894159712808201908443964193325271219637660871887967796332739046670337"
|
|
|
|
readonly property string tokenAddress: "0xdeadbeef"
|
|
|
|
readonly property string tokenInAddress: "0xdeadbeef-00"
|
|
|
|
readonly property string tokenOutAddress: "0xdeadbeef-00"
|
|
|
|
readonly property string nftName: "Happy Meow NFT"
|
|
|
|
readonly property string nftImageUrl: Style.png("collectibles/HappyMeow")
|
|
|
|
readonly property string chainId: "NETWORKID"
|
|
|
|
readonly property string chainIdIn: "NETWORKID-IN"
|
|
|
|
readonly property string chainIdOut: "NETWORKID-OUT"
|
2024-02-08 12:49:12 +00:00
|
|
|
|
|
|
|
readonly property bool highlight: _highlight
|
|
|
|
function doneHighlighting() {
|
|
|
|
_highlight = false
|
|
|
|
}
|
|
|
|
property bool _highlight: false
|
2023-06-18 12:47:24 +00:00
|
|
|
}
|
|
|
|
|
2023-05-10 11:54:06 +00:00
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
Item {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.fill: column
|
|
|
|
anchors.margins: -1
|
|
|
|
border.color: "lightgray"
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: column
|
|
|
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
|
|
|
width: 600
|
|
|
|
|
|
|
|
TransactionDelegate {
|
|
|
|
id: delegate
|
|
|
|
Layout.fillWidth: true
|
|
|
|
modelData: root.mockupModelData
|
2023-10-05 15:37:47 +00:00
|
|
|
rootStore: QtObject {
|
|
|
|
readonly property string currentCurrency: "EUR"
|
|
|
|
|
2024-02-05 16:44:49 +00:00
|
|
|
function getFiatValue(cryptoValue, symbol) {
|
2023-10-05 15:37:47 +00:00
|
|
|
return cryptoValue * 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
function formatCurrencyAmount(cryptoValue, symbol) {
|
|
|
|
return "%L1 %2".arg(cryptoValue).arg(symbol)
|
|
|
|
}
|
|
|
|
|
2024-03-13 17:38:16 +00:00
|
|
|
property var flatNetworks: NetworksModel.flatNetworks
|
2023-10-05 15:37:47 +00:00
|
|
|
}
|
|
|
|
walletRootStore: QtObject {
|
|
|
|
function getNameForAddress(address) {
|
|
|
|
return "NAMEFOR: %1".arg(address)
|
|
|
|
}
|
|
|
|
}
|
2023-05-10 11:54:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 200
|
|
|
|
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
SplitView.minimumWidth: 300
|
|
|
|
SplitView.preferredWidth: 300
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
CheckBox {
|
|
|
|
text: "Is loading"
|
|
|
|
checked: delegate.loading
|
|
|
|
onToggled: delegate.loading = checked
|
|
|
|
}
|
|
|
|
CheckBox {
|
|
|
|
text: "Is activity details header"
|
|
|
|
readonly property string headerState: "header"
|
|
|
|
checked: delegate.state === headerState
|
|
|
|
onToggled: delegate.state = checked ? headerState : ""
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
2023-10-05 15:37:47 +00:00
|
|
|
id: ctrlIsNft
|
2023-05-10 11:54:06 +00:00
|
|
|
text: "Is NFT"
|
|
|
|
}
|
|
|
|
|
2024-01-18 18:19:07 +00:00
|
|
|
CheckBox {
|
|
|
|
id: isCommunityAssetViaAirdrop
|
|
|
|
checked: true
|
|
|
|
text: "Is Community Asset Via Airdrop"
|
|
|
|
}
|
|
|
|
|
2023-05-10 11:54:06 +00:00
|
|
|
Label {
|
|
|
|
Layout.topMargin: 10
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Transaction type:"
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
2023-06-18 12:47:24 +00:00
|
|
|
id: ctrlType
|
2023-05-10 11:54:06 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
textRole: "name"
|
|
|
|
valueRole: "type"
|
|
|
|
model: ListModel {
|
2023-10-05 15:37:47 +00:00
|
|
|
ListElement { name: "Send"; type: Constants.TransactionType.Send }
|
2023-06-12 13:04:39 +00:00
|
|
|
ListElement { name: "Receive"; type: Constants.TransactionType.Receive }
|
|
|
|
ListElement { name: "Buy"; type: Constants.TransactionType.Buy }
|
|
|
|
ListElement { name: "Swap"; type: Constants.TransactionType.Swap }
|
|
|
|
ListElement { name: "Bridge"; type: Constants.TransactionType.Bridge }
|
2023-10-05 15:37:47 +00:00
|
|
|
ListElement { name: "ContractDeployment"; type: Constants.TransactionType.ContractDeployment }
|
|
|
|
ListElement { name: "Mint"; type: Constants.TransactionType.Mint }
|
2024-07-17 08:16:02 +00:00
|
|
|
ListElement { name: "Approve"; type: Constants.TransactionType.Approve }
|
2023-10-05 15:37:47 +00:00
|
|
|
ListElement { name: "Sell"; type: Constants.TransactionType.Sell }
|
|
|
|
ListElement { name: "Destroy"; type: Constants.TransactionType.Destroy }
|
2023-05-10 11:54:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.topMargin: 10
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Transaction status:"
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
2023-06-18 12:47:24 +00:00
|
|
|
id: ctrlStatus
|
2023-05-10 11:54:06 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
textRole: "name"
|
2023-06-18 12:47:24 +00:00
|
|
|
valueRole: "status"
|
2023-05-10 11:54:06 +00:00
|
|
|
model: ListModel {
|
2023-06-12 13:04:39 +00:00
|
|
|
ListElement { name: "Failed"; status: Constants.TransactionStatus.Failed }
|
2023-06-18 12:47:24 +00:00
|
|
|
ListElement { name: "Pending"; status: Constants.TransactionStatus.Pending }
|
2023-06-12 13:04:39 +00:00
|
|
|
ListElement { name: "Complete"; status: Constants.TransactionStatus.Complete }
|
2023-10-05 15:37:47 +00:00
|
|
|
ListElement { name: "Finalised"; status: Constants.TransactionStatus.Finalised }
|
2023-05-10 11:54:06 +00:00
|
|
|
}
|
|
|
|
}
|
2023-10-05 15:37:47 +00:00
|
|
|
|
|
|
|
Switch {
|
|
|
|
id: ctrlMultiTrans
|
|
|
|
text: "Multi transaction"
|
|
|
|
}
|
2024-02-08 12:49:12 +00:00
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "New transaction"
|
|
|
|
onClicked: {
|
|
|
|
mockupModelData._highlight = true
|
|
|
|
}
|
|
|
|
}
|
2023-05-10 11:54:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Wallet
|