2023-05-18 16:09:03 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.popups 1.0
|
2023-05-18 16:09:03 +00:00
|
|
|
|
|
|
|
SplitView {
|
|
|
|
Logs { id: logs }
|
|
|
|
|
2023-08-07 13:31:07 +00:00
|
|
|
ListModel {
|
|
|
|
id: accountsModel
|
|
|
|
|
|
|
|
ListElement {
|
|
|
|
name: "Test account"
|
|
|
|
emoji: "😋"
|
|
|
|
address: "0x7F47C2e18a4BBf5487E6fb082eC2D9Ab0E6d7240"
|
|
|
|
color: "red"
|
|
|
|
}
|
|
|
|
|
|
|
|
ListElement {
|
|
|
|
name: "Another account - generated"
|
|
|
|
emoji: "🚗"
|
|
|
|
address: "0x7F47C2e98a4BBf5487E6fb082eC2D9Ab0E6d8888"
|
|
|
|
color: "blue"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-18 16:09:03 +00:00
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
Item {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
|
|
|
|
PopupBackground {
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
text: "Reopen"
|
|
|
|
|
2023-08-30 08:25:32 +00:00
|
|
|
onClicked: burnTokensPopup.open()
|
2023-05-18 16:09:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BurnTokensPopup {
|
2023-08-30 08:25:32 +00:00
|
|
|
id: burnTokensPopup
|
2023-05-18 16:09:03 +00:00
|
|
|
|
|
|
|
anchors.centerIn: parent
|
2023-08-30 08:25:32 +00:00
|
|
|
visible: true
|
|
|
|
modal: false
|
|
|
|
closePolicy: Popup.NoAutoClose
|
|
|
|
|
2023-05-18 16:09:03 +00:00
|
|
|
communityName: editorCommunity.text
|
|
|
|
tokenName: editorToken.text
|
|
|
|
remainingTokens: editorAmount.text
|
2023-08-30 08:25:32 +00:00
|
|
|
multiplierIndex: assetButton.checked ? 18 : 0
|
2023-05-18 16:09:03 +00:00
|
|
|
isAsset: assetButton.checked
|
2023-08-30 08:25:32 +00:00
|
|
|
tokenSource: assetButton.checked
|
|
|
|
? ModelsData.assets.socks
|
|
|
|
: ModelsData.collectibles.kitty1Big
|
2023-08-07 13:31:07 +00:00
|
|
|
accounts: accountsModel
|
|
|
|
chainName: "Optimism"
|
2023-05-18 16:09:03 +00:00
|
|
|
|
|
|
|
onBurnClicked: logs.logEvent("BurnTokensPopup::onBurnClicked --> Burn amount: " + burnAmount)
|
|
|
|
onCancelClicked: logs.logEvent("BurnTokensPopup::onCancelClicked")
|
2023-09-01 09:27:44 +00:00
|
|
|
feeText: "0.0015 ETH ($75.43)"
|
|
|
|
feeErrorText: ""
|
|
|
|
isFeeLoading: false
|
2023-08-30 08:25:32 +00:00
|
|
|
|
2023-09-01 09:27:44 +00:00
|
|
|
onSelectedAccountAddressChanged: {
|
|
|
|
burnTokensPopup.isFeeLoading = true
|
|
|
|
timer.delay(2000, () => burnTokensPopup.isFeeLoading = false)
|
|
|
|
}
|
|
|
|
onAmountToBurnChanged: {
|
|
|
|
burnTokensPopup.isFeeLoading = true
|
|
|
|
timer.delay(2000, () => burnTokensPopup.isFeeLoading = false)
|
2023-08-30 08:25:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Timer {
|
2023-09-01 09:27:44 +00:00
|
|
|
id: timer
|
|
|
|
function delay(ms, callback) {
|
|
|
|
timer.interval = ms
|
|
|
|
timer.repeat = false
|
|
|
|
timer.triggered.connect(callback)
|
|
|
|
timer.start()
|
2023-08-30 08:25:32 +00:00
|
|
|
}
|
2023-05-18 16:09:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
|
|
|
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 150
|
|
|
|
|
|
|
|
logsView.logText: logs.logText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
SplitView.minimumWidth: 300
|
|
|
|
SplitView.preferredWidth: 300
|
|
|
|
|
|
|
|
ColumnLayout {
|
2023-08-30 08:25:32 +00:00
|
|
|
anchors.fill: parent
|
2023-05-18 16:09:03 +00:00
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Community name:"
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: editorCommunity
|
2023-08-30 08:25:32 +00:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2023-05-18 16:09:03 +00:00
|
|
|
text: "Community lovers"
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
|
|
|
text: "Token name:"
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: editorToken
|
2023-08-30 08:25:32 +00:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2023-05-18 16:09:03 +00:00
|
|
|
text: "Anniversary"
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
|
|
|
text: "Amount to burn:"
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
id: editorAmount
|
2023-08-30 08:25:32 +00:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2023-05-18 16:09:03 +00:00
|
|
|
text: "123"
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
|
|
|
text: "Token source:"
|
|
|
|
}
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
id: assetButton
|
|
|
|
|
|
|
|
text: "Asset"
|
|
|
|
checked: true
|
|
|
|
}
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
id: collectibleButton
|
|
|
|
|
|
|
|
text: "Collectible"
|
|
|
|
}
|
2023-08-30 08:25:32 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
2023-05-18 16:09:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-31 12:21:14 +00:00
|
|
|
// category: Popups
|
2023-05-18 16:09:03 +00:00
|
|
|
|
2023-10-03 11:56:30 +00:00
|
|
|
// https://www.figma.com/file/qHfFm7C9LwtXpfdbxssCK3/Kuba%E2%8E%9CDesktop---Communities?type=design&node-id=35082-612599&mode=design&t=XTDQ4GeU1k9LPuVK-0
|