Noelia 15927b0705 feat(Community/FinaliseOwnership): Added finalise flow in the app
- Button from community column.
- Button from community overview.
- Updated storybook pages (settings overview related) according to new components requirements.

Part of #12174
2023-10-03 13:53:42 +02:00

41 lines
1.4 KiB
QML

import QtQuick 2.15
import StatusQ.Core 0.1
import utils 1.0
/*!
\qmltype SingleFeeSubscriber
\inherits QtObject
\brief Helper object that parses fees response and provides fee text and error text for single fee response
*/
QtObject {
id: root
// Published properties
property var feesResponse
// Internal properties based on response
readonly property string feeText: {
if (!feesResponse || !Object.values(feesResponse.ethCurrency).length || !Object.values(feesResponse.fiatCurrency).length) return ""
if (feesResponse.errorCode !== Constants.ComputeFeeErrorCode.Success && feesResponse.errorCode !== Constants.ComputeFeeErrorCode.Balance)
return ""
return LocaleUtils.currencyAmountToLocaleString(feesResponse.ethCurrency)
+ " (" + LocaleUtils.currencyAmountToLocaleString(feesResponse.fiatCurrency) + ")"
}
readonly property string feeErrorText: {
if (!feesResponse) return ""
if (feesResponse.errorCode === Constants.ComputeFeeErrorCode.Success) return ""
if (feesResponse.errorCode === Constants.ComputeFeeErrorCode.Balance)
return qsTr("Not enough funds to make transaction")
if (feesResponse.errorCode === Constants.ComputeFeeErrorCode.Infura)
return qsTr("Infura error")
return qsTr("Unknown error")
}
}