-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(wallet): Update recipient data in send sign modal #17164
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ QObject { | |
required property string tokenKey | ||
/** amount selected in send modal for sending **/ | ||
required property string selectedAmountInBaseUnit | ||
/** recipient address selected in send modal for sending **/ | ||
required property string selectedRecipientAddress | ||
/** | ||
Expected model structure: | ||
|
||
|
@@ -44,6 +46,18 @@ QObject { | |
**/ | ||
required property var tokenBySymbolModel | ||
|
||
/** | ||
Expected model structure: | ||
|
||
address [string] - address of recipient | ||
name [string] - name of recipient | ||
ens [string] - ens of recipient | ||
emoji [string] - emoji of recipient wallet | ||
color [string] - color of recipient wallet | ||
colorId [string] - colorId of recipient wallet | ||
**/ | ||
required property var recipientModel | ||
|
||
/** output property of the account selected **/ | ||
readonly property var selectedAccount: selectedAccountEntry.item | ||
/** output property of the network selected **/ | ||
|
@@ -67,6 +81,29 @@ QObject { | |
!!selectedAssetContractEntry.item ? | ||
selectedAssetContractEntry.item.address: "" | ||
|
||
/** output property of the selected recipient address **/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do these need to separate properties here? we can simple expose the item from here do the necessary logic in UI? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are passed as separate, because recipient can also be unknown address. In such case item would be empty. |
||
readonly property string recipientAddress: selectedRecipientEntry.available ? selectedRecipientEntry.item.address : selectedRecipientAddress | ||
/** output property of the selected recipient name **/ | ||
readonly property string recipientName: selectedRecipientEntry.available ? selectedRecipientEntry.item.name : "" | ||
/** output property of the selected recipient ens **/ | ||
readonly property string recipientEns: selectedRecipientEntry.available ? selectedRecipientEntry.item.ens : "" | ||
/** output property of the selected recipient emoji **/ | ||
readonly property string recipientEmoji: selectedRecipientEntry.available ? selectedRecipientEntry.item.emoji : "" | ||
/** output property of the selected recipient color **/ | ||
readonly property string recipientWalletColor: { | ||
if (!selectedRecipientEntry.available) | ||
return "" | ||
const color = selectedRecipientEntry.item.color | ||
if (!!color) { | ||
return color | ||
} | ||
const colorId = selectedRecipientEntry.item.colorId | ||
if (!!colorId) { | ||
return Utils.getColorForId(colorId) | ||
} | ||
return "" | ||
} | ||
|
||
ModelEntry { | ||
id: selectedAccountEntry | ||
sourceModel: root.accountsModel | ||
|
@@ -96,4 +133,11 @@ QObject { | |
value: root.chainId | ||
key: "chainId" | ||
} | ||
|
||
ModelEntry { | ||
id: selectedRecipientEntry | ||
sourceModel: root.recipientModel | ||
key: "address" | ||
value: root.selectedRecipientAddress | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import QtQuick 2.15 | ||
import QtQuick.Controls 2.15 | ||
import QtQuick.Layouts 1.15 | ||
|
||
import StatusQ.Core 0.1 | ||
import StatusQ.Core.Theme 0.1 | ||
|
||
import AppLayouts.Wallet.controls 1.0 | ||
|
||
import utils 1.0 | ||
|
||
ColumnLayout { | ||
id: root | ||
|
||
property string caption | ||
|
||
property alias components: delegate.components | ||
property alias highlighted: delegate.highlighted | ||
property int listItemHeight: 76 | ||
|
||
required property string address | ||
property string name | ||
property string ens | ||
property string emoji | ||
property string walletColor | ||
|
||
StatusBaseText { | ||
text: root.caption | ||
font.pixelSize: Theme.additionalTextSize | ||
} | ||
RecipientViewDelegate { | ||
id: delegate | ||
objectName: "recipientDelegate" | ||
|
||
Layout.fillWidth: true | ||
Layout.preferredHeight: root.listItemHeight | ||
|
||
address: root.address | ||
name: root.name | ||
ens: root.ens | ||
emoji: root.emoji | ||
walletColor: root.walletColor | ||
|
||
elideAddressInTitle: true | ||
useAddressAsLetterIdenticon: !root.name && !root.ens | ||
|
||
sensor.enabled: false | ||
|
||
statusListItemSubTitle.font.pixelSize: Theme.additionalTextSize | ||
statusListItemTitle.customColor: Theme.palette.directColor1 | ||
statusListItemTitle.font.pixelSize: Theme.additionalTextSize | ||
statusListItemTitle.elide: Text.ElideMiddle | ||
border.width: 1 | ||
border.color: Theme.palette.baseColor2 | ||
|
||
asset.bgWidth: 40 | ||
asset.bgHeight: 40 | ||
rightPadding: Theme.padding | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also in the delegate itself, should be an
int
, notstring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method that is always used together with it indicates it is string.
![image](https://private-user-images.githubusercontent.com/11396062/408848070-09a8534f-6d1f-40de-af14-f1a100ddf31e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNzExMDksIm5iZiI6MTczOTE3MDgwOSwicGF0aCI6Ii8xMTM5NjA2Mi80MDg4NDgwNzAtMDlhODUzNGYtNmQxZi00MGRlLWFmMTQtZjFhMTAwZGRmMzFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA3MDAwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwOGY3ZjIyMzhkZTcyODA5ODMzYTM1MDQ4MzUyMzFkZjllODA5YTliMThlNTk1ZDdkZjYxYmFmNjZhODFmNzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TiHXwqDs2ip6t8iYrqqWXAO9uqrljNKZ2gGop73EGuE)