feat: Rename to payment request

This commit is contained in:
Emil Sawicki 2024-11-24 08:30:18 +01:00
parent 9ad2726794
commit d1ccce5d4d
13 changed files with 20 additions and 53 deletions

View File

@ -32,7 +32,7 @@ SplitView {
width: parent.width width: parent.width
imagePreviewArray: ["https://picsum.photos/200/300?random=1", "https://picsum.photos/200/300?random=1"] imagePreviewArray: ["https://picsum.photos/200/300?random=1", "https://picsum.photos/200/300?random=1"]
linkPreviewModel: showLinkPreviewSettings ? emptyModel : mockedLinkPreviewModel linkPreviewModel: showLinkPreviewSettings ? emptyModel : mockedLinkPreviewModel
requestPaymentModel: mockedRequestPaymentModel paymentRequestModel: mockedPaymentRequestModel
showLinkPreviewSettings: !linkPreviewEnabledSwitch.checked showLinkPreviewSettings: !linkPreviewEnabledSwitch.checked
visible: hasContent visible: hasContent
@ -84,8 +84,8 @@ SplitView {
id: mockedLinkPreviewModel id: mockedLinkPreviewModel
} }
RequestPaymentModel { PaymentRequestModel {
id: mockedRequestPaymentModel id: mockedPaymentRequestModel
} }
} }

View File

@ -13,8 +13,8 @@ SplitView {
id: mockedLinkPreviewModel id: mockedLinkPreviewModel
} }
RequestPaymentModel { PaymentRequestModel {
id: mockedRequestPaymentModel id: mockedPaymentRequestModel
} }
Pane { Pane {
@ -31,7 +31,7 @@ SplitView {
playAnimations: true playAnimations: true
linkPreviewModel: mockedLinkPreviewModel linkPreviewModel: mockedLinkPreviewModel
gifLinks: [ "https://media.tenor.com/qN_ytiwLh24AAAAC/cold.gif" ] gifLinks: [ "https://media.tenor.com/qN_ytiwLh24AAAAC/cold.gif" ]
requestPaymentModel: mockedRequestPaymentModel paymentRequestModel: mockedPaymentRequestModel
senderName: "Alice" senderName: "Alice"

View File

@ -23,7 +23,7 @@ TokensBySymbolModel 1.0 TokensBySymbolModel.qml
CommunitiesModel 1.0 CommunitiesModel.qml CommunitiesModel 1.0 CommunitiesModel.qml
OnRampProvidersModel 1.0 OnRampProvidersModel.qml OnRampProvidersModel 1.0 OnRampProvidersModel.qml
SwapTransactionRoutes 1.0 SwapTransactionRoutes.qml SwapTransactionRoutes 1.0 SwapTransactionRoutes.qml
RequestPaymentModel 1.0 RequestPaymentModel.qml PaymentRequestModel 1.0 PaymentRequestModel.qml
singleton ModelsData 1.0 ModelsData.qml singleton ModelsData 1.0 ModelsData.qml
singleton NetworksModel 1.0 NetworksModel.qml singleton NetworksModel 1.0 NetworksModel.qml

View File

@ -1,23 +0,0 @@
import QtQuick 2.15
QtObject {
required property CurrenciesStore currencyStore
required property var flatNetworksModel
required property var processedAssetsModel
required property var accountsModel
property var requestPaymentModel: ListModel {}
function addPaymentRequest(symbol, amount, address, chainId) {
requestPaymentModel.append({
symbol: symbol,
amount: amount,
address: address,
chainId: chainId
})
}
function removePaymentRequest(index) {
requestPaymentModel.remove(index)
}
}

View File

@ -37,10 +37,10 @@ Control {
string symbol string symbol
string amount string amount
*/ */
required property var requestPaymentModel required property var paymentRequestModel
readonly property alias hoveredUrl: d.hoveredUrl readonly property alias hoveredUrl: d.hoveredUrl
readonly property bool hasContent: imagePreviewArray.length > 0 || showLinkPreviewSettings || linkPreviewRepeater.count > 0 || requestPaymentRepeater.count > 0 readonly property bool hasContent: imagePreviewArray.length > 0 || showLinkPreviewSettings || linkPreviewRepeater.count > 0 || paymentRequestRepeater.count > 0
signal imageRemoved(int index) signal imageRemoved(int index)
signal imageClicked(var chatImage) signal imageClicked(var chatImage)
@ -105,9 +105,9 @@ Control {
visible: !!imagePreviewArray && imagePreviewArray.length > 0 visible: !!imagePreviewArray && imagePreviewArray.length > 0
} }
Repeater { Repeater {
id: requestPaymentRepeater id: paymentRequestRepeater
model: root.requestPaymentModel model: root.paymentRequestModel
delegate: RequestPaymentMiniCardDelegate { delegate: PaymentRequestMiniCardDelegate {
required property var model required property var model
amount: model.amount amount: model.amount

View File

@ -10,7 +10,7 @@ LinkPreviewCard 1.0 LinkPreviewCard.qml
LinkPreviewMiniCard 1.0 LinkPreviewMiniCard.qml LinkPreviewMiniCard 1.0 LinkPreviewMiniCard.qml
LinkPreviewSettingsCard 1.0 LinkPreviewSettingsCard.qml LinkPreviewSettingsCard 1.0 LinkPreviewSettingsCard.qml
LinkPreviewSettingsCardMenu 1.0 LinkPreviewSettingsCardMenu.qml LinkPreviewSettingsCardMenu 1.0 LinkPreviewSettingsCardMenu.qml
RequestPaymentMiniCardDelegate 1.0 RequestPaymentMiniCardDelegate.qml PaymentRequestMiniCardDelegate 1.0 PaymentRequestMiniCardDelegate.qml
MessageMouseArea 1.0 MessageMouseArea.qml MessageMouseArea 1.0 MessageMouseArea.qml
MessageReactionsRow 1.0 MessageReactionsRow.qml MessageReactionsRow 1.0 MessageReactionsRow.qml
ProfileHeader 1.0 ProfileHeader.qml ProfileHeader 1.0 ProfileHeader.qml

View File

@ -2,5 +2,5 @@ ContactListItemDelegate 1.0 ContactListItemDelegate.qml
LinkPreviewCardDelegate 1.0 LinkPreviewCardDelegate.qml LinkPreviewCardDelegate 1.0 LinkPreviewCardDelegate.qml
LinkPreviewGifDelegate 1.0 LinkPreviewGifDelegate.qml LinkPreviewGifDelegate 1.0 LinkPreviewGifDelegate.qml
LinkPreviewMiniCardDelegate 1.0 LinkPreviewMiniCardDelegate.qml LinkPreviewMiniCardDelegate 1.0 LinkPreviewMiniCardDelegate.qml
RequestPaymentCardDelegate 1.0 RequestPaymentCardDelegate.qml PaymentRequestCardDelegate 1.0 PaymentRequestCardDelegate.qml
InfoCard 1.0 InfoCard.qml InfoCard 1.0 InfoCard.qml

View File

@ -1,10 +0,0 @@
import QtQuick 2.15
QtObject {
required property CurrenciesStore currencyStore
required property var flatNetworksModel
required property var processedAssetsModel
required property var accountsModel
property var requestPaymentModel: null
}

View File

@ -40,7 +40,7 @@ Flow {
signal imageClicked(var image, var mouse, string imageSource, string url) signal imageClicked(var image, var mouse, string imageSource, string url)
signal openContextMenu(var item, string url, string domain) signal openContextMenu(var item, string url, string domain)
signal setNeverAskAboutUnfurlingAgain(bool neverAskAgain) signal setNeverAskAboutUnfurlingAgain(bool neverAskAgain)
signal requestPaymentClicked(var symbol, var amount, var receiver, var chainId) signal paymentRequestClicked(var symbol, var amount, var receiver, var chainId)
function resetLocalAskAboutUnfurling() { function resetLocalAskAboutUnfurling() {
d.localAskAboutUnfurling = true d.localAskAboutUnfurling = true
@ -64,18 +64,18 @@ Flow {
} }
Repeater { Repeater {
id: requestPaymentRepeater id: paymentRequestRepeater
model: root.paymentRequestModel model: root.paymentRequestModel
delegate: RequestPaymentCardDelegate { delegate: PaymentRequestCardDelegate {
required property var model required property var model
objectName: "RrequestPaymentDelegate_" + model.index objectName: "RpaymentRequestDelegate_" + model.index
amount: model.amount amount: model.amount
symbol: model.symbol symbol: model.symbol
address: model.receiver address: model.receiver
senderName: root.senderName senderName: root.senderName
senderThumbnailImage: root.senderThumbnailImage senderThumbnailImage: root.senderThumbnailImage
senderColorId: root.senderColorId senderColorId: root.senderColorId
onClicked: root.requestPaymentClicked(model.symbol, model.amount, model.receiver, model.chainId) onClicked: root.paymentRequestClicked(model.symbol, model.amount, model.receiver, model.chainId)
} }
} }

View File

@ -992,7 +992,7 @@ Loader {
gifUnfurlingEnabled: root.sharedRootStore.gifUnfurlingEnabled gifUnfurlingEnabled: root.sharedRootStore.gifUnfurlingEnabled
canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain
onSetNeverAskAboutUnfurlingAgain: root.sharedRootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain) onSetNeverAskAboutUnfurlingAgain: root.sharedRootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain)
onRequestPaymentClicked: Global.paymentRequestClicked(receiver, symbol, amount, chainId) onPaymentRequestClicked: Global.paymentRequestClicked(receiver, symbol, amount, chainId)
Component.onCompleted: { Component.onCompleted: {
root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId) root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId)