Skip to content

Commit

Permalink
Syndote: fixes x entryFee format
Browse files Browse the repository at this point in the history
  • Loading branch information
Yauheni committed Mar 24, 2024
1 parent d7a0594 commit 70803db
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions frontend/apps/syndote/src/pages/home/session-info/SessionInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { useAccount, useAccountDeriveBalancesAll, useAlert, useApi, useBalanceFormat } from '@gear-js/react-hooks';
import {
useAccount,
useAccountDeriveBalancesAll,
useAlert,
useApi,
useBalanceFormat,
withoutCommas,
} from '@gear-js/react-hooks';
import { Button } from '@gear-js/vara-ui';
import { Players } from 'types';
import { useSyndoteMessage } from 'hooks/metadata';
Expand All @@ -25,7 +32,7 @@ function SessionInfo({ entryFee, players, adminId }: Props) {
const { account } = useAccount();
const alert = useAlert();
const { isMeta, sendMessage } = useSyndoteMessage();
const { getFormattedBalance } = useBalanceFormat();
const { getFormattedBalance, getFormattedBalanceValue } = useBalanceFormat();
const balances = useAccountDeriveBalancesAll();
const balance =
isApiReady && balances?.freeBalance ? getFormattedBalance(balances.freeBalance.toString()) : undefined;
Expand All @@ -41,7 +48,7 @@ function SessionInfo({ entryFee, players, adminId }: Props) {
name: 'Entry fee',
value: (
<>
{VaraSvg} {entryFee || 0} VARA
{VaraSvg} {entryFee ? getFormattedBalanceValue(Number(withoutCommas(entryFee))).toFixed() : 0} VARA
</>
),
},
Expand Down

0 comments on commit 70803db

Please sign in to comment.