2022-03-23 11:08:49 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
2022-03-18 14:47:51 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-03-23 11:08:49 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2023-04-04 11:31:04 +00:00
|
|
|
import shared.controls 1.0
|
2022-03-23 11:08:49 +00:00
|
|
|
|
2023-03-15 09:17:25 +00:00
|
|
|
import "../controls"
|
2023-04-26 15:53:49 +00:00
|
|
|
import "../popups"
|
2022-03-23 11:08:49 +00:00
|
|
|
|
|
|
|
Rectangle {
|
2023-04-26 15:53:49 +00:00
|
|
|
id: root
|
2022-03-23 11:08:49 +00:00
|
|
|
|
2022-07-20 11:15:05 +00:00
|
|
|
property var walletStore
|
2023-03-15 09:17:25 +00:00
|
|
|
property var networkConnectionStore
|
2022-03-23 11:08:49 +00:00
|
|
|
|
2023-09-20 13:01:37 +00:00
|
|
|
// Community-token related properties:
|
|
|
|
required property bool isCommunityOwnershipTransfer
|
|
|
|
property string communityName: ""
|
|
|
|
|
2023-04-26 15:53:49 +00:00
|
|
|
signal launchShareAddressModal()
|
2023-08-31 10:27:15 +00:00
|
|
|
signal launchSendModal()
|
|
|
|
signal launchBridgeModal()
|
2023-04-26 15:53:49 +00:00
|
|
|
|
2022-03-23 11:08:49 +00:00
|
|
|
color: Theme.palette.statusAppLayout.rightPanelBackgroundColor
|
|
|
|
|
2024-04-09 14:16:03 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
readonly property bool isCollectibleViewed: !!walletStore.currentViewedCollectible
|
|
|
|
readonly property bool isCollectibleSoulbound: d.isCollectibleViewed && walletStore.currentViewedCollectible.soulbound
|
|
|
|
}
|
|
|
|
|
2022-03-23 11:08:49 +00:00
|
|
|
StatusModalDivider {
|
|
|
|
anchors.top: parent.top
|
|
|
|
width: parent.width
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.centerIn: parent
|
2022-03-28 08:19:57 +00:00
|
|
|
height: parent.height
|
2022-03-23 11:08:49 +00:00
|
|
|
spacing: Style.current.padding
|
|
|
|
|
2024-03-12 15:44:27 +00:00
|
|
|
StatusFlatButton {
|
|
|
|
objectName: "walletFooterSendButton"
|
|
|
|
icon.name: "send"
|
2023-09-20 13:01:37 +00:00
|
|
|
text: root.isCommunityOwnershipTransfer ? qsTr("Send Owner token to transfer %1 Community ownership").arg(root.communityName) : qsTr("Send")
|
2024-04-09 14:16:03 +00:00
|
|
|
interactive: !d.isCollectibleSoulbound && networkConnectionStore.sendBuyBridgeEnabled
|
2023-08-31 10:27:15 +00:00
|
|
|
onClicked: root.launchSendModal()
|
2024-04-09 14:16:03 +00:00
|
|
|
tooltip.text: d.isCollectibleSoulbound ? qsTr("Soulbound collectibles cannot be sent to another wallet") : networkConnectionStore.sendBuyBridgeToolTipText
|
2023-10-30 09:50:27 +00:00
|
|
|
visible: !walletStore.overview.isWatchOnlyAccount && walletStore.overview.canSend
|
2022-03-23 11:08:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusFlatButton {
|
|
|
|
icon.name: "receive"
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Receive")
|
2022-03-23 11:08:49 +00:00
|
|
|
onClicked: function () {
|
2023-04-26 15:53:49 +00:00
|
|
|
launchShareAddressModal()
|
2022-03-23 11:08:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-12 15:44:27 +00:00
|
|
|
StatusFlatButton {
|
|
|
|
icon.name: "bridge"
|
2023-04-04 11:31:04 +00:00
|
|
|
text: qsTr("Bridge")
|
|
|
|
interactive: networkConnectionStore.sendBuyBridgeEnabled
|
2023-08-31 10:27:15 +00:00
|
|
|
onClicked: root.launchBridgeModal()
|
2024-03-12 15:44:27 +00:00
|
|
|
tooltip.text: networkConnectionStore.sendBuyBridgeToolTipText
|
2023-10-30 09:50:27 +00:00
|
|
|
visible: !walletStore.overview.isWatchOnlyAccount && !root.isCommunityOwnershipTransfer && walletStore.overview.canSend
|
2022-11-23 17:58:22 +00:00
|
|
|
}
|
2024-02-02 09:55:56 +00:00
|
|
|
|
2022-12-13 13:42:52 +00:00
|
|
|
StatusFlatButton {
|
|
|
|
id: buySellBtn
|
2023-09-20 13:01:37 +00:00
|
|
|
|
|
|
|
visible: !root.isCommunityOwnershipTransfer
|
2022-12-13 13:42:52 +00:00
|
|
|
icon.name: "token"
|
|
|
|
text: qsTr("Buy")
|
|
|
|
onClicked: function () {
|
|
|
|
Global.openPopup(buySellModal);
|
|
|
|
}
|
2024-05-07 14:18:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusFlatButton {
|
|
|
|
id: swap
|
|
|
|
|
|
|
|
visible: !d.isCollectibleSoulbound && networkConnectionStore.sendBuyBridgeEnabled && Global.featureFlags.swapEnabled
|
|
|
|
icon.name: "swap"
|
|
|
|
text: qsTr("Swap")
|
|
|
|
onClicked: function () {
|
|
|
|
console.warn("TODO: launch swap modal...")
|
|
|
|
}
|
2022-12-13 13:42:52 +00:00
|
|
|
}
|
2022-03-23 11:08:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: buySellModal
|
|
|
|
CryptoServicesModal {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|