-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(But disable it for now, since we are lacking the required information)
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
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,44 @@ | ||
import { FC } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import Box from '@mui/material/Box' | ||
import Typography from '@mui/material/Typography' | ||
import { SnapshotCard } from '../../components/Snapshots/SnapshotCard' | ||
import { COLORS } from '../../../styles/theme/colors' | ||
import { useRequiredScopeParam } from '../../hooks/useScopeParam' | ||
import { useLoaderData } from 'react-router-dom' | ||
import { useAccount } from '../AccountDetailsPage/hook' | ||
|
||
export const TokenGasUsedCard: FC = () => { | ||
const { t } = useTranslation() | ||
const scope = useRequiredScopeParam() | ||
|
||
const address = useLoaderData() as string | ||
|
||
const { account, isFetched } = useAccount(scope, address) | ||
|
||
console.log('Account', account) | ||
|
||
return ( | ||
<SnapshotCard title={t('common.gasUsed')} withConstantHeight> | ||
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}> | ||
{isFetched && ( | ||
<> | ||
<Typography | ||
component="span" | ||
sx={{ | ||
fontSize: '48px', | ||
fontWeight: 700, | ||
color: COLORS.brandDark, | ||
}} | ||
> | ||
{ | ||
// TODO: return "gas used" here, when it becomes available | ||
account?.stats.num_txns | ||
} | ||
</Typography> | ||
</> | ||
)} | ||
</Box> | ||
</SnapshotCard> | ||
) | ||
} |
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