2022-12-06 11:19:20 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
|
|
|
|
import AppLayouts.Chat.controls.community 1.0
|
|
|
|
|
|
|
|
Pane {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
function openFlow(flowType) {
|
|
|
|
holdingsDropdown.close()
|
|
|
|
holdingsDropdown.openFlow(flowType)
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Label {
|
|
|
|
text: "Open flow:"
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Add"
|
|
|
|
onClicked: openFlow(HoldingsDropdown.FlowType.Add)
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Update"
|
|
|
|
onClicked: openFlow(HoldingsDropdown.FlowType.Update)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
HoldingsDropdown {
|
|
|
|
id: holdingsDropdown
|
|
|
|
|
|
|
|
parent: root
|
|
|
|
anchors.centerIn: root
|
|
|
|
|
|
|
|
store: QtObject {
|
|
|
|
readonly property ListModel collectiblesModel: ListModel {
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
const collectibles = []
|
|
|
|
|
|
|
|
for (let i = 0; i < 20; i++) {
|
|
|
|
collectibles.push({
|
|
|
|
key: "key " + (i + 1),
|
|
|
|
iconSource: "",
|
|
|
|
name: "Collectible " + (i + 1),
|
|
|
|
category: "Community collectibles, cat "
|
|
|
|
+ (Math.floor(i / 4) + 1)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const subitems = []
|
|
|
|
for (let j = 0; j < 20; j++) {
|
|
|
|
|
|
|
|
subitems.push({
|
|
|
|
key: "subkey " + (j + 1),
|
|
|
|
iconSource: "",
|
|
|
|
name: "Collectible (sub) " + (j + 1)//,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
collectibles[1].subItems = subitems;
|
|
|
|
|
|
|
|
append(collectibles)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-12 13:18:52 +00:00
|
|
|
readonly property ListModel assetsModel: ListModel {
|
2022-12-06 11:19:20 +00:00
|
|
|
ListElement {
|
2023-01-12 13:18:52 +00:00
|
|
|
key: "socks"; iconSource: ""; name: "Unisocks"; shortName: "SOCKS"; category: "Community assets"
|
2022-12-06 11:19:20 +00:00
|
|
|
}
|
|
|
|
ListElement {
|
2023-01-12 13:18:52 +00:00
|
|
|
key: "zrx"; iconSource: ""; name: "Ox"; shortName: "ZRX"; category: "Listed assets"
|
2022-12-06 11:19:20 +00:00
|
|
|
}
|
|
|
|
ListElement {
|
2023-01-12 13:18:52 +00:00
|
|
|
key: "1inch"; iconSource: ""; name: "1inch"; shortName: "ZRX"; category: "Listed assets"
|
2022-12-06 11:19:20 +00:00
|
|
|
}
|
|
|
|
ListElement {
|
2023-01-12 13:18:52 +00:00
|
|
|
key: "Aave"; iconSource: ""; name: "Aave"; shortName: "AAVE"; category: "Listed assets"}
|
2022-12-06 11:19:20 +00:00
|
|
|
|
|
|
|
ListElement {
|
2023-01-12 13:18:52 +00:00
|
|
|
key: "Amp"; iconSource: ""; name: "Amp"; shortName: "AMP"; category: "Listed assets"
|
2022-12-06 11:19:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onOpened: contentItem.parent.parent = root
|
|
|
|
Component.onCompleted: openFlow(HoldingsDropdown.FlowType.Add)
|
|
|
|
}
|
|
|
|
}
|