-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add available balance display to transfer balance form
- Loading branch information
1 parent
c5a4afd
commit daa9251
Showing
7 changed files
with
70 additions
and
23 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
idea/frontend/src/features/balance/ui/balance/balance.module.scss
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,10 @@ | ||
.value { | ||
font-family: Kanit; | ||
font-weight: 600; | ||
} | ||
|
||
.unit { | ||
font-family: Kanit; | ||
font-weight: 300; | ||
color: rgba(255, 255, 255, 0.7); | ||
} |
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,26 @@ | ||
import { useBalanceFormat } from '@gear-js/react-hooks'; | ||
import { Balance as BalanceType } from '@polkadot/types/interfaces'; | ||
|
||
import styles from './balance.module.scss'; | ||
|
||
type Props = { | ||
value: BalanceType | undefined; | ||
}; | ||
|
||
function Balance({ value }: Props) { | ||
const { getFormattedBalance } = useBalanceFormat(); | ||
|
||
if (!value) return null; | ||
|
||
const balance = getFormattedBalance(value); | ||
|
||
return ( | ||
<p> | ||
<span className={styles.value}>{balance.value}</span> | ||
| ||
<span className={styles.unit}>{balance.unit}</span> | ||
</p> | ||
); | ||
} | ||
|
||
export { Balance }; |
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,3 @@ | ||
import { Balance } from './balance'; | ||
|
||
export { Balance }; |
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
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
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
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