chore(@desktop/wallet): Chnage the send modal mechanism to follow new architecture guidelines.

After this change there is not need to pass sendModal instance from AppMain to other parts of app.
Then SendModal should be launched simply by calling Global.openSendModal(....)
This commit is contained in:
Khushboo Mehta 2024-11-05 19:51:17 +01:00
parent e6a7af8708
commit d389808a53
28 changed files with 379 additions and 285 deletions

View File

@ -44,8 +44,6 @@ StackLayout {
allMembers: !!sectionItemModel ? sectionItemModel.allMembers : null allMembers: !!sectionItemModel ? sectionItemModel.allMembers : null
} }
property var sendModalPopup
readonly property bool isOwner: sectionItemModel.memberRole === Constants.memberRole.owner readonly property bool isOwner: sectionItemModel.memberRole === Constants.memberRole.owner
readonly property bool isAdmin: sectionItemModel.memberRole === Constants.memberRole.admin readonly property bool isAdmin: sectionItemModel.memberRole === Constants.memberRole.admin
readonly property bool isTokenMasterOwner: sectionItemModel.memberRole === Constants.memberRole.tokenMaster readonly property bool isTokenMasterOwner: sectionItemModel.memberRole === Constants.memberRole.tokenMaster
@ -164,7 +162,6 @@ StackLayout {
communitiesStore: root.communitiesStore communitiesStore: root.communitiesStore
walletAssetsStore: root.walletAssetsStore walletAssetsStore: root.walletAssetsStore
currencyStore: root.currencyStore currencyStore: root.currencyStore
sendModalPopup: root.sendModalPopup
sectionItemModel: root.sectionItemModel sectionItemModel: root.sectionItemModel
joinedMembersCount: membersModelAdaptor.joinedMembers.ModelCount.count joinedMembersCount: membersModelAdaptor.joinedMembers.ModelCount.count
amIMember: sectionItem.amIMember amIMember: sectionItem.amIMember
@ -257,7 +254,6 @@ StackLayout {
enabledChainIds: WalletStore.RootStore.networkFilters enabledChainIds: WalletStore.RootStore.networkFilters
onEnableNetwork: WalletStore.RootStore.enableNetwork(chainId) onEnableNetwork: WalletStore.RootStore.enableNetwork(chainId)
tokensStore: root.tokensStore tokensStore: root.tokensStore
sendModalPopup: root.sendModalPopup
transactionStore: root.transactionStore transactionStore: root.transactionStore
isPendingOwnershipRequest: root.isPendingOwnershipRequest isPendingOwnershipRequest: root.isPendingOwnershipRequest

View File

@ -48,7 +48,6 @@ StatusSectionLayout {
property CommunitiesStores.CommunitiesStore communitiesStore property CommunitiesStores.CommunitiesStore communitiesStore
required property WalletStore.WalletAssetsStore walletAssetsStore required property WalletStore.WalletAssetsStore walletAssetsStore
required property SharedStores.CurrenciesStore currencyStore required property SharedStores.CurrenciesStore currencyStore
required property var sendModalPopup
property var sectionItemModel property var sectionItemModel
property int joinedMembersCount property int joinedMembersCount
@ -325,7 +324,6 @@ StatusSectionLayout {
id: statusStickerPackClickPopup id: statusStickerPackClickPopup
StatusStickerPackClickPopup{ StatusStickerPackClickPopup{
walletAssetsStore: root.walletAssetsStore walletAssetsStore: root.walletAssetsStore
sendModalPopup: root.sendModalPopup
onClosed: { onClosed: {
destroy(); destroy();
} }

View File

@ -31,7 +31,6 @@ StackView {
required property string communityName required property string communityName
required property string communityLogo required property string communityLogo
required property color communityColor required property color communityColor
property var sendModalPopup
// User profile props: // User profile props:
required property bool isOwner required property bool isOwner
@ -786,8 +785,7 @@ StackView {
onSendOwnershipClicked: Global.openTransferOwnershipPopup(root.communityId, onSendOwnershipClicked: Global.openTransferOwnershipPopup(root.communityId,
root.communityName, root.communityName,
root.communityLogo, root.communityLogo,
tokenViewPage.token, tokenViewPage.token)
root.sendModalPopup)
// helper properties to pass data through popups // helper properties to pass data through popups
property var walletsAndAmounts property var walletsAndAmounts

View File

@ -40,7 +40,6 @@ StackLayout {
property bool requestToJoinEnabled property bool requestToJoinEnabled
property bool pinMessagesEnabled property bool pinMessagesEnabled
property string previousPageName: (currentIndex === 1) ? qsTr("Overview") : "" property string previousPageName: (currentIndex === 1) ? qsTr("Overview") : ""
property var sendModalPopup
property bool archiveSupporVisible: true property bool archiveSupporVisible: true
property bool editable: false property bool editable: false
@ -134,8 +133,15 @@ StackLayout {
Global.openTransferOwnershipPopup(root.communityId, Global.openTransferOwnershipPopup(root.communityId,
root.name, root.name,
root.logoImageData, root.logoImageData,
root.ownerToken, {
root.sendModalPopup) key: "0",
privilegesLevel: root.ownerToken.privilegesLevel,
chainId: root.ownerToken.chainId,
name: root.ownerToken.name,
artworkSource: root.ownerToken.image,
accountAddress: root.ownerToken.accountAddress.toLowerCase(),
tokenAddress: root.ownerToken.tokenAddress.toLowerCase()
})
} else { } else {
Global.openPopup(transferOwnershipAlertPopup, { mode: TransferOwnershipAlertPopup.Mode.TransferOwnership }) Global.openPopup(transferOwnershipAlertPopup, { mode: TransferOwnershipAlertPopup.Mode.TransferOwnership })
} }

View File

@ -12,6 +12,7 @@ import StatusQ.Core.Utils 0.1
import StatusQ.Components 0.1 import StatusQ.Components 0.1
import shared.popups 1.0 import shared.popups 1.0
import shared.popups.send 1.0
import AppLayouts.Wallet.stores 1.0 as WalletStores import AppLayouts.Wallet.stores 1.0 as WalletStores
import utils 1.0 import utils 1.0
@ -26,7 +27,6 @@ StatusDialog {
// Transaction related props: // Transaction related props:
property var token // Expected roles: accountAddress, key, chainId, name, artworkSource property var token // Expected roles: accountAddress, key, chainId, name, artworkSource
property var sendModalPopup
signal cancelClicked signal cancelClicked
@ -109,13 +109,22 @@ StatusDialog {
onClicked: { onClicked: {
// Pre-populated dialog with the relevant Owner token info: // Pre-populated dialog with the relevant Owner token info:
root.sendModalPopup.preSelectedSendType = Constants.SendType.ERC721Transfer
root.sendModalPopup.preSelectedAccountAddress = token.accountAddress
const store = WalletStores.RootStore.currentActivityFiltersStore const store = WalletStores.RootStore.currentActivityFiltersStore
const uid = store.collectiblesList.getUidForData(token.key, token.tokenAddress, token.chainId); const uid = store.collectiblesList.getUidForData(token.key, token.tokenAddress, token.chainId);
root.sendModalPopup.preSelectedHoldingID = uid Global.openSendModal(Constants.SendType.ERC721Transfer, //sendType
root.sendModalPopup.preSelectedHoldingType = Constants.TokenType.ERC721 token.accountAddress, //senderAddress
root.sendModalPopup.open() uid, //tokenId
Constants.TokenType.ERC721, //tokenType
"", //tokenAmount
0, //chainId
"", //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
close() close()
} }
} }

View File

@ -46,7 +46,6 @@ StatusSectionLayout {
required property var declinedMembers required property var declinedMembers
required property TransactionStore transactionStore required property TransactionStore transactionStore
property bool communitySettingsDisabled property bool communitySettingsDisabled
property var sendModalPopup
required property string enabledChainIds required property string enabledChainIds
@ -221,7 +220,6 @@ StatusSectionLayout {
pubsubTopic: root.community.pubsubTopic pubsubTopic: root.community.pubsubTopic
pubsubTopicKey: root.community.pubsubTopicKey pubsubTopicKey: root.community.pubsubTopicKey
sendModalPopup: root.sendModalPopup
ownerToken: tokensModelChangesTracker.ownerToken ownerToken: tokensModelChangesTracker.ownerToken
isPendingOwnershipRequest: root.isPendingOwnershipRequest isPendingOwnershipRequest: root.isPendingOwnershipRequest
@ -380,7 +378,6 @@ StatusSectionLayout {
communityName: root.community.name communityName: root.community.name
communityLogo: root.community.image communityLogo: root.community.image
communityColor: root.community.color communityColor: root.community.color
sendModalPopup: root.sendModalPopup
// User profile props // User profile props
isOwner: root.isOwner isOwner: root.isOwner

View File

@ -45,7 +45,6 @@ StatusSectionLayout {
property ProfileStores.ProfileSectionStore store property ProfileStores.ProfileSectionStore store
property AppLayoutsStores.RootStore globalStore property AppLayoutsStores.RootStore globalStore
property CommunitiesStore.CommunitiesStore communitiesStore property CommunitiesStore.CommunitiesStore communitiesStore
required property var sendModalPopup
property var systemPalette property var systemPalette
property var emojiPopup property var emojiPopup
property SharedStores.NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
@ -249,7 +248,6 @@ StatusSectionLayout {
implicitHeight: parent.height implicitHeight: parent.height
ensUsernamesStore: root.store.ensUsernamesStore ensUsernamesStore: root.store.ensUsernamesStore
walletAssetsStore: root.walletAssetsStore walletAssetsStore: root.walletAssetsStore
sendModalPopup: root.sendModalPopup
contactsStore: root.store.contactsStore contactsStore: root.store.contactsStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
profileContentWidth: d.contentWidth profileContentWidth: d.contentWidth
@ -289,7 +287,6 @@ StatusSectionLayout {
myPublicKey: root.store.contactsStore.myPublicKey myPublicKey: root.store.contactsStore.myPublicKey
currencySymbol: root.sharedRootStore.currencyStore.currentCurrency currencySymbol: root.sharedRootStore.currencyStore.currentCurrency
emojiPopup: root.emojiPopup emojiPopup: root.emojiPopup
sendModalPopup: root.sendModalPopup
sectionTitle: settingsEntriesModel.getNameForSubsection(Constants.settingsSubsection.wallet) sectionTitle: settingsEntriesModel.getNameForSubsection(Constants.settingsSubsection.wallet)
} }
onLoaded: root.store.backButtonName = "" onLoaded: root.store.backButtonName = ""

View File

@ -24,8 +24,6 @@ Item {
property EnsUsernamesStore ensUsernamesStore property EnsUsernamesStore ensUsernamesStore
property WalletAssetsStore walletAssetsStore property WalletAssetsStore walletAssetsStore
required property var sendModalPopup
property ContactsStore contactsStore property ContactsStore contactsStore
property SharedStores.NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
@ -262,18 +260,20 @@ Item {
onConnectUsername: { onConnectUsername: {
ensView.selectedUsername = username ensView.selectedUsername = username
ensView.sendModalPopup.modalHeaderText = qsTr("Connect username with your pubkey") Global.openSendModal(Constants.SendType.ENSSetPubKey, //sendType
ensView.sendModalPopup.interactive = false "", //senderAddress
ensView.sendModalPopup.preSelectedRecipient = ensView.ensUsernamesStore.getEnsRegisteredAddress() Constants.ethToken, //tokenId
ensView.sendModalPopup.preSelectedRecipientType = Helpers.RecipientAddressObjectType.Address Constants.TokenType.ERC20, //tokenType
ensView.sendModalPopup.preSelectedHoldingID = Constants.ethToken LocaleUtils.numberToLocaleString(0), //tokenAmount
ensView.sendModalPopup.preSelectedHoldingType = Constants.TokenType.ERC20 ensView.selectedChainId, //chainId
ensView.sendModalPopup.preSelectedSendType = Constants.SendType.ENSSetPubKey ensView.ensUsernamesStore.getEnsRegisteredAddress(), //recipientAddress
ensView.sendModalPopup.preDefinedAmountToSend = LocaleUtils.numberToLocaleString(0) Helpers.RecipientAddressObjectType.Address, //recipientType
ensView.sendModalPopup.preSelectedChainId = ensView.selectedChainId false, //onlyAssets
ensView.sendModalPopup.publicKey = ensView.contactsStore.myPublicKey false, //interactive
ensView.sendModalPopup.ensName = ensView.selectedUsername ensView.contactsStore.myPublicKey, //publicKey
ensView.sendModalPopup.open() ensView.selectedUsername, //ensName
"", //stickersPackId
)
} }
Connections { Connections {
@ -297,17 +297,20 @@ Item {
onBackBtnClicked: back(); onBackBtnClicked: back();
onRegisterUsername: { onRegisterUsername: {
ensView.sendModalPopup.interactive = false Global.openSendModal(Constants.SendType.ENSRegister, //sendType
ensView.sendModalPopup.preSelectedRecipient = ensView.ensUsernamesStore.getEnsRegisteredAddress() "", //senderAddress
ensView.sendModalPopup.preSelectedRecipientType = Helpers.RecipientAddressObjectType.Address !!d.sntToken && !!d.sntToken.symbol ? d.sntToken.symbol: "", //tokenId
ensView.sendModalPopup.preSelectedHoldingID = !!d.sntToken && !!d.sntToken.symbol ? d.sntToken.symbol: "" Constants.TokenType.ERC20, //tokenType
ensView.sendModalPopup.preSelectedHoldingType = Constants.TokenType.ERC20 LocaleUtils.numberToLocaleString(10), //tokenAmount
ensView.sendModalPopup.preSelectedSendType = Constants.SendType.ENSRegister ensView.selectedChainId, //chainId
ensView.sendModalPopup.preDefinedAmountToSend = LocaleUtils.numberToLocaleString(10) ensView.ensUsernamesStore.getEnsRegisteredAddress(), //recipientAddress
ensView.sendModalPopup.preSelectedChainId = ensView.selectedChainId Helpers.RecipientAddressObjectType.Address, //recipientType
ensView.sendModalPopup.publicKey = ensView.contactsStore.myPublicKey false, //onlyAssets
ensView.sendModalPopup.ensName = ensView.selectedUsername false, //interactive
ensView.sendModalPopup.open() ensView.contactsStore.myPublicKey, //publicKey
ensView.selectedUsername, //ensName
"", //stickersPackId
)
} }
Connections { Connections {
@ -385,19 +388,20 @@ Item {
return return
} }
ensView.sendModalPopup.modalHeaderText = qsTr("Release your username") Global.openSendModal(Constants.SendType.ENSRelease, //sendType
ensView.sendModalPopup.interactive = false senderAddress, //senderAddress
ensView.sendModalPopup.preSelectedAccountAddress = senderAddress Constants.ethToken, //tokenId
ensView.sendModalPopup.preSelectedRecipient = ensView.ensUsernamesStore.getEnsRegisteredAddress() Constants.TokenType.Native, //tokenType
ensView.sendModalPopup.preSelectedRecipientType = Helpers.RecipientAddressObjectType.Address LocaleUtils.numberToLocaleString(0), //tokenAmount
ensView.sendModalPopup.preSelectedHoldingID = Constants.ethToken ensView.selectedChainId, //chainId
ensView.sendModalPopup.preSelectedHoldingType = Constants.TokenType.Native ensView.ensUsernamesStore.getEnsRegisteredAddress(), //recipientAddress
ensView.sendModalPopup.preSelectedSendType = Constants.SendType.ENSRelease Helpers.RecipientAddressObjectType.Address, //recipientType
ensView.sendModalPopup.preDefinedAmountToSend = LocaleUtils.numberToLocaleString(0) false, //onlyAssets
ensView.sendModalPopup.preSelectedChainId = ensView.selectedChainId false, //interactive
ensView.sendModalPopup.publicKey = ensView.contactsStore.myPublicKey ensView.contactsStore.myPublicKey, //publicKey
ensView.sendModalPopup.ensName = ensView.selectedUsername ensView.selectedUsername, //ensName
ensView.sendModalPopup.open() "", //stickersPackId
)
} }
Connections { Connections {

View File

@ -44,8 +44,6 @@ SettingsContentBase {
required property WalletAssetsStore assetsStore required property WalletAssetsStore assetsStore
required property CollectiblesStore collectiblesStore required property CollectiblesStore collectiblesStore
required property var sendModalPopup
readonly property int mainViewIndex: 0 readonly property int mainViewIndex: 0
readonly property int networksViewIndex: 1 readonly property int networksViewIndex: 1
readonly property int editNetworksViewIndex: 2 readonly property int editNetworksViewIndex: 2
@ -372,7 +370,6 @@ SettingsContentBase {
id: savedAddressesView id: savedAddressesView
contactsStore: root.rootStore.contactsStore contactsStore: root.rootStore.contactsStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
sendModal: root.sendModalPopup
} }
Component { Component {

View File

@ -12,10 +12,8 @@ ColumnLayout {
property ContactsStore contactsStore property ContactsStore contactsStore
property SharedStores.NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
property var sendModal
SavedAddresses { SavedAddresses {
sendModal: root.sendModal
contactsStore: root.contactsStore contactsStore: root.contactsStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
} }

View File

@ -12,6 +12,7 @@ import shared.popups.keypairimport 1.0
import shared.stores 1.0 as SharedStores import shared.stores 1.0 as SharedStores
import shared.stores.send 1.0 import shared.stores.send 1.0
import shared.popups.send 1.0
import AppLayouts.stores 1.0 as AppLayoutsStores import AppLayouts.stores 1.0 as AppLayoutsStores
import AppLayouts.Communities.stores 1.0 import AppLayouts.Communities.stores 1.0
@ -37,7 +38,6 @@ Item {
required property TransactionStore transactionStore required property TransactionStore transactionStore
property var emojiPopup: null property var emojiPopup: null
property var sendModalPopup
property SharedStores.NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
property bool appMainVisible property bool appMainVisible
@ -208,7 +208,6 @@ Item {
store: root.store store: root.store
contactsStore: root.contactsStore contactsStore: root.contactsStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
sendModal: root.sendModalPopup
networkFilter.visible: false networkFilter.visible: false
headerButton.text: qsTr("Add new address") headerButton.text: qsTr("Add new address")
@ -225,7 +224,6 @@ Item {
store: root.store store: root.store
contactsStore: root.contactsStore contactsStore: root.contactsStore
communitiesStore: root.communitiesStore communitiesStore: root.communitiesStore
sendModal: root.sendModalPopup
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
dappsEnabled: root.dappsEnabled dappsEnabled: root.dappsEnabled
@ -328,40 +326,56 @@ Item {
hasFloatingButtons: true hasFloatingButtons: true
}) })
onLaunchSendModal: (fromAddress) => { onLaunchSendModal: (fromAddress) => {
if(isCommunityOwnershipTransfer) { if(isCommunityOwnershipTransfer) {
const tokenItem = walletStore.currentViewedCollectible const tokenItem = walletStore.currentViewedCollectible
const ownership = StatusQUtils.ModelUtils.get(tokenItem.ownership, 0) const ownership = StatusQUtils.ModelUtils.get(tokenItem.ownership, 0)
Global.openTransferOwnershipPopup(tokenItem.communityId, Global.openTransferOwnershipPopup(tokenItem.communityId,
footer.communityName, footer.communityName,
tokenItem.communityImage, tokenItem.communityImage,
{ {
key: tokenItem.tokenId, key: tokenItem.tokenId,
privilegesLevel: tokenItem.communityPrivilegesLevel, privilegesLevel: tokenItem.communityPrivilegesLevel,
chainId: tokenItem.chainId, chainId: tokenItem.chainId,
name: tokenItem.name, name: tokenItem.name,
artworkSource: tokenItem.artworkSource, artworkSource: tokenItem.artworkSource,
accountAddress: fromAddress, accountAddress: fromAddress,
tokenAddress: tokenItem.contractAddress tokenAddress: tokenItem.contractAddress
}, })
root.sendModalPopup) return
return }
}
// Common send modal popup: // Common send modal popup:
root.sendModalPopup.preSelectedAccountAddress = fromAddress Global.openSendModal(Constants.SendType.Transfer, //sendType
root.sendModalPopup.preSelectedSendType = Constants.SendType.Transfer fromAddress, //senderAddress
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingTokensKey walletStore.currentViewedHoldingTokensKey, //tokenId
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType walletStore.currentViewedHoldingType, //tokenType
root.sendModalPopup.onlyAssets = false "", //tokenAmount
root.sendModalPopup.open() 0, //chainId
} "", //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
}
onLaunchBridgeModal: { onLaunchBridgeModal: {
root.sendModalPopup.preSelectedSendType = Constants.SendType.Bridge Global.openSendModal(Constants.SendType.Bridge, //sendType
root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID "", //senderAddress
root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType walletStore.currentViewedHoldingID, //tokenId
root.sendModalPopup.onlyAssets = true walletStore.currentViewedHoldingType, //tokenType
root.sendModalPopup.open() "", //tokenAmount
0, //chainId
"", //recipientAddress
"", //recipientType
true, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
} }
onLaunchSwapModal: { onLaunchSwapModal: {
d.swapFormData.fromTokensKey = "" d.swapFormData.fromTokensKey = ""

View File

@ -14,6 +14,7 @@ import AppLayouts.Wallet.stores 1.0 as WalletStore
import utils 1.0 import utils 1.0
import shared.views 1.0 import shared.views 1.0
import shared.popups.send 1.0
import shared.stores 1.0 as SharedStores import shared.stores 1.0 as SharedStores
import "../controls" import "../controls"
@ -24,7 +25,6 @@ StatusModal {
property SharedStores.NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
property ProfileStores.ContactsStore contactsStore property ProfileStores.ContactsStore contactsStore
property var sendModalPopup
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
hasCloseButton: false hasCloseButton: false
@ -163,7 +163,20 @@ StatusModal {
} }
onOpenSendModal: { onOpenSendModal: {
root.close() root.close()
root.sendModalPopup.open(recipient) Global.openSendModal(Constants.SendType.Transfer, //sendType
"", //senderAddress
"", //tokenId
Constants.TokenType.Unknown, //tokenType
"", //tokenAmount
0, //chainId
recipient, //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
} }
} }
@ -241,7 +254,20 @@ StatusModal {
enabled: root.networkConnectionStore.sendBuyBridgeEnabled enabled: root.networkConnectionStore.sendBuyBridgeEnabled
onClicked: { onClicked: {
root.close() root.close()
root.sendModalPopup.open(d.visibleAddress) Global.openSendModal(Constants.SendType.Transfer, //sendType
"", //senderAddress
"", //tokenId
Constants.TokenType.Unknown, //tokenType
"", //tokenAmount
0, //chainId
d.visibleAddress, //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
} }
} }

View File

@ -22,8 +22,6 @@ FocusScope {
property bool dappsEnabled property bool dappsEnabled
property bool swapEnabled property bool swapEnabled
property var sendModal
property alias header: header property alias header: header
property alias headerButton: header.headerButton property alias headerButton: header.headerButton
property alias networkFilter: header.networkFilter property alias networkFilter: header.networkFilter

View File

@ -15,6 +15,7 @@ import shared.controls 1.0
import shared.views 1.0 import shared.views 1.0
import shared.stores 1.0 as SharedStores import shared.stores 1.0 as SharedStores
import shared.panels 1.0 import shared.panels 1.0
import shared.popups.send 1.0
import "./" import "./"
import "../stores" import "../stores"
@ -274,13 +275,20 @@ RightTabBaseView {
swapVisible: root.swapEnabled swapVisible: root.swapEnabled
onSendRequested: { onSendRequested: {
const modal = root.sendModal Global.openSendModal(Constants.SendType.Transfer, //sendType
"", //senderAddress
modal.preSelectedSendType = Constants.SendType.Transfer key, //tokenId
modal.preSelectedHoldingID = key Constants.TokenType.ERC20, //tokenType
modal.preSelectedHoldingType = Constants.TokenType.ERC20 "", //tokenAmount
modal.onlyAssets = true 0, //chainId
modal.open() "", //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
true, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
} }
onSwapRequested: root.launchSwapModal(key) onSwapRequested: root.launchSwapModal(key)
@ -398,19 +406,27 @@ RightTabBaseView {
artworkSource: collectible.communityImage, artworkSource: collectible.communityImage,
accountAddress: fromAddress, accountAddress: fromAddress,
tokenAddress: collectible.contractAddress tokenAddress: collectible.contractAddress
}, })
root.sendModal)
return return
} }
root.sendModal.preSelectedAccountAddress = fromAddress let sendType = tokenType === Constants.TokenType.ERC721 ?
root.sendModal.preSelectedHoldingID = symbol Constants.SendType.ERC721Transfer:
root.sendModal.preSelectedHoldingType = tokenType Constants.SendType.ERC1155Transfer
root.sendModal.preSelectedSendType = tokenType === Constants.TokenType.ERC721 ? Global.openSendModal(sendType, //sendType
Constants.SendType.ERC721Transfer: fromAddress, //senderAddress
Constants.SendType.ERC1155Transfer symbol, //tokenId
root.sendModal.onlyAssets = false tokenType, //tokenType
root.sendModal.open() "", //tokenAmount
0, //chainId
"", //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
} }
onReceiveRequested: (symbol) => root.launchShareAddressModal() onReceiveRequested: (symbol) => root.launchShareAddressModal()
onSwitchToCommunityRequested: (communityId) => Global.switchToCommunity(communityId) onSwitchToCommunityRequested: (communityId) => Global.switchToCommunity(communityId)
@ -429,7 +445,6 @@ RightTabBaseView {
communitiesStore: root.communitiesStore communitiesStore: root.communitiesStore
currencyStore: root.sharedRootStore.currencyStore currencyStore: root.sharedRootStore.currencyStore
showAllAccounts: RootStore.showAllAccounts showAllAccounts: RootStore.showAllAccounts
sendModal: root.sendModal
filterVisible: filterButton.checked filterVisible: filterButton.checked
onLaunchTransactionDetail: function (txID) { onLaunchTransactionDetail: function (txID) {
RootStore.activityController.fetchTxDetails(txID) RootStore.activityController.fetchTxDetails(txID)
@ -505,7 +520,6 @@ RightTabBaseView {
} }
showAllAccounts: RootStore.showAllAccounts showAllAccounts: RootStore.showAllAccounts
communitiesStore: root.communitiesStore communitiesStore: root.communitiesStore
sendModal: root.sendModal
rootStore: root.sharedRootStore rootStore: root.sharedRootStore
currenciesStore: root.sharedRootStore.currencyStore currenciesStore: root.sharedRootStore.currencyStore
contactsStore: root.contactsStore contactsStore: root.contactsStore

View File

@ -12,6 +12,7 @@ import SortFilterProxyModel 0.2
import utils 1.0 import utils 1.0
import shared.controls 1.0 import shared.controls 1.0
import shared.stores 1.0 as SharedStores import shared.stores 1.0 as SharedStores
import shared.popups.send 1.0
import AppLayouts.Profile.stores 1.0 as ProfileStores import AppLayouts.Profile.stores 1.0 as ProfileStores
import "../stores" import "../stores"
@ -20,7 +21,6 @@ import "../controls"
ColumnLayout { ColumnLayout {
id: root id: root
property var sendModal
property ProfileStores.ContactsStore contactsStore property ProfileStores.ContactsStore contactsStore
property SharedStores.NetworkConnectionStore networkConnectionStore property SharedStores.NetworkConnectionStore networkConnectionStore
@ -149,7 +149,20 @@ ColumnLayout {
colorId: model.colorId colorId: model.colorId
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
areTestNetworksEnabled: RootStore.areTestNetworksEnabled areTestNetworksEnabled: RootStore.areTestNetworksEnabled
onOpenSendModal: root.sendModal.open(recipient); onOpenSendModal: Global.openSendModal(Constants.SendType.Transfer, //sendType
"", //senderAddress
"", //tokenId
Constants.TokenType.Unknown, //tokenType
"", //tokenAmount
0, //chainId
recipient, //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
states: [ states: [
State { State {

View File

@ -8,7 +8,6 @@ RightTabBaseView {
width: root.width width: root.width
height: root.height - header.height height: root.height - header.height
sendModal: root.sendModal
contactsStore: root.contactsStore contactsStore: root.contactsStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
} }

View File

@ -36,7 +36,6 @@ Item {
property CommunitiesStore communitiesStore property CommunitiesStore communitiesStore
property NetworkConnectionStore networkConnectionStore property NetworkConnectionStore networkConnectionStore
property var controller property var controller
property var sendModal
property bool showAllAccounts: false property bool showAllAccounts: false
readonly property alias transaction: d.transaction readonly property alias transaction: d.transaction
@ -787,17 +786,20 @@ Item {
tx.isNFT, tx.isNFT,
tx.amount, tx.amount,
tx.chainId) tx.chainId)
Global.openSendModal(req.preSelectedSendType, //sendType
root.sendModal.preSelectedAccountAddress = req.preSelectedAccount.address req.preSelectedAccount.address, //senderAddress
root.sendModal.preSelectedRecipient = req.preSelectedRecipient req.preSelectedHoldingID, //tokenId
root.sendModal.preSelectedRecipientType = req.preSelectedRecipientType req.preSelectedHoldingType, //tokenType
root.sendModal.preSelectedHoldingID = req.preSelectedHoldingID req.preDefinedAmountToSend, //tokenAmount
root.sendModal.preSelectedHoldingType = req.preSelectedHoldingType req.preSelectedChainId, //chainId
root.sendModal.preSelectedSendType = req.preSelectedSendType req.preSelectedRecipient, //recipientAddress
root.sendModal.preDefinedAmountToSend = req.preDefinedAmountToSend req.preSelectedRecipientType, //recipientType
root.sendModal.preSelectedChainId = req.preSelectedChainId false, //onlyAssets
root.sendModal.onlyAssets = false true, //interactive
root.sendModal.open() "", //publicKey
"", //ensName
"", //stickersPackId
)
} }
} }
StatusButton { StatusButton {
@ -820,7 +822,20 @@ Item {
areTestNetworksEnabled: WalletStores.RootStore.areTestNetworksEnabled areTestNetworksEnabled: WalletStores.RootStore.areTestNetworksEnabled
contactsStore: root.contactsStore contactsStore: root.contactsStore
networkConnectionStore: root.networkConnectionStore networkConnectionStore: root.networkConnectionStore
onOpenSendModal: (address) => root.sendModal.open(address) onOpenSendModal: (address) => Global.openSendModal(Constants.SendType.Transfer, //sendType
"", //senderAddress
"", //tokenId
Constants.TokenType.Unknown, //tokenType
"", //tokenAmount
0, //chainId
address, //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
} }
component DetailsPanel: Item { component DetailsPanel: Item {

View File

@ -112,8 +112,6 @@ Item {
rootChatStore: appMain.rootChatStore rootChatStore: appMain.rootChatStore
communityTokensStore: appMain.communityTokensStore communityTokensStore: appMain.communityTokensStore
profileStore: appMain.profileStore profileStore: appMain.profileStore
sendModalPopup: sendModal
} }
Connections { Connections {
@ -511,8 +509,30 @@ Item {
} }
} }
function onOpenSendModal(address: string) { function onOpenSendModal(sendType: int, senderAddress: string,
sendModal.open(address) tokenId: string, tokenType: int,
tokenAmount: string, chainId: int,
recipientAddress: string, recipientType: int,
onlyAssets: bool, interactive: bool,
publicKey: string, ensName: string,
stickersPackId: string) {
if (sendType === undefined) sendType = Constants.SendType.Transfer
if (senderAddress === undefined) senderAddress = ""
if (tokenId === undefined) tokenId = ""
if (tokenType === undefined) tokenType = Constants.TokenType.Unknown
if (tokenAmount === undefined) tokenAmount = ""
if (chainId === undefined) chainId = 0
if (recipientAddress === undefined) recipientAddress = ""
if (recipientType === undefined) recipientType = SendPopups.Helpers.RecipientAddressObjectType.Address
if (onlyAssets === undefined) onlyAssets = false
if (interactive === undefined) interactive = true
if (publicKey === undefined) publicKey = ""
if (ensName === undefined) ensName = ""
if (stickersPackId === undefined) stickersPackId = ""
sendModal.open(sendType, senderAddress, tokenId, tokenType, tokenAmount, chainId,
recipientAddress, recipientType, onlyAssets, interactive,
publicKey, ensName, stickersPackId)
} }
function onSwitchToCommunity(communityId: string) { function onSwitchToCommunity(communityId: string) {
@ -657,8 +677,6 @@ Item {
sourceComponent: StatusStickersPopup { sourceComponent: StatusStickersPopup {
store: appMain.rootChatStore store: appMain.rootChatStore
walletAssetsStore: appMain.walletAssetsStore walletAssetsStore: appMain.walletAssetsStore
sendModalPopup: sendModal
isWalletEnabled: appMain.profileStore.isWalletEnabled isWalletEnabled: appMain.profileStore.isWalletEnabled
} }
} }
@ -1427,7 +1445,6 @@ Item {
communitiesStore: appMain.communitiesStore communitiesStore: appMain.communitiesStore
transactionStore: appMain.transactionStore transactionStore: appMain.transactionStore
emojiPopup: statusEmojiPopup.item emojiPopup: statusEmojiPopup.item
sendModalPopup: sendModal
networkConnectionStore: appMain.networkConnectionStore networkConnectionStore: appMain.networkConnectionStore
appMainVisible: appMain.visible appMainVisible: appMain.visible
dappsEnabled: featureFlagsStore.dappsEnabled dappsEnabled: featureFlagsStore.dappsEnabled
@ -1452,7 +1469,6 @@ Item {
store: appMain.rootStore.profileSectionStore store: appMain.rootStore.profileSectionStore
globalStore: appMain.rootStore globalStore: appMain.rootStore
communitiesStore: appMain.communitiesStore communitiesStore: appMain.communitiesStore
sendModalPopup: sendModal
systemPalette: appMain.sysPalette systemPalette: appMain.sysPalette
emojiPopup: statusEmojiPopup.item emojiPopup: statusEmojiPopup.item
networkConnectionStore: appMain.networkConnectionStore networkConnectionStore: appMain.networkConnectionStore
@ -1530,7 +1546,6 @@ Item {
} }
} }
sendModalPopup: sendModal
emojiPopup: statusEmojiPopup.item emojiPopup: statusEmojiPopup.item
stickersPopup: statusStickersPopupLoader.item stickersPopup: statusStickersPopupLoader.item
sectionItemModel: model sectionItemModel: model
@ -1630,13 +1645,35 @@ Item {
id: sendModal id: sendModal
active: false active: false
function open(address = "") { function open(sendType = Constants.SendType.Transfer,
if (!!address) { senderAddress = "",
preSelectedRecipient = address tokenId = "",
preSelectedRecipientType = SendPopups.Helpers.RecipientAddressObjectType.Address tokenType = Constants.TokenType.Unknown,
} tokenAmount = "",
chainId = 0,
recipientAddress = "",
recipientType = SendPopups.Helpers.RecipientAddressObjectType.Address,
onlyAssets = false,
interactive = true,
publicKey = "", ensName = "",
stickersPackId = "") {
this.active = true this.active = true
this.item.open() if (!!this.item) {
if (!!sendType) this.item.preSelectedSendType = sendType
if (!!senderAddress) this.item.preSelectedAccountAddress = senderAddress
if (!!tokenId) this.item.preSelectedHoldingID = tokenId
this.item.preSelectedHoldingType = tokenType
if (!!tokenAmount) this.item.preDefinedAmountToSend = tokenAmount
if (chainId !== 0) this.item.preSelectedChainId = chainId
if (!!recipientAddress) this.item.preSelectedRecipient = recipientAddress
this.item.preSelectedRecipientType = recipientType
this.item.onlyAssets = onlyAssets
this.item.interactive = interactive
this.item.publicKey = publicKey
this.item.ensName = ensName
this.item.stickersPackId = stickersPackId
this.item.open()
}
} }
function closed() { function closed() {
@ -1644,26 +1681,7 @@ Item {
this.active = false this.active = false
} }
property string modalHeaderText sourceComponent: SendPopups.SendModal {
property bool interactive: true
property string preSelectedAccountAddress
property var preSelectedRecipient
property int preSelectedRecipientType
property string preSelectedHoldingID
property int preSelectedHoldingType: Constants.TokenType.Unknown
property int preSelectedSendType: Constants.SendType.Unknown
property string preDefinedAmountToSend
property int preSelectedChainId: 0
property bool onlyAssets: false
property string stickersPackId: ""
property string publicKey: ""
property string ensName: ""
sourceComponent: SendPopups.SendModal {
interactive: sendModal.interactive
onlyAssets: sendModal.onlyAssets
loginType: appMain.rootStore.loginType loginType: appMain.rootStore.loginType
store: appMain.transactionStore store: appMain.transactionStore
@ -1671,55 +1689,7 @@ Item {
showCustomRoutingMode: !production showCustomRoutingMode: !production
onClosed: { onClosed: sendModal.closed()
sendModal.closed()
sendModal.modalHeaderText = ""
sendModal.interactive = true
sendModal.preSelectedSendType = Constants.SendType.Unknown
sendModal.preSelectedHoldingID = ""
sendModal.preSelectedHoldingType = Constants.TokenType.Unknown
sendModal.preSelectedAccountAddress = ""
sendModal.preSelectedRecipient = undefined
sendModal.preDefinedAmountToSend = ""
sendModal.preSelectedChainId = 0
sendModal.stickersPackId = ""
sendModal.publicKey = ""
sendModal.ensName = ""
}
}
onLoaded: {
if (!!sendModal.preSelectedAccountAddress) {
item.preSelectedAccountAddress = sendModal.preSelectedAccountAddress
}
if (!!sendModal.preSelectedRecipient) {
// NOTE Should be assigned in that order: type then recipient
item.preSelectedRecipientType = sendModal.preSelectedRecipientType
item.preSelectedRecipient = sendModal.preSelectedRecipient
}
if (sendModal.preSelectedSendType !== Constants.SendType.Unknown) {
item.preSelectedSendType = sendModal.preSelectedSendType
}
if (sendModal.preSelectedHoldingType !== Constants.TokenType.Unknown) {
item.preSelectedHoldingID = sendModal.preSelectedHoldingID
item.preSelectedHoldingType = sendModal.preSelectedHoldingType
}
if (sendModal.preDefinedAmountToSend != "") {
item.preDefinedAmountToSend = sendModal.preDefinedAmountToSend
}
if (!!sendModal.preSelectedChainId) {
item.preSelectedChainId = sendModal.preSelectedChainId
}
if (!!sendModal.stickersPackId) {
item.stickersPackId = sendModal.stickersPackId
}
if (!!sendModal.publicKey) {
item.publicKey = sendModal.publicKey
}
if (!!sendModal.ensName) {
item.ensName = sendModal.ensName
}
} }
} }
@ -2152,7 +2122,6 @@ Item {
sourceComponent: WalletPopups.SavedAddressActivityPopup { sourceComponent: WalletPopups.SavedAddressActivityPopup {
networkConnectionStore: appMain.networkConnectionStore networkConnectionStore: appMain.networkConnectionStore
contactsStore: appMain.rootStore.contactStore contactsStore: appMain.rootStore.contactStore
sendModalPopup: sendModal
onClosed: { onClosed: {
savedAddressActivity.close() savedAddressActivity.close()

View File

@ -314,8 +314,8 @@ QtObject {
openPopup(importControlNodePopup, { community }) openPopup(importControlNodePopup, { community })
} }
function openTransferOwnershipPopup(communityId, communityName, communityLogo, token, sendModalPopup) { function openTransferOwnershipPopup(communityId, communityName, communityLogo, token) {
openPopup(transferOwnershipPopup, { communityId, communityName, communityLogo, token, sendModalPopup }) openPopup(transferOwnershipPopup, { communityId, communityName, communityLogo, token })
} }
function openConfirmExternalLinkPopup(link, domain) { function openConfirmExternalLinkPopup(link, domain) {

View File

@ -34,9 +34,6 @@ QtObject {
required property SharedStores.CommunityTokensStore communityTokensStore required property SharedStores.CommunityTokensStore communityTokensStore
required property ProfileStore profileStore required property ProfileStore profileStore
// Properties:
required property var sendModalPopup
// Utils: // Utils:
readonly property string viewOptimismExplorerText: qsTr("View on Optimism Explorer") readonly property string viewOptimismExplorerText: qsTr("View on Optimism Explorer")
readonly property string checkmarkCircleAssetName: "checkmark-circle" readonly property string checkmarkCircleAssetName: "checkmark-circle"
@ -241,7 +238,7 @@ QtObject {
Global.openFinaliseOwnershipPopup(actionData) Global.openFinaliseOwnershipPopup(actionData)
return return
case ToastsManager.ActionType.OpenSendModalPopup: case ToastsManager.ActionType.OpenSendModalPopup:
root.sendModalPopup.open() Global.openSendModal()
return return
case ToastsManager.ActionType.ViewTransactionDetails: case ToastsManager.ActionType.ViewTransactionDetails:
if(actionData) { if(actionData) {

View File

@ -183,6 +183,20 @@ StatusDialog {
d.routerErrorDetails = "" d.routerErrorDetails = ""
debounceRecalculateRoutesAndFees() debounceRecalculateRoutesAndFees()
} }
function getTitleText() {
switch (store.sendType) {
case Constants.SendType.Bridge:
return qsTr("Bridge")
case Constants.SendType.ENSRegister:
return qsTr("Register Ens")
case Constants.SendType.ENSSetPubKey:
return qsTr("Connect username with your pubkey")
case Constants.SendType.ENSRelease:
return qsTr("Release your username")
default: return qsTr("Send")
}
}
} }
LeftJoinModel { LeftJoinModel {
@ -372,7 +386,7 @@ StatusDialog {
objectName: "modalHeader" objectName: "modalHeader"
Layout.maximumWidth: contentWidth Layout.maximumWidth: contentWidth
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
text: d.isBridgeTx ? qsTr("Bridge") : qsTr("Send") text: d.getTitleText()
} }
TokenSelector { TokenSelector {

View File

@ -27,7 +27,6 @@ Item {
property ChatStores.RootStore store property ChatStores.RootStore store
property var stickerPacks: ChatStores.StickerPackData {} property var stickerPacks: ChatStores.StickerPackData {}
required property WalletAssetsStore walletAssetsStore required property WalletAssetsStore walletAssetsStore
required property var sendModalPopup
property string packId property string packId
property bool marketVisible property bool marketVisible
property bool isWalletEnabled property bool isWalletEnabled
@ -45,17 +44,20 @@ Item {
function runSendModal(price, packId) { function runSendModal(price, packId) {
const token = ModelUtils.getByKey(root.walletAssetsStore.groupedAccountAssetsModel, "tokensKey", root.store.stickersStore.getStatusTokenKey()) const token = ModelUtils.getByKey(root.walletAssetsStore.groupedAccountAssetsModel, "tokensKey", root.store.stickersStore.getStatusTokenKey())
Global.openSendModal(Constants.SendType.StickersBuy, //sendType
root.sendModalPopup.interactive = false "", //senderAddress
root.sendModalPopup.preSelectedRecipient = root.store.stickersStore.getStickersMarketAddress() !!token && !!token.symbol ? token.symbol : "", //tokenId
root.sendModalPopup.preSelectedRecipientType = Helpers.RecipientAddressObjectType.Address Constants.TokenType.ERC20, //tokenType
root.sendModalPopup.preSelectedHoldingID = !!token && !!token.symbol ? token.symbol : "" LocaleUtils.numberToLocaleString(parseFloat(price)), //tokenAmount
root.sendModalPopup.preSelectedHoldingType = Constants.TokenType.ERC20 root.store.appNetworkId, //chainId
root.sendModalPopup.preSelectedSendType = Constants.SendType.StickersBuy root.store.stickersStore.getStickersMarketAddress(), //recipientAddress
root.sendModalPopup.preDefinedAmountToSend = LocaleUtils.numberToLocaleString(parseFloat(price)) Helpers.RecipientAddressObjectType.Address, //recipientType
root.sendModalPopup.preSelectedChainId = root.store.appNetworkId false, //onlyAssets
root.sendModalPopup.stickersPackId = packId false, //interactive
root.sendModalPopup.open() "", //publicKey
"", //ensName
packId, //stickersPackId
)
} }
} }

View File

@ -26,7 +26,6 @@ ModalPopup {
property ChatStores.RootStore store property ChatStores.RootStore store
required property WalletAssetsStore walletAssetsStore required property WalletAssetsStore walletAssetsStore
required property var sendModalPopup
property string thumbnail: "" property string thumbnail: ""
property string name: "" property string name: ""
property string author: "" property string author: ""
@ -95,17 +94,20 @@ ModalPopup {
onUpdateClicked: function(){} onUpdateClicked: function(){}
onBuyClicked: { onBuyClicked: {
const token = SQUtils.ModelUtils.getByKey(stickerPackDetailsPopup.walletAssetsStore.groupedAccountAssetsModel, "tokensKey", stickerPackDetailsPopup.store.stickersStore.getStatusTokenKey()) const token = SQUtils.ModelUtils.getByKey(stickerPackDetailsPopup.walletAssetsStore.groupedAccountAssetsModel, "tokensKey", stickerPackDetailsPopup.store.stickersStore.getStatusTokenKey())
Global.openSendModal(Constants.SendType.StickersBuy, //sendType
stickerPackDetailsPopup.sendModalPopup.interactive = false "", //senderAddress
stickerPackDetailsPopup.sendModalPopup.preSelectedRecipient = stickerPackDetailsPopup.store.stickersStore.getStickersMarketAddress() !!token && !!token.symbol ? token.symbol : "", //tokenId
stickerPackDetailsPopup.sendModalPopup.preSelectedRecipientType = Helpers.RecipientAddressObjectType.Address Constants.TokenType.ERC20, //tokenType
stickerPackDetailsPopup.sendModalPopup.preSelectedHoldingID = !!token && !!token.symbol ? token.symbol : "" LocaleUtils.numberToLocaleString(parseFloat(stickerPackDetailsPopup.price)), //tokenAmount
stickerPackDetailsPopup.sendModalPopup.preSelectedHoldingType = Constants.TokenType.ERC20 stickerPackDetailsPopup.store.appNetworkId, //chainId
stickerPackDetailsPopup.sendModalPopup.preSelectedSendType = Constants.SendType.StickersBuy stickerPackDetailsPopup.store.stickersStore.getStickersMarketAddress(), //recipientAddress
stickerPackDetailsPopup.sendModalPopup.preDefinedAmountToSend = LocaleUtils.numberToLocaleString(parseFloat(stickerPackDetailsPopup.price)) Helpers.RecipientAddressObjectType.Address, //recipientType
stickerPackDetailsPopup.sendModalPopup.preSelectedChainId = stickerPackDetailsPopup.store.appNetworkId false, //onlyAssets
stickerPackDetailsPopup.sendModalPopup.stickersPackId = stickerPackDetailsPopup.packId false, //interactive
stickerPackDetailsPopup.sendModalPopup.open() "", //publicKey
"", //ensName
stickerPackDetailsPopup.packId, //stickersPackId
)
stickerPackDetailsPopup.buyClicked(stickerPackDetailsPopup.packId) stickerPackDetailsPopup.buyClicked(stickerPackDetailsPopup.packId)
} }

View File

@ -20,7 +20,6 @@ Popup {
property ChatStores.RootStore store property ChatStores.RootStore store
required property WalletAssetsStore walletAssetsStore required property WalletAssetsStore walletAssetsStore
required property var sendModalPopup
property alias isWalletEnabled: stickerMarket.isWalletEnabled property alias isWalletEnabled: stickerMarket.isWalletEnabled
@ -103,7 +102,6 @@ Popup {
Layout.fillHeight: true Layout.fillHeight: true
store: root.store store: root.store
walletAssetsStore: root.walletAssetsStore walletAssetsStore: root.walletAssetsStore
sendModalPopup: root.sendModalPopup
stickerPacks: d.stickerPackList stickerPacks: d.stickerPackList
packId: stickerPackListView.selectedPackId packId: stickerPackListView.selectedPackId
marketVisible: d.stickerPacksLoaded && d.online marketVisible: d.stickerPacksLoaded && d.online

View File

@ -37,7 +37,6 @@ ColumnLayout {
property CurrenciesStore currencyStore property CurrenciesStore currencyStore
property bool showAllAccounts: false property bool showAllAccounts: false
property bool displayValues: true property bool displayValues: true
property var sendModal
property bool filterVisible property bool filterVisible
property bool disableShadowOnScroll: false property bool disableShadowOnScroll: false
property bool hideVerticalScrollbar: false property bool hideVerticalScrollbar: false
@ -359,24 +358,27 @@ ColumnLayout {
let asset = root.walletRootStore.getAssetForSendTx(tx) let asset = root.walletRootStore.getAssetForSendTx(tx)
const req = Helpers.lookupAddressesForSendModal(root.walletRootStore.accounts, const req = Helpers.lookupAddressesForSendModal(root.walletRootStore.accounts,
root.walletRootStore.savedAddresses, root.walletRootStore.savedAddresses,
tx.sender, tx.sender,
tx.recipient, tx.recipient,
asset, asset,
tx.isNFT, tx.isNFT,
tx.amount, tx.amount,
tx.chainId) tx.chainId)
Global.openSendModal(req.preSelectedSendType, //sendType
root.sendModal.preSelectedAccountAddress = req.preSelectedAccount.address req.preSelectedAccount.address, //senderAddress
root.sendModal.preSelectedRecipient = req.preSelectedRecipient req.preSelectedHoldingID, //tokenId
root.sendModal.preSelectedRecipientType = req.preSelectedRecipientType req.preSelectedHoldingType, //tokenType
root.sendModal.preSelectedHoldingID = req.preSelectedHoldingID req.preDefinedAmountToSend, //tokenAmount
root.sendModal.preSelectedHoldingType = req.preSelectedHoldingType req.preSelectedChainId, //chainId
root.sendModal.preSelectedSendType = req.preSelectedSendType req.preSelectedRecipient, //recipientAddress
root.sendModal.preDefinedAmountToSend = req.preDefinedAmountToSend req.preSelectedRecipientType, //recipientType
root.sendModal.preSelectedChainId = req.preSelectedChainId false, //onlyAssets
root.sendModal.onlyAssets = false true, //interactive
root.sendModal.open() "", //publicKey
"", //ensName
"", //stickersPackId
)
} }
} }
StatusSuccessAction { StatusSuccessAction {

View File

@ -10,6 +10,7 @@ import shared.popups 1.0
import shared.views.chat 1.0 import shared.views.chat 1.0
import shared.controls.chat 1.0 import shared.controls.chat 1.0
import shared.stores 1.0 as SharedStores import shared.stores 1.0 as SharedStores
import shared.popups.send 1.0
import StatusQ 0.1 import StatusQ 0.1
import StatusQ.Core 0.1 import StatusQ.Core 0.1
@ -745,7 +746,20 @@ Loader {
onLinkActivated: { onLinkActivated: {
if (link.startsWith(Constants.sendViaChatPrefix)) { if (link.startsWith(Constants.sendViaChatPrefix)) {
const addressOrEns = link.replace(Constants.sendViaChatPrefix, ""); const addressOrEns = link.replace(Constants.sendViaChatPrefix, "");
Global.openSendModal(addressOrEns) Global.openSendModal(Constants.SendType.Transfer, //sendType
"", //senderAddress
"", //tokenId
Constants.TokenType.Unknown, //tokenType
"", //tokenAmount
0, //chainId
addressOrEns, //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
return return
} }
if (link.startsWith('//')) { if (link.startsWith('//')) {

View File

@ -9,6 +9,7 @@ import StatusQ.Core.Utils 0.1 as StatusQUtils
import StatusQ.Popups 0.1 import StatusQ.Popups 0.1
import shared.controls.delegates 1.0 import shared.controls.delegates 1.0
import shared.popups.send 1.0
import utils 1.0 import utils 1.0
import AppLayouts.Wallet.stores 1.0 as WalletStores import AppLayouts.Wallet.stores 1.0 as WalletStores
@ -68,9 +69,20 @@ Item {
icon.name: "send" icon.name: "send"
icon.color: !hovered ? Theme.palette.baseColor1 : Theme.palette.directColor1 icon.color: !hovered ? Theme.palette.baseColor1 : Theme.palette.directColor1
enabled: root.sendToAccountEnabled enabled: root.sendToAccountEnabled
onClicked: { onClicked: Global.openSendModal(Constants.SendType.Transfer, //sendType
Global.openSendModal(model.address) "", //senderAddress
} "", //tokenId
Constants.TokenType.Unknown, //tokenType
"", //tokenAmount
0, //chainId
model.address, //recipientAddress
Helpers.RecipientAddressObjectType.Address, //recipientType
false, //onlyAssets
true, //interactive
"", //publicKey
"", //ensName
"", //stickersPackId
)
onHoveredChanged: accountInfoDelegate.highlight = hovered onHoveredChanged: accountInfoDelegate.highlight = hovered
} }
StatusFlatRoundButton { StatusFlatRoundButton {

View File

@ -50,8 +50,7 @@ QtObject {
signal openTransferOwnershipPopup(string communityId, signal openTransferOwnershipPopup(string communityId,
string communityName, string communityName,
string communityLogo, string communityLogo,
var token, var token)
var sendModalPopup)
signal openFinaliseOwnershipPopup(string communityId) signal openFinaliseOwnershipPopup(string communityId)
signal openDeclineOwnershipPopup(string communityId, string communityName) signal openDeclineOwnershipPopup(string communityId, string communityName)
signal openFirstTokenReceivedPopup(string communityId, signal openFirstTokenReceivedPopup(string communityId,
@ -72,7 +71,13 @@ QtObject {
signal setNthEnabledSectionActive(int nthSection) signal setNthEnabledSectionActive(int nthSection)
signal appSectionBySectionTypeChanged(int sectionType, int subsection, int subSubsection, var data) signal appSectionBySectionTypeChanged(int sectionType, int subsection, int subSubsection, var data)
signal openSendModal(string address) signal openSendModal(int sendType, string senderAddress,
string tokenId, int tokenType,
string tokenAmount, int chainId,
string recipientAddress, int recipientType,
bool onlyAssets, bool interactive,
string publicKey, string ensName,
string stickersPackId)
signal switchToCommunity(string communityId) signal switchToCommunity(string communityId)
signal switchToCommunitySettings(string communityId) signal switchToCommunitySettings(string communityId)
signal switchToCommunityChannelsView(string communityId) signal switchToCommunityChannelsView(string communityId)