add amount
This commit is contained in:
rodič
5b05944887
revize
85e72ab2da
11
src/App.tsx
11
src/App.tsx
|
@ -91,6 +91,15 @@ export function App() {
|
|||
getBalanceData();
|
||||
}, [address]);
|
||||
|
||||
function getBtnText(network: string): import("react").ReactNode {
|
||||
const balanceVals = Object.values(balances);
|
||||
const filteredBalance = balanceVals.filter((b) => {
|
||||
return b.network==network;
|
||||
});
|
||||
//console.log(filteredBalance[0].quota.batch);
|
||||
return (`Get ${filteredBalance[0].quota.batch} Tokens`);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<section>
|
||||
|
@ -214,7 +223,7 @@ export function App() {
|
|||
>
|
||||
{isFetching == "tokens"
|
||||
? ("Sending Tokens...")
|
||||
: ("Get Tokens")}
|
||||
: (getBtnText(network))}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,6 +2,7 @@ export interface BalanceType {
|
|||
balance: number;
|
||||
network: string;
|
||||
quota: {
|
||||
batch: number;
|
||||
quota: number;
|
||||
used: number;
|
||||
};
|
||||
|
@ -9,7 +10,7 @@ export interface BalanceType {
|
|||
|
||||
export function Balance(props: BalanceType[]) {
|
||||
const nets = Object.values(props);
|
||||
console.log(nets);
|
||||
//console.log(nets);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
Načítá se…
Odkázat v novém úkolu