From 4d2e396b7fc74f14ecb18b49dfe15364890eb365 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 9 Dec 2020 11:58:42 -0400 Subject: [PATCH] fix: display transaction data --- .../ChatComponents/SignTransactionModal.qml | 1 + ui/shared/TransactionPreview.qml | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml index 6e871fec76..34241d91d4 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatComponents/SignTransactionModal.qml @@ -182,6 +182,7 @@ ModalPopup { amount: { "value": root.selectedAmount, "fiatValue": root.selectedFiatAmount } currency: walletModel.defaultCurrency isFromEditable: false + trxData: root.trxData isGasEditable: true fromValid: balanceValidator.isValid gasValid: gasValidator.isValid diff --git a/ui/shared/TransactionPreview.qml b/ui/shared/TransactionPreview.qml index de2e45944d..847991e1e0 100644 --- a/ui/shared/TransactionPreview.qml +++ b/ui/shared/TransactionPreview.qml @@ -11,6 +11,7 @@ Item { property var toAccount property var asset property var amount + property string trxData: "0x" property string currency: "USD" property var gas height: content.height @@ -460,5 +461,73 @@ Item { } } } + LabelValueRow { + id: itmData + label: qsTr("Data") + visible: trxData !== "0x" && trxData !== "" + value: Item { + id: dataRoot + anchors.fill: parent + anchors.verticalCenter: parent.verticalCenter + Row { + spacing: Style.current.halfPadding + rightPadding: 0 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + StyledText { + font.pixelSize: 15 + height: 22 + width: 200 + text: trxData + elide: Text.ElideRight + color: Style.current.secondaryText + anchors.verticalCenter: parent.verticalCenter + horizontalAlignment: Text.AlignRight + verticalAlignment: Text.AlignVCenter + } + SVGImage { + width: 13 + visible: true + anchors.verticalCenter: parent.verticalCenter + fillMode: Image.PreserveAspectFit + source: "../app/img/caret.svg" + rotation: 270 + ColorOverlay { + anchors.fill: parent + visible: parent.visible + source: parent + color: Style.current.secondaryText + } + } + } + + ModalPopup { + id: dataPopup + title: qsTr("Data field") + height: 286 + width: 400 + Item { + anchors.fill: parent + anchors.leftMargin: 0 + anchors.rightMargin: 0 + ScrollView { + width: parent.width + height: 150 + TextArea { + wrapMode: TextEdit.Wrap + readOnly: true + text: trxData + } + } + } + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: dataPopup.open() + } + } + } } }