feat(@desktop/wallet): Added menu items to check address activity

on arbiscan and optmism explorer.
Fix menu position to align right of the 'more' button

Fixes: #9771
This commit is contained in:
Ivan Belyakov 2023-03-13 14:51:57 +03:00 committed by IvanBelyakoff
parent ab1393b7f0
commit fc18b72848
1 changed files with 38 additions and 8 deletions

View File

@ -79,8 +79,17 @@ StatusListItem {
radius: 8
icon.name: "more"
onClicked: {
editDeleteMenu.openMenu(root.name, root.address, root.favourite, root.chainShortNames, root.ens);
editDeleteMenu.openMenu(this, x - editDeleteMenu.width - statusListItemComponentsSlot.spacing, y + height + Style.current.halfPadding,
{
name: root.name,
address: root.address,
favourite: root.favourite,
chainShortNames: root.chainShortNames,
ens: root.ens,
}
);
}
},
StatusRoundButton {
visible: !root.name
@ -105,13 +114,18 @@ StatusListItem {
property bool storeFavourite
property string contactChainShortNames
property string contactEns
function openMenu(name, address, favourite, chainShortNames, ens) {
contactName = name;
contactAddress = address;
storeFavourite = favourite;
contactChainShortNames = chainShortNames;
contactEns = ens;
popup();
readonly property int maxHeight: 341
height: implicitHeight > maxHeight ? maxHeight : implicitHeight
contentWidth: 216
function openMenu(parent, x, y, model) {
contactName = model.name;
contactAddress = model.address;
storeFavourite = model.favourite;
contactChainShortNames = model.chainShortNames;
contactEns = model.ens;
popup(parent, x, y);
}
onClosed: {
contactName = "";
@ -156,6 +170,22 @@ StatusListItem {
Global.openLink("https://etherscan.io/address/%1".arg(d.visibleAddress ? d.visibleAddress : root.ens))
}
}
StatusAction {
text: qsTr("View on Arbiscan")
objectName: "viewOnArbiscanAction"
assetSettings.name: "external"
onTriggered: {
Global.openLink("https://arbiscan.io/address/%1".arg(d.visibleAddress ? d.visibleAddress : root.ens))
}
}
StatusAction {
text: qsTr("View on Optimism Explorer")
objectName: "viewOnOptimismExplorerAction"
assetSettings.name: "external"
onTriggered: {
Global.openLink("https://optimistic.etherscan.io/address/%1".arg(d.visibleAddress ? d.visibleAddress : root.ens))
}
}
StatusMenuSeparator { }
StatusAction {
text: qsTr("Delete")