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
|
2023-01-24 21:48:42 +00:00
|
|
|
import Models 1.0
|
2022-12-06 11:19:20 +00:00
|
|
|
|
2023-06-30 12:34:42 +00:00
|
|
|
import AppLayouts.Communities.popups 1.0
|
2023-06-23 06:17:04 +00:00
|
|
|
import AppLayouts.Communities.controls 1.0
|
2022-12-06 11:19:20 +00:00
|
|
|
|
2023-04-25 20:27:33 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
SplitView {
|
2022-12-06 11:19:20 +00:00
|
|
|
id: root
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
orientation: Qt.Vertical
|
2022-12-06 11:19:20 +00:00
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
Item {
|
|
|
|
id: container
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.margins: 50
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
|
|
|
Label {
|
|
|
|
text: "Open flow:"
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Add"
|
|
|
|
onClicked: {
|
|
|
|
holdingsDropdown.close()
|
|
|
|
holdingsDropdown.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Update"
|
|
|
|
onClicked: {
|
|
|
|
holdingsDropdown.close()
|
|
|
|
holdingsDropdown.setActiveTab(HoldingTypes.Type.Ens)
|
|
|
|
holdingsDropdown.openUpdateFlow()
|
|
|
|
}
|
2023-01-18 19:54:14 +00:00
|
|
|
}
|
2022-12-06 11:19:20 +00:00
|
|
|
}
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
HoldingsDropdown {
|
|
|
|
id: holdingsDropdown
|
|
|
|
|
|
|
|
parent: container
|
|
|
|
anchors.centerIn: container
|
|
|
|
|
2023-07-27 13:42:12 +00:00
|
|
|
allTokensMode: ctrlAllTokensMode.checked
|
|
|
|
|
2023-04-25 20:27:33 +00:00
|
|
|
CollectiblesModel {
|
|
|
|
id: collectiblesModel
|
|
|
|
}
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: collectiblesModelWithSupply
|
|
|
|
|
|
|
|
sourceModel: collectiblesModel
|
|
|
|
|
|
|
|
proxyRoles: [
|
|
|
|
ExpressionRole {
|
|
|
|
name: "supply"
|
2023-08-08 19:32:46 +00:00
|
|
|
expression: model.index === 1 ? model.index : (model.index + 1) * 115
|
2023-04-25 20:27:33 +00:00
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "infiniteSupply"
|
2023-08-08 19:32:46 +00:00
|
|
|
expression: !((model.index + 1) % 4)
|
2023-04-25 20:27:33 +00:00
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "chainName"
|
|
|
|
expression: model.index ? "Optimism" : "Arbitrum"
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
|
2023-04-27 21:38:09 +00:00
|
|
|
readonly property string icon1: "network/Network=Optimism"
|
|
|
|
readonly property string icon2: "network/Network=Arbitrum"
|
2023-04-25 20:27:33 +00:00
|
|
|
|
|
|
|
name: "chainIcon"
|
|
|
|
expression: model.index ? icon1 : icon2
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-06-14 07:19:45 +00:00
|
|
|
AssetsModel {
|
|
|
|
id: assetsModel
|
|
|
|
}
|
|
|
|
|
|
|
|
SortFilterProxyModel {
|
|
|
|
id: assetsModelWithSupply
|
|
|
|
|
|
|
|
sourceModel: assetsModel
|
|
|
|
|
|
|
|
proxyRoles: [
|
|
|
|
ExpressionRole {
|
|
|
|
name: "supply"
|
|
|
|
expression: (model.index + 1) * 584
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "infiniteSupply"
|
|
|
|
expression: !(model.index % 4)
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
name: "chainName"
|
|
|
|
expression: model.index ? "Ethereum Mainnet" : "Goerli"
|
|
|
|
},
|
|
|
|
ExpressionRole {
|
|
|
|
|
|
|
|
readonly property string icon1: "network/Network=Ethereum"
|
|
|
|
readonly property string icon2: "network/Network=Testnet"
|
|
|
|
|
|
|
|
name: "chainIcon"
|
|
|
|
expression: model.index ? icon1 : icon2
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
filters: ValueFilter {
|
|
|
|
roleName: "category"
|
|
|
|
value: TokenCategories.Category.Community
|
|
|
|
}
|
|
|
|
}
|
2023-04-25 20:27:33 +00:00
|
|
|
|
2023-08-08 19:32:46 +00:00
|
|
|
collectiblesModel: collectiblesModelWithSupply
|
2023-04-25 20:27:33 +00:00
|
|
|
|
2023-08-08 19:32:46 +00:00
|
|
|
assetsModel: assetsModelWithSupply
|
2023-03-15 17:14:31 +00:00
|
|
|
isENSTab: isEnsTabChecker.checked
|
|
|
|
|
|
|
|
onOpened: contentItem.parent.parent = container
|
|
|
|
Component.onCompleted: {
|
2023-01-18 19:54:14 +00:00
|
|
|
holdingsDropdown.close()
|
2023-03-15 17:14:31 +00:00
|
|
|
holdingsDropdown.open()
|
2023-01-18 19:54:14 +00:00
|
|
|
}
|
2022-12-06 11:19:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-15 17:14:31 +00:00
|
|
|
LogsAndControlsPanel {
|
|
|
|
SplitView.minimumHeight: 100
|
|
|
|
SplitView.preferredHeight: 250
|
2022-12-06 11:19:20 +00:00
|
|
|
|
2023-03-23 16:10:56 +00:00
|
|
|
RowLayout {
|
|
|
|
CheckBox {
|
|
|
|
id: isEnsTabChecker
|
2023-04-25 20:27:33 +00:00
|
|
|
text: "ENS tab visible"
|
2023-03-23 16:10:56 +00:00
|
|
|
checked: true
|
|
|
|
}
|
|
|
|
|
2023-04-25 20:27:33 +00:00
|
|
|
CheckBox {
|
|
|
|
id: isAirdropMode
|
|
|
|
text: "Airdrop mode"
|
2023-03-23 16:10:56 +00:00
|
|
|
checked: false
|
|
|
|
}
|
2023-07-27 13:42:12 +00:00
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: ctrlAllTokensMode
|
|
|
|
text: "All tokens mode"
|
|
|
|
}
|
2023-01-18 19:54:14 +00:00
|
|
|
}
|
2022-12-06 11:19:20 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Popups
|