Skip to content

Show lens name instead of wallet address in conversation list when th… #119

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

Closed
wants to merge 3 commits into from

Conversation

BrianS111
Copy link
Contributor

Closes #114

@BrianS111
Copy link
Contributor Author

DEE4F06B-FC0B-4097-BBDB-0276265A0678_4_5005_c
Before pic

@BrianS111 BrianS111 marked this pull request as ready for review November 16, 2022 04:06
@BrianS111
Copy link
Contributor Author

BrianS111 commented Nov 16, 2022

28724135-5EEC-4AB6-B454-B162A9AD325A

After

I have a strange feeling this PR wont get accepted.. Seems like a simple fix to make everything work. Let me know if I went in the right direction or if you'd like a different solution. The priority is ENS > Lens > Wallet address

Copy link
Member

@killthebuddh4 killthebuddh4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was a misclick on my behalf, see this one instead #119 (review)

Copy link
Member

@killthebuddh4 killthebuddh4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The peerAddressDisplay prop is a manual override for what gets displayed so it shouldn't be removed
  • The responsiveName and useEnsName hooks should be removed in favor of the useRelayId hook (We don't need to use all 3, we can just use the 1).
  • The logic for deciding what to show should be straightforward: "if we have an ENS name show that, if we have a Lens name, show that, otherwise show the address"

@BrianS111
Copy link
Contributor Author

  • The peerAddressDisplay prop is a manual override for what gets displayed so it shouldn't be removed
  • The responsiveName and useEnsName hooks should be removed in favor of the useRelayId hook (We don't need to use all 3, we can just use the 1).
  • The logic for deciding what to show should be straightforward: "if we have an ENS name show that, if we have a Lens name, show that, otherwise show the address"

useRelayId doesn't truncate anything and all 3 forms (ens, lens, address) need to be truncated 3 different ways, so I'm assuming I'll import truncateName, truncateAddress and write a new function for truncate lens and use those along with useRelayId and everything should work that way along with what you mentioned above. Does that sound about right? @killthebuddh4

@killthebuddh4
Copy link
Member

useRelayId doesn't truncate anything and all 3 forms (ens, lens, address) need to be truncated 3 different ways, so I'm assuming I'll import truncateName, truncateAddress and write a new function for truncate lens and use those along with useRelayId and everything should work that way along with what you mentioned above. Does that sound about right? @killthebuddh4

Yep that sounds about right.

@BrianS111
Copy link
Contributor Author

BrianS111 commented Nov 16, 2022

The code has been updated @killthebuddh4 Let me know if this works. It seems to be everything we discussed. I slightly adjusted the ens function in the address.ts so when it's truncated there are 3 dots instead of 4.

The output is the same as the screenshot I posted above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If address has Lens but no ENS, show the Lens in the conversation list instead of 0xaddress
2 participants