2020-09-01 03:49:05 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-07-27 21:10:00 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-10-17 10:17:25 +00:00
|
|
|
import StatusQ.Components 0.1
|
2022-07-27 21:10:00 +00:00
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2022-10-17 10:17:25 +00:00
|
|
|
|
2021-10-14 12:14:11 +00:00
|
|
|
import "../panels"
|
2020-09-01 03:49:05 +00:00
|
|
|
|
2020-10-22 12:06:35 +00:00
|
|
|
Column {
|
2020-09-01 03:49:05 +00:00
|
|
|
id: root
|
2022-07-27 21:10:00 +00:00
|
|
|
|
2022-12-19 13:02:56 +00:00
|
|
|
property int errorType: Constants.NoError
|
2022-10-17 10:17:25 +00:00
|
|
|
property bool isLoading: false
|
2022-05-19 08:53:57 +00:00
|
|
|
|
2022-12-19 13:02:56 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
readonly property bool isValid: root.errorType === Constants.NoError
|
|
|
|
}
|
|
|
|
|
|
|
|
visible: !d.isValid || isLoading
|
|
|
|
spacing: 5
|
|
|
|
|
2022-07-27 21:10:00 +00:00
|
|
|
StatusIcon {
|
2020-09-01 03:49:05 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-07-27 21:10:00 +00:00
|
|
|
height: 20
|
|
|
|
width: 20
|
|
|
|
icon: "cancel"
|
|
|
|
color: Theme.palette.dangerColor1
|
2022-12-19 13:02:56 +00:00
|
|
|
visible: !d.isValid && !isLoading
|
2022-10-17 10:17:25 +00:00
|
|
|
}
|
|
|
|
StatusLoadingIndicator {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
width: 24
|
|
|
|
height: 24
|
|
|
|
color: Theme.palette.baseColor1
|
2022-12-19 13:02:56 +00:00
|
|
|
visible: isLoading && d.isValid
|
2020-10-22 12:06:35 +00:00
|
|
|
}
|
|
|
|
StyledText {
|
|
|
|
id: txtValidationError
|
2022-07-26 18:14:55 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-12-19 13:02:56 +00:00
|
|
|
text: isLoading ? qsTr("Calculating fees"): errorType === Constants.SendAmountExceedsBalance ?
|
|
|
|
qsTr("Balance exceeded") : qsTr("No route found")
|
2020-10-22 12:06:35 +00:00
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: 13
|
|
|
|
height: 18
|
|
|
|
color: Style.current.danger
|
2020-09-01 03:49:05 +00:00
|
|
|
}
|
|
|
|
}
|