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

View File

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

View File

@ -23,7 +23,7 @@ TokensBySymbolModel 1.0 TokensBySymbolModel.qml
CommunitiesModel 1.0 CommunitiesModel.qml
OnRampProvidersModel 1.0 OnRampProvidersModel.qml
SwapTransactionRoutes 1.0 SwapTransactionRoutes.qml
RequestPaymentModel 1.0 RequestPaymentModel.qml
PaymentRequestModel 1.0 PaymentRequestModel.qml
singleton ModelsData 1.0 ModelsData.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 amount
*/
required property var requestPaymentModel
required property var paymentRequestModel
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 imageClicked(var chatImage)
@ -105,9 +105,9 @@ Control {
visible: !!imagePreviewArray && imagePreviewArray.length > 0
}
Repeater {
id: requestPaymentRepeater
model: root.requestPaymentModel
delegate: RequestPaymentMiniCardDelegate {
id: paymentRequestRepeater
model: root.paymentRequestModel
delegate: PaymentRequestMiniCardDelegate {
required property var model
amount: model.amount

View File

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

View File

@ -2,5 +2,5 @@ ContactListItemDelegate 1.0 ContactListItemDelegate.qml
LinkPreviewCardDelegate 1.0 LinkPreviewCardDelegate.qml
LinkPreviewGifDelegate 1.0 LinkPreviewGifDelegate.qml
LinkPreviewMiniCardDelegate 1.0 LinkPreviewMiniCardDelegate.qml
RequestPaymentCardDelegate 1.0 RequestPaymentCardDelegate.qml
PaymentRequestCardDelegate 1.0 PaymentRequestCardDelegate.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 openContextMenu(var item, string url, string domain)
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() {
d.localAskAboutUnfurling = true
@ -64,18 +64,18 @@ Flow {
}
Repeater {
id: requestPaymentRepeater
id: paymentRequestRepeater
model: root.paymentRequestModel
delegate: RequestPaymentCardDelegate {
delegate: PaymentRequestCardDelegate {
required property var model
objectName: "RrequestPaymentDelegate_" + model.index
objectName: "RpaymentRequestDelegate_" + model.index
amount: model.amount
symbol: model.symbol
address: model.receiver
senderName: root.senderName
senderThumbnailImage: root.senderThumbnailImage
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
canAskToUnfurlGifs: !root.sharedRootStore.neverAskAboutUnfurlingAgain
onSetNeverAskAboutUnfurlingAgain: root.sharedRootStore.setNeverAskAboutUnfurlingAgain(neverAskAgain)
onRequestPaymentClicked: Global.paymentRequestClicked(receiver, symbol, amount, chainId)
onPaymentRequestClicked: Global.paymentRequestClicked(receiver, symbol, amount, chainId)
Component.onCompleted: {
root.messageStore.messageModule.forceLinkPreviewsLocalData(root.messageId)