status-desktop/storybook/pages/InlineNetworksComboBoxPage.qml
Noelia 0ab8a62896 feat(Communities): Communities folder reorganization
- Renamed main `CommunitiesPortal` folder to `Communities`.
- Created new `layouts` folder.
- Moved layout files from chat to communities.
- Created new `helpers` folder.
- Moved helpers files from chat to communities.
- Moved `controls/community` files from chat to communities `controls`.
- Moved `panels/communities` files from chat to communities `panels`.
- Moved `popups/community` files from chat to communities `popups`.
- Moved `views/community` files from chat to communities `views`.
- Moved `CommunityBanner` file from shared to `Communities/controls`. Only used in communities context.
- Moved `CommunitySettingsView` and `CommunityColumnView` files from chat to communities `views`.
- Moved `PermissionsStore.qml` file to `shared/stores`.
- Updated imports.
- Updated storybook.

Part of #6204
2023-06-28 14:28:47 +02:00

88 lines
2.1 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import Models 1.0
import utils 1.0
import AppLayouts.Communities.controls 1.0
Item {
id: root
readonly property var modelData: [
{
name: "Optimism",
icon: Style.svg(ModelsData.networks.optimism),
amount: 300,
infiniteAmount: false
},
{
name: "Arbitrum",
icon: Style.svg(ModelsData.networks.arbitrum),
amount: 400,
infiniteAmount: false
},
{
name: "Hermez",
icon: Style.svg(ModelsData.networks.hermez),
amount: 0,
infiniteAmount: true
}
]
ListModel {
id: singleItemModel
Component.onCompleted: append(modelData[0])
}
ListModel {
id: multipleItemsModel
Component.onCompleted: append(modelData)
}
InlineNetworksComboBox {
id: comboBox
anchors.centerIn: parent
width: 300
model: singleItemRadioButton.checked ? singleItemModel
: multipleItemsModel
}
Pane {
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
ColumnLayout {
Row {
Layout.alignment: Qt.AlignHCenter
RadioButton {
id: singleItemRadioButton
text: "single item model"
}
RadioButton {
text: "multiple items model"
checked: true
}
}
Label {
Layout.alignment: Qt.AlignHCenter
text: `current name: ${comboBox.control.displayText}`
}
Label {
Layout.alignment: Qt.AlignHCenter
text: `current amount: ${comboBox.currentAmount}`
}
Label {
Layout.alignment: Qt.AlignHCenter
text: `current amount infinite: ${comboBox.currentInfiniteAmount}`
}
}
}
}