forked from Joystream/pioneer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix/4379 member acount balance (Joystream#4450)
* start dev * add account balance of membership * fix lint error * test * fixed finish * finish fixed * update fix error * update * update
- Loading branch information
Showing
2 changed files
with
56 additions
and
28 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packages/ui/src/memberships/components/MemberProfile/MemberAccount.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import { useBalance } from '@/accounts/hooks/useBalance' | ||
import { AccountRow } from '@/common/components/Modal' | ||
import { TokenValue } from '@/common/components/typography' | ||
import { isDefined } from '@/common/utils' | ||
|
||
import { UnknownAccountInfo } from '../../../accounts/components/UnknownAccountInfo' | ||
|
||
type Props = { | ||
account: string | ||
name: string | ||
} | ||
|
||
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> | ||
) | ||
} | ||
|
||
export const AccountMemberRow = styled(AccountRow)` | ||
grid-template-rows: 2fr; | ||
-webkit-box-align: center; | ||
-ms-flex-align: center; | ||
justify-items: end; | ||
padding: 8px 14px 8px 14px; | ||
` |
48 changes: 20 additions & 28 deletions
48
packages/ui/src/memberships/components/MemberProfile/MemberAccounts.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters