status-desktop/ui/app/AppLayouts/Communities/controls/AirdropTokensSelector.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

93 lines
2.5 KiB
QML

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Components 0.1
import utils 1.0
StatusFlowSelector {
id: root
property alias model: repeater.model
readonly property alias count: repeater.count
signal itemClicked(int index, var mouse, var item)
placeholderText: qsTr("Example: 1 SOCK")
placeholderItem.visible: repeater.count === 0
title: qsTr("What")
icon: Style.svg("token")
QtObject {
id: d
readonly property int commonMargin: 6
readonly property int iconSize: 28
}
Repeater {
id: repeater
Control {
id: delegateRoot
component Icon: StatusRoundedImage {
implicitWidth: d.iconSize
implicitHeight: d.iconSize
image.mipmap: true
}
component Text: StatusBaseText {
Layout.fillWidth: true
font.weight: Font.Medium
color: model.valid ? Theme.palette.primaryColor1
: Theme.palette.dangerColor1
elide: Text.ElideRight
}
implicitHeight: root.placeholderItemHeight
leftPadding: (root.placeholderItemHeight - d.iconSize) / 2
rightPadding: d.commonMargin * 2
background: Rectangle {
color: model.valid ? Theme.palette.primaryColor3
: Theme.palette.dangerColor3
radius: root.placeholderItemHeight / 2
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.itemClicked(model.index, mouse, delegateRoot)
}
}
contentItem: RowLayout {
spacing: d.commonMargin
Icon {
image.source: model.tokenImage
}
Text {
text: qsTr("%1 on", "It means that a given token is deployed 'on' a given network, e.g. '2 MCT on Ethereum'. The name of the network is preceded by an icon, so it is not part of this phrase.")
.arg(model.tokenText)
}
Icon {
image.source: model.networkImage
}
Text {
text: model.networkText
}
}
}
}
}