2023-06-14 15:25:48 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2023-07-20 10:38:49 +00:00
|
|
|
import QtQuick.Layouts 1.15
|
2023-06-14 15:25:48 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
import AppLayouts.Communities.controls 1.0
|
2023-06-14 15:25:48 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
|
2023-06-14 15:25:48 +00:00
|
|
|
Control {
|
|
|
|
id: root
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
// expected roles:
|
|
|
|
//
|
|
|
|
// title (string) - e.g. ""Airdropping 2 on Optimism"
|
|
|
|
// feeText (string) - e.g. "0.0015 ($75.54)
|
|
|
|
// error (bool), optional
|
2023-06-14 15:25:48 +00:00
|
|
|
property alias model: repeater.model
|
|
|
|
readonly property alias count: repeater.count
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
property alias placeholderText: placeholderText.text
|
|
|
|
|
2023-07-26 22:39:13 +00:00
|
|
|
property bool highlightFees: count === 1
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
property Item footer
|
2023-06-14 15:25:48 +00:00
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
states: State {
|
|
|
|
when: root.footer
|
|
|
|
|
|
|
|
ParentChange {
|
|
|
|
target: root.footer
|
|
|
|
parent: contentItem
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
target: root.footer
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: -Style.current.padding
|
|
|
|
}
|
|
|
|
}
|
2023-06-14 15:25:48 +00:00
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
2023-07-25 09:32:04 +00:00
|
|
|
readonly property int placeholderHeight: 24
|
2023-06-14 15:25:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: ColumnLayout {
|
|
|
|
spacing: Style.current.padding
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
StatusBaseText {
|
|
|
|
id: placeholderText
|
2023-06-14 15:25:48 +00:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2023-07-25 09:32:04 +00:00
|
|
|
Layout.preferredHeight: Math.max(implicitHeight,
|
|
|
|
d.placeholderHeight)
|
2023-06-14 15:25:48 +00:00
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
visible: repeater.count === 0
|
|
|
|
font.pixelSize: Style.current.primaryTextFontSize
|
|
|
|
wrapMode: Text.Wrap
|
|
|
|
color: Theme.palette.baseColor1
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
2023-06-14 15:25:48 +00:00
|
|
|
}
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
Repeater {
|
|
|
|
id: repeater
|
2023-06-14 15:25:48 +00:00
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
FeeRow {
|
2023-06-14 15:25:48 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2023-07-20 10:38:49 +00:00
|
|
|
title: model.title
|
|
|
|
feeText: model.feeText
|
|
|
|
errorFee: !!model.error
|
2023-07-26 22:39:13 +00:00
|
|
|
highlightFee: root.highlightFees
|
2023-06-14 15:25:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|