-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix/4379 member acount balance #4450
Fix/4379 member acount balance #4450
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
@chrlschwb
| [warn] src/common/components/BlockTime/BlockHistoryLine.tsx
| [warn] src/memberships/components/MemberProfile/MemberAccounts.tsx
| [warn] Code style issues found in 2 files. Forgot to run Prettier?
| yarn lint
failed with exit code 1
@thesan wrt storybook:
Error: No existing credentials found. Please run
vercel login
or pass "--token"
{!!member.rootAccount && ( | ||
<AccountMemberRow> | ||
<UnknownAccountInfo address={member.rootAccount} placeholderName="Root Account" /> | ||
<TokenValue value={rootBalance?.total} isLoading={!isDefined(rootBalance?.total)} /> |
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.
onClick={() => setSelectedWallet(wallet)} | ||
selected={selectedWallet?.extensionName === wallet.extensionName} | ||
/> | ||
<> |
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.
This fragment doesn't seem needed?
|
||
const AccountsDisplay = styled(RowGapBlock)` | ||
padding: 24px; | ||
` | ||
|
||
export const AccountMemberRow = styled.div` |
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.
Why do we need to duplicate this style? We can use AccountRow
as was imported before, and overwrite necessary CSS with styled(AccountRow)
{!!account && ( | ||
<AccountMemberRow> | ||
<UnknownAccountInfo address={account} placeholderName="Root Account" /> | ||
<TokenValue value={balance?.total} isLoading={!isDefined(balance?.total)} /> | ||
</AccountMemberRow> |
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.
This logic id duplicated 3 times: 1 one for root, 1 for controller and once in this component. I think we should adjust this component to be more generic and also use it for root and controller accounts
…379-MemberAcountBalance
Hi @chrlschwb my last comment wasn't resolved. What I was suggesting was to make export const MemberAccount = ({ account, name }: Props) => {
const balance = useBalance(account)
return (
<div>
{!!account && (
<AccountMemberRow>
<UnknownAccountInfo address={account} placeholderName={name} />
<TokenValue value={balance?.total} isLoading={!isDefined(balance?.total)} />
</AccountMemberRow>
)}
</div>
)
} Then you can use it for all accounts, like root: {!!member.rootAccount && (
<MemberAccount account={member.rootAccount} name="Root account" />
)} This way you can also move style next to this component, removing circular dependency between two files |
yeah, I understand. |
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.
Could you just update the MemberBounds
component and file name now that it's generic? Otherwise, LGTM
what do you think the name? |
what? |
I suggested |
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.
Nice work, it looks great 👍
Tested on https://pioneer-2.vercel.app/#/profile/memberships |
fix #4379