2023-04-05 11:42:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQml 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2024-08-27 14:35:52 +00:00
|
|
|
import StatusQ 0.1
|
2022-07-14 11:03:36 +00:00
|
|
|
import StatusQ.Core 0.1
|
2024-08-03 07:49:14 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as SQUtils
|
2021-10-20 10:21:23 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
2022-09-01 15:34:27 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2023-06-13 08:18:53 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-10-20 10:21:23 +00:00
|
|
|
|
2023-03-23 07:34:05 +00:00
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
2022-07-14 11:03:36 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
2022-03-25 08:46:47 +00:00
|
|
|
import "../panels"
|
2021-10-05 20:50:22 +00:00
|
|
|
import "../popups"
|
|
|
|
import "../stores"
|
|
|
|
import "../controls"
|
|
|
|
|
2024-05-22 08:13:39 +00:00
|
|
|
import AppLayouts.Communities.stores 1.0
|
2023-05-10 11:54:06 +00:00
|
|
|
import AppLayouts.Wallet.stores 1.0 as WalletStores
|
2023-06-02 18:00:31 +00:00
|
|
|
import AppLayouts.Wallet.popups 1.0
|
|
|
|
import AppLayouts.Wallet.controls 1.0
|
2023-06-13 14:55:26 +00:00
|
|
|
import AppLayouts.Wallet.panels 1.0
|
2023-05-10 11:54:06 +00:00
|
|
|
|
2022-09-01 15:34:27 +00:00
|
|
|
ColumnLayout {
|
2023-01-12 23:26:48 +00:00
|
|
|
id: root
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2023-04-25 16:54:50 +00:00
|
|
|
property var overview
|
2024-10-01 15:37:05 +00:00
|
|
|
|
|
|
|
property WalletStores.RootStore walletRootStore
|
2024-05-22 08:13:39 +00:00
|
|
|
property CommunitiesStore communitiesStore
|
2024-10-04 10:04:59 +00:00
|
|
|
property CurrenciesStore currencyStore
|
2023-07-26 11:50:27 +00:00
|
|
|
property bool showAllAccounts: false
|
2024-02-19 08:40:16 +00:00
|
|
|
property bool displayValues: true
|
2023-12-18 10:12:57 +00:00
|
|
|
property bool filterVisible
|
2024-02-19 08:40:16 +00:00
|
|
|
property bool disableShadowOnScroll: false
|
|
|
|
property bool hideVerticalScrollbar: false
|
|
|
|
property int firstItemOffset: 0
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2024-11-22 15:57:21 +00:00
|
|
|
// banner component to be displayed on top of the list
|
|
|
|
property alias bannerComponent: banner.sourceComponent
|
|
|
|
|
2024-02-19 08:40:16 +00:00
|
|
|
property real yPosition: transactionListRoot.visibleArea.yPosition * transactionListRoot.contentHeight
|
|
|
|
|
2023-09-21 06:58:44 +00:00
|
|
|
function resetView() {
|
|
|
|
if (!!filterPanelLoader.item) {
|
|
|
|
filterPanelLoader.item.resetView()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-25 11:18:58 +00:00
|
|
|
Component.onCompleted: {
|
2024-10-02 07:50:10 +00:00
|
|
|
if (root.walletRootStore.transactionActivityStatus.isFilterDirty) {
|
2024-10-01 15:37:05 +00:00
|
|
|
root.walletRootStore.currentActivityFiltersStore.applyAllFilters()
|
2023-07-07 10:00:19 +00:00
|
|
|
}
|
2023-10-03 10:48:47 +00:00
|
|
|
|
2024-10-01 15:37:05 +00:00
|
|
|
root.walletRootStore.currentActivityFiltersStore.updateCollectiblesModel()
|
|
|
|
root.walletRootStore.currentActivityFiltersStore.updateRecipientsModel()
|
2023-07-07 10:00:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
2024-10-02 07:50:10 +00:00
|
|
|
target: root.walletRootStore.transactionActivityStatus
|
2023-07-07 10:00:19 +00:00
|
|
|
enabled: root.visible
|
2023-07-21 10:55:36 +00:00
|
|
|
function onIsFilterDirtyChanged() {
|
2024-10-02 07:50:10 +00:00
|
|
|
root.walletRootStore.updateTransactionFilterIfDirty()
|
2023-07-07 10:00:19 +00:00
|
|
|
}
|
2023-10-03 10:48:47 +00:00
|
|
|
function onFilterChainsChanged() {
|
2024-10-01 15:37:05 +00:00
|
|
|
root.walletRootStore.currentActivityFiltersStore.updateCollectiblesModel()
|
|
|
|
root.walletRootStore.currentActivityFiltersStore.updateRecipientsModel()
|
2023-10-03 10:48:47 +00:00
|
|
|
}
|
2023-07-07 10:00:19 +00:00
|
|
|
}
|
|
|
|
|
2023-01-12 23:26:48 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
2024-10-02 07:50:10 +00:00
|
|
|
readonly property bool isInitialLoading: root.walletRootStore.loadingHistoryTransactions && transactionListRoot.count === 0
|
2023-07-19 14:16:45 +00:00
|
|
|
|
2023-06-30 13:50:06 +00:00
|
|
|
readonly property int loadingSectionWidth: 56
|
2024-02-19 08:40:16 +00:00
|
|
|
|
|
|
|
property bool firstSectionHeaderLoaded: false
|
2023-07-07 14:25:28 +00:00
|
|
|
|
|
|
|
readonly property int maxSecondsBetweenRefresh: 3
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
|
|
|
|
2024-08-03 07:49:14 +00:00
|
|
|
InformationTag {
|
|
|
|
id: betaTag
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.alignment: Qt.AlignTop
|
|
|
|
Layout.topMargin: root.firstItemOffset
|
|
|
|
Layout.preferredHeight: 56
|
|
|
|
visible: root.firstItemOffset === 0 // visible only in the main wallet view
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.halfPadding
|
2024-08-03 07:49:14 +00:00
|
|
|
backgroundColor: Theme.palette.primaryColor3
|
2024-10-15 19:26:12 +00:00
|
|
|
bgRadius: Theme.radius
|
2024-08-03 07:49:14 +00:00
|
|
|
bgBorderColor: Theme.palette.primaryColor2
|
|
|
|
tagPrimaryLabel.textFormat: Text.RichText
|
2024-10-15 19:26:12 +00:00
|
|
|
tagPrimaryLabel.font.pixelSize: Theme.additionalTextSize
|
2024-08-03 07:49:14 +00:00
|
|
|
tagPrimaryLabel.text: qsTr("Activity is in beta. If transactions are missing, check %1, %2, or %3.")
|
|
|
|
.arg(Utils.getStyledLink("Etherscan", "https://etherscan.io/", tagPrimaryLabel.hoveredLink))
|
|
|
|
.arg(Utils.getStyledLink("OP Explorer", "https://optimistic.etherscan.io/", tagPrimaryLabel.hoveredLink))
|
|
|
|
.arg(Utils.getStyledLink("Arbiscan", "https://arbiscan.io/", tagPrimaryLabel.hoveredLink))
|
|
|
|
tagPrimaryLabel.onLinkActivated: (link) => {
|
2024-10-01 15:37:05 +00:00
|
|
|
const explorerUrl = root.walletRootStore.showAllAccounts ? link
|
|
|
|
: "%1/%2/%3".arg(link).arg(Constants.networkExplorerLinks.addressPath).arg(root.walletRootStore.selectedAddress)
|
2024-08-03 07:49:14 +00:00
|
|
|
Global.openLinkWithConfirmation(explorerUrl, SQUtils.StringUtils.extractDomainFromLink(explorerUrl))
|
|
|
|
}
|
|
|
|
asset {
|
|
|
|
name: "warning"
|
|
|
|
width: 20
|
|
|
|
height: 20
|
|
|
|
color: Theme.palette.primaryColor1
|
|
|
|
}
|
|
|
|
HoverHandler {
|
|
|
|
cursorShape: hovered && !!parent.tagPrimaryLabel.hoveredLink ? Qt.PointingHandCursor : undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-05 20:50:22 +00:00
|
|
|
StyledText {
|
|
|
|
id: nonArchivalNodeError
|
2024-02-19 08:40:16 +00:00
|
|
|
Layout.fillWidth: true
|
2022-09-01 15:34:27 +00:00
|
|
|
Layout.alignment: Qt.AlignTop
|
2024-02-19 08:40:16 +00:00
|
|
|
Layout.topMargin: root.firstItemOffset
|
2024-10-02 07:50:10 +00:00
|
|
|
visible: root.walletRootStore.isNonArchivalNode
|
2022-04-04 11:26:30 +00:00
|
|
|
text: qsTr("Status Desktop is connected to a non-archival node. Transaction history may be incomplete.")
|
2024-10-15 19:26:12 +00:00
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
|
|
|
color: Theme.palette.dangerColor1
|
2024-02-19 08:40:16 +00:00
|
|
|
wrapMode: Text.WordWrap
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
|
|
|
|
2023-08-04 08:41:45 +00:00
|
|
|
Loader {
|
|
|
|
id: filterPanelLoader
|
2024-10-01 15:37:05 +00:00
|
|
|
active: root.filterVisible && (d.isInitialLoading || transactionListRoot.count > 0 || root.walletRootStore.currentActivityFiltersStore.filtersSet)
|
2024-02-22 14:41:19 +00:00
|
|
|
visible: active && !noTxs.visible
|
2023-08-04 08:41:45 +00:00
|
|
|
asynchronous: true
|
2023-06-02 18:00:31 +00:00
|
|
|
Layout.fillWidth: true
|
2023-08-04 08:41:45 +00:00
|
|
|
sourceComponent: ActivityFilterPanel {
|
2024-10-01 15:37:05 +00:00
|
|
|
activityFilterStore: root.walletRootStore.currentActivityFiltersStore
|
|
|
|
store: root.walletRootStore
|
2023-11-14 10:35:18 +00:00
|
|
|
hideNoResults: newTransactions.visible
|
2023-08-04 08:41:45 +00:00
|
|
|
isLoading: d.isInitialLoading
|
|
|
|
}
|
2023-06-02 18:00:31 +00:00
|
|
|
}
|
|
|
|
|
2024-11-22 15:57:21 +00:00
|
|
|
Loader {
|
|
|
|
id: banner
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
ShapeRectangle {
|
|
|
|
id: noTxs
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 42
|
|
|
|
Layout.topMargin: !nonArchivalNodeError.visible? root.firstItemOffset : 0
|
|
|
|
visible: !d.isInitialLoading && !root.walletRootStore.currentActivityFiltersStore.filtersSet && transactionListRoot.count === 0
|
|
|
|
font.pixelSize: Theme.primaryTextFontSize
|
|
|
|
text: qsTr("Activity for this account will appear here")
|
|
|
|
}
|
|
|
|
|
2023-06-16 09:37:17 +00:00
|
|
|
Item {
|
2024-02-19 08:40:16 +00:00
|
|
|
id: transactionListWrapper
|
2022-09-01 15:34:27 +00:00
|
|
|
Layout.alignment: Qt.AlignTop
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: nonArchivalNodeError.visible || noTxs.visible ? Theme.padding : 0
|
2022-09-01 15:34:27 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
2023-06-16 09:37:17 +00:00
|
|
|
Rectangle { // Shadow behind delegates when scrolling
|
2024-02-19 08:40:16 +00:00
|
|
|
anchors.top: parent.top
|
2023-06-16 09:37:17 +00:00
|
|
|
width: parent.width
|
|
|
|
height: 4
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.separator
|
2024-02-19 08:40:16 +00:00
|
|
|
visible: !root.disableShadowOnScroll && !transactionListRoot.atYBeginning
|
2023-06-16 09:37:17 +00:00
|
|
|
}
|
2023-03-23 07:34:05 +00:00
|
|
|
|
2023-06-16 09:37:17 +00:00
|
|
|
StatusListView {
|
|
|
|
id: transactionListRoot
|
|
|
|
objectName: "walletAccountTransactionList"
|
|
|
|
anchors.fill: parent
|
2023-03-23 07:34:05 +00:00
|
|
|
|
2023-06-16 09:37:17 +00:00
|
|
|
model: SortFilterProxyModel {
|
|
|
|
id: txModel
|
|
|
|
|
2024-10-02 07:50:10 +00:00
|
|
|
sourceModel: root.walletRootStore.historyTransactions
|
2023-06-16 09:37:17 +00:00
|
|
|
|
|
|
|
// LocaleUtils is not accessable from inside expression, but local function works
|
2023-06-30 12:55:59 +00:00
|
|
|
property var daysTo: (d1, d2) => LocaleUtils.daysTo(d1, d2)
|
|
|
|
property var daysBetween: (d1, d2) => LocaleUtils.daysBetween(d1, d2)
|
|
|
|
property var getFirstDayOfTheCurrentWeek: () => LocaleUtils.getFirstDayOfTheCurrentWeek()
|
2023-06-16 09:37:17 +00:00
|
|
|
proxyRoles: ExpressionRole {
|
|
|
|
name: "date"
|
|
|
|
expression: {
|
2024-07-17 12:14:01 +00:00
|
|
|
if (!model.activityEntry || model.activityEntry.timestamp === 0)
|
2023-06-30 12:55:59 +00:00
|
|
|
return ""
|
|
|
|
const currDate = new Date()
|
|
|
|
const timestampDate = new Date(model.activityEntry.timestamp * 1000)
|
|
|
|
const daysDiff = txModel.daysBetween(currDate, timestampDate)
|
|
|
|
const daysToBeginingOfThisWeek = txModel.daysTo(timestampDate, txModel.getFirstDayOfTheCurrentWeek())
|
|
|
|
|
|
|
|
if (daysDiff < 1) {
|
|
|
|
return qsTr("Today")
|
|
|
|
} else if (daysDiff < 2) {
|
|
|
|
return qsTr("Yesterday")
|
|
|
|
} else if (daysToBeginingOfThisWeek >= 0) {
|
|
|
|
return qsTr("Earlier this week")
|
|
|
|
} else if (daysToBeginingOfThisWeek > -7) {
|
|
|
|
return qsTr("Last week")
|
2023-08-03 08:45:05 +00:00
|
|
|
} else if (currDate.getMonth() === timestampDate.getMonth() && currDate.getYear() === timestampDate.getYear()) {
|
2023-06-30 12:55:59 +00:00
|
|
|
return qsTr("Earlier this month")
|
2023-08-03 08:45:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const previousMonthDate = (new Date(new Date().setDate(0)))
|
|
|
|
// Special case for the end of the year
|
|
|
|
if ((timestampDate.getMonth() === previousMonthDate.getMonth() && timestampDate.getYear() === previousMonthDate.getYear())
|
|
|
|
|| (previousMonthDate.getMonth() === 11 && timestampDate.getMonth() === 0 && Math.abs(timestampDate.getYear() - previousMonthDate.getYear()) === 1))
|
|
|
|
{
|
2023-06-30 12:55:59 +00:00
|
|
|
return qsTr("Last month")
|
|
|
|
}
|
2023-08-03 08:45:05 +00:00
|
|
|
|
2023-06-30 12:55:59 +00:00
|
|
|
return timestampDate.toLocaleDateString(Qt.locale(), "MMM yyyy")
|
2023-06-16 09:37:17 +00:00
|
|
|
}
|
2023-03-23 07:34:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-19 08:40:16 +00:00
|
|
|
delegate: transactionDelegateComponent
|
2023-03-23 07:34:05 +00:00
|
|
|
|
2023-07-04 22:29:34 +00:00
|
|
|
headerPositioning: ListView.OverlayHeader
|
2023-06-16 09:37:17 +00:00
|
|
|
footer: footerComp
|
2021-10-05 20:50:22 +00:00
|
|
|
|
2024-02-19 08:40:16 +00:00
|
|
|
ScrollBar.vertical: StatusScrollBar {
|
|
|
|
policy: root.hideVerticalScrollbar? ScrollBar.AlwaysOff : ScrollBar.AsNeeded
|
2023-03-23 07:34:05 +00:00
|
|
|
}
|
2023-06-30 13:50:06 +00:00
|
|
|
|
2024-02-19 08:40:16 +00:00
|
|
|
visibleArea.onYPositionChanged: {
|
|
|
|
tryFetchMoreTransactions()
|
|
|
|
}
|
2023-06-30 13:50:06 +00:00
|
|
|
|
|
|
|
Connections {
|
2024-10-02 07:50:10 +00:00
|
|
|
target: root.walletRootStore
|
|
|
|
|
2023-06-30 13:50:06 +00:00
|
|
|
function onLoadingHistoryTransactionsChanged() {
|
|
|
|
// Calling timer instead directly to not cause binding loop
|
2024-10-02 07:50:10 +00:00
|
|
|
if (!root.walletRootStore.loadingHistoryTransactions)
|
2023-06-30 13:50:06 +00:00
|
|
|
fetchMoreTimer.start()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function tryFetchMoreTransactions() {
|
2024-10-02 07:50:10 +00:00
|
|
|
if (d.isInitialLoading || !footerItem || !root.walletRootStore.historyTransactions.hasMore)
|
2023-06-30 13:50:06 +00:00
|
|
|
return
|
|
|
|
const footerYPosition = footerItem.height / contentHeight
|
|
|
|
if (footerYPosition >= 1.0) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// On startup, first loaded ListView will have heightRatio equal 0
|
|
|
|
if (footerYPosition + visibleArea.yPosition + visibleArea.heightRatio > 1.0) {
|
2024-10-02 07:50:10 +00:00
|
|
|
root.walletRootStore.fetchMoreTransactions()
|
2023-06-30 13:50:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Timer {
|
|
|
|
id: fetchMoreTimer
|
|
|
|
interval: 1
|
|
|
|
onTriggered: transactionListRoot.tryFetchMoreTransactions()
|
|
|
|
}
|
2023-06-16 09:37:17 +00:00
|
|
|
}
|
|
|
|
|
2023-07-13 12:22:02 +00:00
|
|
|
StatusButton {
|
|
|
|
id: newTransactions
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: parent.top
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.halfPadding
|
2023-07-13 12:22:02 +00:00
|
|
|
|
|
|
|
text: qsTr("New transactions")
|
|
|
|
|
2024-10-02 07:50:10 +00:00
|
|
|
visible: root.walletRootStore.newDataAvailable && !root.walletRootStore.loadingHistoryTransactions
|
|
|
|
onClicked: root.walletRootStore.resetActivityData()
|
2023-07-13 12:22:02 +00:00
|
|
|
|
|
|
|
icon.name: "arrow-up"
|
|
|
|
|
|
|
|
radius: 36
|
|
|
|
type: StatusButton.Primary
|
|
|
|
size: StatusBaseButton.Size.Tiny
|
|
|
|
}
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
Component {
|
|
|
|
id: txContextMenu
|
2023-06-13 08:18:53 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
TransactionContextMenu {
|
|
|
|
required property var modelData
|
2023-06-13 08:18:53 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
readonly property var firstTx: SQUtils.ModelUtils.get(modelData.transactions, 0)
|
|
|
|
readonly property int firstTxChainId: !!firstTx ? firstTx.chainId : 0
|
|
|
|
readonly property string firstTxHash: !!firstTx ? firstTx.txHash : ""
|
2023-09-27 13:41:55 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
readonly property string networkShortName: Utils.getNetworkShortName(firstTxChainId)
|
|
|
|
readonly property bool isNetworkTestnet: Utils.isChainIDTestnet(firstTxChainId)
|
2023-09-27 13:41:55 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
hideDisabledItems: true
|
2023-09-27 13:41:55 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
networkExplorerName: Utils.getChainExplorerName(networkShortName)
|
2023-09-27 13:41:55 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
onClosed: destroy()
|
2024-02-29 14:53:08 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
onCopyTxHashRequested: {
|
|
|
|
ClipboardUtils.setText(firstTxHash)
|
2023-06-13 08:18:53 +00:00
|
|
|
}
|
2023-09-22 10:57:24 +00:00
|
|
|
|
2024-11-15 05:04:00 +00:00
|
|
|
onViewTxOnExplorerRequested: {
|
|
|
|
let link = Utils.getUrlForTxOnNetwork(networkShortName, isNetworkTestnet, firstTxHash)
|
|
|
|
Global.openLink(link)
|
2023-06-13 08:18:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-01 15:34:27 +00:00
|
|
|
Component {
|
2024-02-19 08:40:16 +00:00
|
|
|
id: transactionDelegateComponent
|
|
|
|
ColumnLayout {
|
|
|
|
id: transactionDelegate
|
|
|
|
|
2023-06-30 15:07:53 +00:00
|
|
|
required property var model
|
|
|
|
required property int index
|
2024-02-19 08:40:16 +00:00
|
|
|
|
|
|
|
readonly property bool displaySectionHeader: index === 0 || model.date !== txModel.get(index - 1).date
|
|
|
|
readonly property bool displaySectionFooter: index === txModel.count-1 || model.date !== txModel.get(index + 1).date
|
|
|
|
|
2023-04-05 11:42:12 +00:00
|
|
|
width: ListView.view.width
|
2024-02-19 08:40:16 +00:00
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: root.firstItemOffset
|
|
|
|
visible: transactionDelegate.index === 0 && root.firstItemOffset > 0
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: childrenRect.height
|
|
|
|
visible: transactionDelegate.displaySectionHeader
|
|
|
|
color: Theme.palette.statusModal.backgroundColor
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.top: parent.top
|
|
|
|
width: parent.width
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.halfPadding
|
2024-02-19 08:40:16 +00:00
|
|
|
|
|
|
|
Separator {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
implicitHeight: 1
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusBaseText {
|
2024-10-15 19:26:12 +00:00
|
|
|
leftPadding: Theme.padding
|
|
|
|
bottomPadding: Theme.halfPadding
|
2024-02-19 08:40:16 +00:00
|
|
|
text: transactionDelegate.model.date
|
|
|
|
font.pixelSize: 13
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TransactionDelegate {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
modelData: transactionDelegate.model.activityEntry
|
|
|
|
timeStampText: isModelDataValid ? LocaleUtils.formatRelativeTimestamp(modelData.timestamp * 1000, true) : ""
|
2024-10-02 08:48:34 +00:00
|
|
|
flatNetworks: root.walletRootStore.flatNetworks
|
2024-10-04 10:04:59 +00:00
|
|
|
currenciesStore: root.currencyStore
|
2024-10-01 15:37:05 +00:00
|
|
|
walletRootStore: root.walletRootStore
|
2024-02-19 08:40:16 +00:00
|
|
|
showAllAccounts: root.showAllAccounts
|
|
|
|
displayValues: root.displayValues
|
2024-02-22 14:41:19 +00:00
|
|
|
community: isModelDataValid && !!communityId && !!root.communitiesStore ? root.communitiesStore.getCommunityDetailsAsJson(communityId) : null
|
2024-02-19 08:40:16 +00:00
|
|
|
onClicked: {
|
|
|
|
if (mouse.button === Qt.RightButton) {
|
2024-11-15 05:04:00 +00:00
|
|
|
txContextMenu.createObject(this, { modelData }).popup(mouse)
|
2024-02-19 08:40:16 +00:00
|
|
|
}
|
2023-06-13 08:18:53 +00:00
|
|
|
}
|
|
|
|
}
|
2024-02-19 08:40:16 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 20
|
|
|
|
visible: transactionDelegate.displaySectionFooter
|
|
|
|
color: Theme.palette.statusModal.backgroundColor
|
|
|
|
}
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-01 15:34:27 +00:00
|
|
|
Component {
|
2023-01-12 23:26:48 +00:00
|
|
|
id: footerComp
|
|
|
|
ColumnLayout {
|
2023-06-30 13:50:06 +00:00
|
|
|
id: footerColumn
|
2024-10-02 07:50:10 +00:00
|
|
|
readonly property bool allActivityLoaded: !root.walletRootStore.historyTransactions.hasMore && transactionListRoot.count !== 0
|
2023-01-12 23:26:48 +00:00
|
|
|
width: root.width
|
2023-07-13 12:22:02 +00:00
|
|
|
spacing: d.isInitialLoading ? 6 : 12
|
2023-06-30 13:50:06 +00:00
|
|
|
|
|
|
|
Separator {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.halfPadding
|
2023-06-30 13:50:06 +00:00
|
|
|
visible: d.isInitialLoading
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusTextWithLoadingState {
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.leftMargin: Theme.padding
|
2023-06-30 13:50:06 +00:00
|
|
|
text: "01.01.2000"
|
|
|
|
width: d.loadingSectionWidth
|
|
|
|
font.pixelSize: 15
|
|
|
|
loading: visible
|
|
|
|
visible: d.isInitialLoading
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
2023-07-13 12:22:02 +00:00
|
|
|
model: {
|
2023-08-04 08:41:45 +00:00
|
|
|
if (!root.visible)
|
|
|
|
return 0
|
2023-07-13 12:22:02 +00:00
|
|
|
if (!noTxs.visible) {
|
|
|
|
const delegateHeight = 64 + footerColumn.spacing
|
|
|
|
if (d.isInitialLoading) {
|
|
|
|
return Math.floor(transactionListRoot.height / delegateHeight)
|
2024-10-02 07:50:10 +00:00
|
|
|
} else if (root.walletRootStore.historyTransactions.hasMore) {
|
2023-07-13 12:22:02 +00:00
|
|
|
return Math.max(3, Math.floor(transactionListRoot.height / delegateHeight) - 3)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
2023-06-30 13:50:06 +00:00
|
|
|
TransactionDelegate {
|
|
|
|
Layout.fillWidth: true
|
2024-09-24 11:51:22 +00:00
|
|
|
|
2024-10-02 08:48:34 +00:00
|
|
|
flatNetworks: root.walletRootStore.flatNetworks
|
2024-10-04 10:04:59 +00:00
|
|
|
currenciesStore: root.currencyStore
|
2024-10-01 15:37:05 +00:00
|
|
|
walletRootStore: root.walletRootStore
|
2023-06-30 13:50:06 +00:00
|
|
|
loading: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-31 07:47:52 +00:00
|
|
|
Separator {
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.topMargin: Theme.bigPadding
|
2023-05-31 07:47:52 +00:00
|
|
|
Layout.fillWidth: true
|
2023-06-30 13:50:06 +00:00
|
|
|
visible: footerColumn.allActivityLoaded
|
2023-01-12 23:26:48 +00:00
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
text: qsTr("You have reached the beginning of the activity for this account")
|
|
|
|
font.pixelSize: 13
|
|
|
|
color: Theme.palette.baseColor1
|
2023-06-30 13:50:06 +00:00
|
|
|
visible: footerColumn.allActivityLoaded
|
2023-01-12 23:26:48 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
}
|
|
|
|
StatusButton {
|
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
text: qsTr("Back to most recent transaction")
|
2023-06-30 13:50:06 +00:00
|
|
|
visible: footerColumn.allActivityLoaded && transactionListRoot.contentHeight > transactionListRoot.height
|
2023-01-12 23:26:48 +00:00
|
|
|
onClicked: transactionListRoot.positionViewAtBeginning()
|
|
|
|
}
|
2024-02-19 08:40:16 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.preferredHeight: Theme.halfPadding
|
2024-02-19 08:40:16 +00:00
|
|
|
}
|
2023-01-12 23:26:48 +00:00
|
|
|
}
|
2022-09-01 15:34:27 +00:00
|
|
|
}
|
2021-10-05 20:50:22 +00:00
|
|
|
}
|