2023-09-14 10:02:51 +00:00
import QtQuick 2.15
import QtQuick . Controls 2.15
import QtQuick . Layouts 1.15
import QtQml . Models 2.15
import QtGraphicalEffects 1.0
2021-07-16 13:07:38 +00:00
import StatusQ . Core 0.1
import StatusQ . Core . Theme 0.1
import StatusQ . Controls 0.1
import StatusQ . Popups 0.1
2022-12-14 15:40:00 +00:00
import StatusQ . Popups . Dialog 0.1
2023-09-14 10:02:51 +00:00
import StatusQ . Core . Utils 0.1
import StatusQ . Components 0.1
import shared . popups 1.0
2024-02-06 16:19:23 +00:00
import AppLayouts . Wallet . stores 1.0 as WalletStores
2021-07-16 13:07:38 +00:00
2022-09-20 12:05:10 +00:00
import utils 1.0
2021-02-12 15:26:57 +00:00
2022-12-14 15:40:00 +00:00
StatusDialog {
2022-06-29 16:56:55 +00:00
id: root
2021-02-12 15:26:57 +00:00
2023-09-14 10:02:51 +00:00
// Community related props:
2023-11-24 08:48:50 +00:00
property string communityId
2023-09-14 10:02:51 +00:00
property string communityName
property string communityLogo
2021-07-16 13:07:38 +00:00
2023-09-14 10:02:51 +00:00
// Transaction related props:
2023-09-20 13:01:37 +00:00
property var token // Expected roles: accountAddress, key, chainId, name, artworkSource
2023-09-14 10:02:51 +00:00
property var accounts
property var sendModalPopup
2022-12-14 15:40:00 +00:00
2023-09-14 10:02:51 +00:00
signal cancelClicked
2021-02-12 15:26:57 +00:00
2023-09-14 10:02:51 +00:00
width: 640 // by design
padding: Style . current . padding
contentItem: ColumnLayout {
spacing: Style . current . bigPadding
2021-02-12 18:19:31 +00:00
2023-09-14 10:02:51 +00:00
component CustomText : StatusBaseText {
Layout.fillWidth: true
2022-06-29 16:56:55 +00:00
2023-09-14 10:02:51 +00:00
wrapMode: Text . WrapAtWordBoundaryOrAnywhere
font.pixelSize: Style . current . primaryTextFontSize
color: Theme . palette . directColor1
}
2022-06-29 16:56:55 +00:00
2023-09-14 10:02:51 +00:00
CustomText {
Layout.topMargin: Style . current . halfPadding
2022-06-29 16:56:55 +00:00
2023-09-14 10:02:51 +00:00
text: qsTr ( "Are you sure you want to transfer ownership of %1? All ownership rights you currently hold for %1 will be transferred to the new owner." ) . arg ( root . communityName )
}
2022-06-29 16:56:55 +00:00
2023-09-14 10:02:51 +00:00
CustomText {
text: qsTr ( "To transfer ownership of %1:" ) . arg ( root . communityName )
font.bold: true
}
2022-06-29 16:56:55 +00:00
2023-09-14 10:02:51 +00:00
CustomText {
text: qsTr ( "1. Send the %1 Owner token (%2) to the new owner’ s address" ) . arg ( root . communityName ) . arg ( token . name )
2022-06-29 16:56:55 +00:00
}
2021-02-12 15:26:57 +00:00
2023-09-14 10:02:51 +00:00
CustomText {
text: qsTr ( "2. Ask the new owner to setup the control node for %1 on their desktop device" ) . arg ( root . communityName )
}
StatusMenuSeparator {
2022-06-29 16:56:55 +00:00
Layout.fillWidth: true
2023-09-14 10:02:51 +00:00
}
2021-11-11 10:45:59 +00:00
2023-09-14 10:02:51 +00:00
CustomText {
text: qsTr ( "I acknowledge that..." )
2022-06-29 16:56:55 +00:00
}
2021-02-12 15:26:57 +00:00
2023-09-14 10:02:51 +00:00
StatusCheckBox {
id: ackCheckBox
Layout.topMargin: - Style . current . halfPadding
Layout.bottomMargin: Style . current . halfPadding
2022-06-29 16:56:55 +00:00
2023-09-14 10:02:51 +00:00
font.pixelSize: Style . current . primaryTextFontSize
text: qsTr ( "My ownership rights will be removed and transferred to the recipient" )
}
}
header: StatusDialogHeader {
headline.title: qsTr ( "Transfer ownership of %1" ) . arg ( root . communityName )
actions.closeButton.onClicked: root . close ( )
leftComponent: StatusSmartIdenticon {
asset.name: root . communityLogo
asset.isImage: ! ! asset . name
2021-02-12 15:26:57 +00:00
}
}
2022-12-14 15:40:00 +00:00
footer: StatusDialogFooter {
2023-09-14 10:02:51 +00:00
spacing: Style . current . padding
rightButtons: ObjectModel {
StatusFlatButton {
text: qsTr ( "Cancel" )
2022-12-14 15:40:00 +00:00
onClicked: {
2023-09-14 10:02:51 +00:00
root . cancelClicked ( )
close ( )
}
}
StatusButton {
enabled: ackCheckBox . checked
text: qsTr ( "Send %1 owner token" ) . arg ( root . communityName )
type: StatusBaseButton . Type . Danger
onClicked: {
// Pre-populated dialog with the relevant Owner token info:
2023-11-24 08:48:50 +00:00
root . sendModalPopup . preSelectedSendType = Constants . SendType . ERC721Transfer
2023-09-20 13:01:37 +00:00
root . sendModalPopup . preSelectedAccount = ModelUtils . getByKey ( root . accounts , "address" , token . accountAddress )
2024-02-06 16:19:23 +00:00
const store = WalletStores . RootStore . currentActivityFiltersStore
const uid = store . collectiblesList . getUidForData ( token . key , token . tokenAddress , token . chainId ) ;
2023-11-24 08:48:50 +00:00
root . sendModalPopup . preSelectedHoldingID = uid
2023-11-07 22:45:47 +00:00
root . sendModalPopup . preSelectedHoldingType = Constants . TokenType . ERC721
2023-09-14 10:02:51 +00:00
root . sendModalPopup . open ( )
close ( )
2022-12-14 15:40:00 +00:00
}
2021-07-16 13:07:38 +00:00
}
2021-02-12 15:26:57 +00:00
}
2022-12-14 15:40:00 +00:00
}
2021-02-12 15:26:57 +00:00
}