Related to T2407 & T2413. Received txs now display either the 1) Name if it is present or 2) the first five characters of the sender's address (minus the prefix).
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABCc12187959643: [Cashtab] Added received from address to txHistory display
cd web/cashtab && npm start
from the Tx History tab:
observe that all received Txs now show "From: [someone]" inline with the Received h3.
if no current Txs are from contacts, add one of the tx senders to your contacts,
from the Settings tab:
give tx sender's wallet a nickname and navigate back to tx history (may require hard refresh)
observe that the nickname now shows instead of the 5 digits from the replyAddress
from the settings tab:
delete a named contact and navigate back to TxHistory (may require hard refresh)
observe that the removed wallet now shows as the 5 character abbreviation
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- add-received-from-address
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 19334 Build 38406: Build Diff cashtab-tests Build 38405: arc lint + arc unit
Event Timeline
See Home.js
contactList is available directly from wallet context. If it is being used by Tx.js, it should be passed down to that component from this state field. It is not good practice to call it up from local storage in Tx.js ... which would be calling it up for every transaction displayed on the home page.
Best approach is probably to modify TxHistory.js to not flatten contactList and instead pass it directly to Tx.js, where it can be parsed.
I am thinking I will pass down the contactList, but leave the flattened array as it is easier to check the addressesInContactList array than to iterate through each contact object to access the addresses for some of the conditional formatting. Let me know what you think of this approach, if that isn't a good solution I can try out some other options.
Passed contactList as a prop through TxHistory, removed unnecessary code from Tx.js related to retrieving the contactList.
Seeing this, I think it only makes sense to display the info if the tx is from a contact. Otherwise "view on be.cash" is sufficient.
Also, I think just from {contactName} is best. No need for the :
e.g.
web/cashtab/src/components/Home/Tx.js | ||
---|---|---|
837 ↗ | (On Diff #33700) | We talked about a task to correct this namer typo elsewhere -- it can just be correct in this diff ;) |
- lowercase "from"
- only one "from" ... not all of these
web/cashtab/src/components/Home/Tx.js | ||
---|---|---|
454 ↗ | (On Diff #33866) | lowercase, i.e. from |
Added logic to handle cases where contactAddress !== dataAddress, and changed the key per review feedback.
web/cashtab/src/components/Home/Tx.js | ||
---|---|---|
449 ↗ | (On Diff #33902) | Use an else {} block for this |
web/cashtab/src/components/Home/Tx.js | ||
---|---|---|
454 ↗ | (On Diff #33918) | I did suggest the key={${data.txid}${result}} approach, but if you check the dev console you can see it doesn't work: Issue: if "result" is blank, then ${data.txid}${result} will be the same as data.txid So instead of using result, you will need to map (index, contact), and the key should be ${data.txid}${index} Check the dev console to make sure you aren't getting these errors. |