2023-03-06 12:18:25 +00:00
import QtQuick 2.14
import QtQuick . Controls 2.14
import QtQuick . Layouts 1.14
import AppLayouts . Chat . views . communities 1.0
2023-06-01 10:38:56 +00:00
import AppLayouts . Chat . helpers 1.0
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
import StatusQ . Core 0.1
2023-03-06 12:18:25 +00:00
import Storybook 1.0
import Models 1.0
2023-05-17 10:00:52 +00:00
import utils 1.0
2023-03-06 12:18:25 +00:00
SplitView {
Logs { id: logs }
SplitView {
orientation: Qt . Vertical
SplitView.fillWidth: true
Item {
SplitView.fillWidth: true
SplitView.fillHeight: true
2023-06-01 10:38:56 +00:00
CollectibleObject {
id: collectibleObj
2023-03-06 12:18:25 +00:00
artworkSource: ModelsData . icons . superRare
2023-05-16 14:50:43 +00:00
remotelyDestructState: remotelyDestructStateBox . checked ? 1 /*In progress*/ : 2 /*Completed*/
burnState: burnDestructStateBox . checked ? 1 /*In progress*/ : 2 /*Completed*/
2023-03-06 12:18:25 +00:00
name: nameText . text
symbol: symbolText . text
description: descriptionText . text
2023-06-01 10:38:56 +00:00
supply: parseInt ( supplyText . text )
2023-03-06 12:18:25 +00:00
infiniteSupply: unlimitedSupplyChecker . checked
2023-05-16 14:50:43 +00:00
remainingTokens: parseInt ( remainingText . text )
2023-03-06 12:18:25 +00:00
transferable: transferibleChecker . checked
2023-06-01 10:38:56 +00:00
remotelyDestruct: selfdestructChecker . checked
2023-03-06 12:18:25 +00:00
chainId: 1
chainName: "Ethereum Mainnet"
chainIcon: ModelsData . networks . ethereum
2023-03-17 15:09:27 +00:00
accountName: "helloworld"
2023-06-01 10:38:56 +00:00
}
2023-03-06 12:18:25 +00:00
2023-06-01 10:38:56 +00:00
AssetObject {
id: assetObj
2023-06-01 21:23:43 +00:00
2023-06-01 10:38:56 +00:00
artworkSource: ModelsData . icons . superRare
burnState: burnDestructStateBox . checked ? 1 /*In progress*/ : 2 /*Completed*/
name: nameText . text
symbol: symbolText . text
description: descriptionText . text
supply: parseInt ( supplyText . text )
infiniteSupply: unlimitedSupplyChecker . checked
decimals: parseInt ( decimalText . text )
remainingTokens: parseInt ( remainingText . text )
chainId: 1
chainName: "Ethereum Mainnet"
chainIcon: ModelsData . networks . ethereum
accountName: "helloworld"
2023-03-06 12:18:25 +00:00
}
2023-06-01 10:38:56 +00:00
CommunityTokenView {
id: view
anchors.fill: parent
anchors.margins: 50
preview: previewBox . checked
isAssetView: isAssetBox . checked
collectible: collectibleObj
asset: assetObj
tokenOwnersModel: TokenHoldersModel { }
onMintClicked: logs . logEvent ( "CommunityTokenView::onMintClicked" )
2023-03-06 12:18:25 +00:00
}
2023-06-01 10:38:56 +00:00
}
2023-03-06 12:18:25 +00:00
LogsAndControlsPanel {
id: logsAndControlsPanel
SplitView.minimumHeight: 100
SplitView.preferredHeight: 150
logsView.logText: logs . logText
}
}
Pane {
SplitView.minimumWidth: 300
SplitView.preferredWidth: 300
2023-05-25 10:31:32 +00:00
StatusScrollView {
width: parent . width
height: parent . height
contentHeight: _column . implicitHeight
contentWidth: _column . implicitWidth
2023-03-06 12:18:25 +00:00
2023-05-17 10:00:52 +00:00
ColumnLayout {
2023-05-25 10:31:32 +00:00
id: _column
CheckBox {
id: previewBox
text: "Is preview view?"
checked: true
2023-05-17 10:00:52 +00:00
}
2023-05-25 10:31:32 +00:00
CheckBox {
id: isAssetBox
text: "Is Assets View?"
checked: false
2023-05-17 10:00:52 +00:00
}
2023-05-25 10:31:32 +00:00
ColumnLayout {
Label {
text: "Minting state:"
}
RadioButton {
id: mintingInProgress
text: "In progress"
2023-06-01 10:38:56 +00:00
onCheckedChanged: {
if ( view . isAssetView ) assetObj . deployState = Constants . ContractTransactionStatus . InProgress
else collectibleObj . deployState = Constants . ContractTransactionStatus . InProgress
}
2023-05-25 10:31:32 +00:00
}
RadioButton {
id: mintingFailed
text: "Failed"
2023-06-01 10:38:56 +00:00
onCheckedChanged: {
if ( view . isAssetView ) assetObj . deployState = Constants . ContractTransactionStatus . Failed
else collectibleObj . deployState = Constants . ContractTransactionStatus . Failed
}
2023-05-25 10:31:32 +00:00
}
RadioButton {
id: mintingCompleted
text: "Completed"
checked: true
2023-06-01 10:38:56 +00:00
onCheckedChanged: {
if ( view . isAssetView ) assetObj . deployState = Constants . ContractTransactionStatus . Completed
else collectibleObj . deployState = Constants . ContractTransactionStatus . Completed
}
2023-05-25 10:31:32 +00:00
}
2023-05-17 10:00:52 +00:00
}
2023-05-25 10:31:32 +00:00
CheckBox {
id: remotelyDestructStateBox
visible: ! isAssetBox . checked
text: "Remotely destruct in progress"
checked: false
2023-05-17 10:00:52 +00:00
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
CheckBox {
id: burnDestructStateBox
text: "Burn in progress"
checked: false
}
2023-05-16 14:50:43 +00:00
2023-05-25 10:31:32 +00:00
Label {
Layout.topMargin: 10
Layout.fillWidth: true
text: "Artwork"
}
2023-05-16 14:50:43 +00:00
2023-05-25 10:31:32 +00:00
RadioButton {
text: "Small"
checked: true
2023-06-01 10:38:56 +00:00
onCheckedChanged: {
if ( view . isAssetView ) assetObj . artworkSource = ModelsData . icons . superRare
else collectibleObj . artworkSource = ModelsData . icons . superRare
}
2023-05-25 10:31:32 +00:00
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
RadioButton {
text: "Medium"
2023-06-01 10:38:56 +00:00
onCheckedChanged: {
if ( view . isAssetView ) assetObj . artworkSource = ModelsData . collectibles . kitty2Big
else collectibleObj . artworkSource = ModelsData . collectibles . kitty2Big
}
2023-05-25 10:31:32 +00:00
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
RadioButton {
text: "Large"
2023-06-01 10:38:56 +00:00
onCheckedChanged: {
if ( view . isAssetView ) assetObj . artworkSource = ModelsData . banners . superRare
else collectibleObj . artworkSource = ModelsData . banners . superRare
}
2023-05-25 10:31:32 +00:00
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
Label {
Layout.topMargin: 10
Layout.fillWidth: true
text: "Name"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
TextField {
id: nameText
background: Rectangle { border.color: 'lightgrey' }
Layout.preferredWidth: 200
text: "Art work"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
Label {
Layout.topMargin: 10
Layout.fillWidth: true
text: "Description"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
TextField {
id: descriptionText
background: Rectangle { border.color: 'lightgrey' }
Layout.preferredWidth: 200
text: "Long art work description Long art work description Long art work description Long art work description Long art work description Long art work description Long art work description Long art work description Long art work description"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
Label {
Layout.topMargin: 10
Layout.fillWidth: true
text: "Symbol"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
TextField {
id: symbolText
background: Rectangle { border.color: 'lightgrey' }
Layout.preferredWidth: 200
text: "ABC"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
CheckBox {
id: unlimitedSupplyChecker
Layout.topMargin: 10
text: "Unlimited supply"
checked: true
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
Label {
visible: ! unlimitedSupplyChecker . checked
Layout.fillWidth: true
text: "Supply"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
TextField {
id: supplyText
visible: ! unlimitedSupplyChecker . checked
background: Rectangle { border.color: 'lightgrey' }
Layout.preferredWidth: 200
text: "123"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
TextField {
id: remainingText
visible: ! unlimitedSupplyChecker . checked
background: Rectangle { border.color: 'lightgrey' }
Layout.preferredWidth: 200
text: "123"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
Label {
Layout.topMargin: 10
Layout.fillWidth: true
visible: isAssetBox . checked
text: "Decimal"
}
2023-05-16 14:50:43 +00:00
2023-05-25 10:31:32 +00:00
TextField {
id: decimalText
Layout.preferredWidth: 200
background: Rectangle { border.color: 'lightgrey' }
visible: isAssetBox . checked
text: "2"
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
CheckBox {
id: transferibleChecker
Layout.topMargin: 10
visible: ! isAssetBox . checked
text: "Tranferible"
checked: true
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
CheckBox {
id: selfdestructChecker
visible: ! isAssetBox . checked
text: "Remote self-desctruct"
checked: true
}
2023-03-06 12:18:25 +00:00
2023-05-25 10:31:32 +00:00
Label {
Layout.topMargin: 10
Layout.fillWidth: true
text: "Network"
2023-03-06 12:18:25 +00:00
}
2023-05-25 10:31:32 +00:00
RadioButton {
id: eth
text: "Ethereum Mainnet"
checked: true
onCheckedChanged: {
2023-06-01 10:38:56 +00:00
if ( view . isAssetView ) {
assetObj . chainName = text
assetObj . chainIcon = ModelsData . networks . ethereum
assetObj . chainId = 1
} else {
collectibleObj . chainName = text
collectibleObj . chainIcon = ModelsData . networks . ethereum
collectibleObj . chainId = 1
}
2023-05-25 10:31:32 +00:00
}
2023-03-06 12:18:25 +00:00
}
2023-05-25 10:31:32 +00:00
RadioButton {
id: opt
text: "Optimism"
onCheckedChanged: {
2023-06-01 10:38:56 +00:00
if ( view . isAssetView ) {
assetObj . chainName = text
assetObj . chainIcon = ModelsData . networks . optimism
assetObj . chainId = 2
} else {
collectibleObj . chainName = text
collectibleObj . chainIcon = ModelsData . networks . optimism
collectibleObj . chainId = 2
}
2023-05-25 10:31:32 +00:00
}
}
RadioButton {
id: arb
text: "Arbitrum"
onCheckedChanged: {
2023-06-01 10:38:56 +00:00
if ( view . isAssetView ) {
assetObj . chainName = text
assetObj . chainIcon = ModelsData . networks . arbitrum
assetObj . chainId = 3
} else {
collectibleObj . chainName = text
collectibleObj . chainIcon = ModelsData . networks . arbitrum
collectibleObj . chainId = 3
}
2023-05-25 10:31:32 +00:00
}
2023-03-06 12:18:25 +00:00
}
}
}
}
}