Skip to content

Conversation

@ebma
Copy link
Member

@ebma ebma commented Oct 6, 2020

Group all components related to showing a public key or address under a new <Address> component which conditionally renders the best component based on props.

Closes #277.


// tslint:disable-next-line no-shadowed-variable
export const Address = React.memo(function Address(props: AddressProps) {
const BasicAddress = React.memo(function BasicAddress(props: BasicAddressProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The name BasicAddress isn't great as it raises more questions than it answers. Tricky to find a better one, but how about AddressContent?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree that the name is bad. AddressContent sounds reasonable 👍

return (
<>
<PublicKey publicKey={props.publicKeys[0]} testnet={props.testnet} variant="short" />{" "}
<Address address={props.publicKeys[0]} testnet={props.testnet} />{" "}
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we still need to keep the variant="short"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to set variant to "short" by default because we almost always use "short" anyways.

@andywer
Copy link
Contributor

andywer commented Apr 7, 2021

@ebma This PR wants to be rebased 😉

@ebma ebma force-pushed the feature/277-merge-accountname-and-publickey branch from 6d870c2 to bf9cbb0 Compare April 7, 2021 14:30
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.

Merge <AccountName> and <PublicKey>

3 participants