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 ( )
2024-05-13 17:23:01 +00:00
signal launchSwapModal ( )
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
2024-05-13 17:23:01 +00:00
readonly property bool isCollectibleViewed: ! ! walletStore . currentViewedHoldingID &&
( walletStore . currentViewedHoldingType === Constants . TokenType . ERC721 ||
walletStore . currentViewedHoldingType === Constants . TokenType . ERC1155 )
readonly property bool isCollectibleSoulbound: isCollectibleViewed && ! ! walletStore . currentViewedCollectible && walletStore . currentViewedCollectible . soulbound
2024-04-09 14:16:03 +00:00
}
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
2024-05-13 17:23:01 +00:00
visible: ! walletStore . overview . isWatchOnlyAccount && walletStore . overview . canSend && ! root . walletStore . showAllAccounts
2022-03-23 11:08:49 +00:00
}
StatusFlatButton {
icon.name: "receive"
2022-04-04 11:26:30 +00:00
text: qsTr ( "Receive" )
2024-05-13 17:23:01 +00:00
visible: ! root . walletStore . showAllAccounts
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" )
2024-05-13 17:23:01 +00:00
interactive: ! d . isCollectibleSoulbound && networkConnectionStore . sendBuyBridgeEnabled
2023-08-31 10:27:15 +00:00
onClicked: root . launchBridgeModal ( )
2024-05-13 17:23:01 +00:00
tooltip.text: d . isCollectibleSoulbound ? qsTr ( "Soulbound collectibles cannot be bridged to another wallet" ) : networkConnectionStore . sendBuyBridgeToolTipText
visible: ! walletStore . overview . isWatchOnlyAccount && ! root . isCommunityOwnershipTransfer && walletStore . overview . canSend && ! root . walletStore . showAllAccounts
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
2024-05-13 17:23:01 +00:00
visible: ! root . isCommunityOwnershipTransfer && ! root . walletStore . showAllAccounts
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
2024-05-13 17:23:01 +00:00
interactive: ! d . isCollectibleSoulbound && networkConnectionStore . sendBuyBridgeEnabled
visible: Global . featureFlags . swapEnabled && ! walletStore . overview . isWatchOnlyAccount
tooltip.text: d . isCollectibleSoulbound ? qsTr ( "Soulbound collectibles cannot be swapped" ) : networkConnectionStore . sendBuyBridgeToolTipText
2024-05-07 14:18:08 +00:00
icon.name: "swap"
text: qsTr ( "Swap" )
2024-05-13 17:23:01 +00:00
onClicked: root . launchSwapModal ( )
2022-12-13 13:42:52 +00:00
}
2022-03-23 11:08:49 +00:00
}
Component {
id: buySellModal
CryptoServicesModal { }
}
}