diff --git a/apps/web-neutron/src/screens/validator_details/components/blocks/hooks.ts b/apps/web-neutron/src/screens/validator_details/components/blocks/hooks.ts deleted file mode 100644 index 88db99c252..0000000000 --- a/apps/web-neutron/src/screens/validator_details/components/blocks/hooks.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { useRouter } from 'next/router'; -import { useState } from 'react'; -import { - LastHundredBlocksSubscription, - useLastHundredBlocksSubscription, -} from '@/graphql/types/provider_types'; - -const formatLastHundredBlocks = (data: LastHundredBlocksSubscription) => - data.block.map((x) => ({ - height: x.height, - txs: x.transactions.length, - proposer: x.ccv_validator?.validator?.validatorInfo?.operatorAddress ?? '', - signed: x.precommits.length === 1, - })); - -type BlocksState = { - height: number; - txs: number; - proposer: string; - signed: boolean; -}[]; - -export const useBlocks = (address?: string) => { - const [state, setState] = useState([]); - - const router = useRouter(); - - const { loading } = useLastHundredBlocksSubscription({ - variables: { - address: address ?? (router?.query?.address as string) ?? '', - }, - onData: (data) => { - if (!data.data.data) return; - setState(formatLastHundredBlocks(data.data.data)); - }, - }); - - return { - state, - loading, - }; -}; diff --git a/apps/web-neutron/src/screens/validator_details/components/blocks/index.tsx b/apps/web-neutron/src/screens/validator_details/components/blocks/index.tsx new file mode 100644 index 0000000000..71cf6ed37d --- /dev/null +++ b/apps/web-neutron/src/screens/validator_details/components/blocks/index.tsx @@ -0,0 +1,19 @@ +import Typography from '@mui/material/Typography'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import Box from '@/components/box'; +import useStyles from '@/screens/validator_details/components/blocks/styles'; + +const Blocks = ({ className }) => { + const { t } = useAppTranslation('validators'); + const { classes, cx } = useStyles(); + return ( + + {t('lastBlocks')} +
+ {t('comingSoon')} +
+
+ ); +}; + +export default Blocks; diff --git a/apps/web-neutron/src/screens/validator_details/components/blocks/styles.ts b/apps/web-neutron/src/screens/validator_details/components/blocks/styles.ts new file mode 100644 index 0000000000..8c0b6fe457 --- /dev/null +++ b/apps/web-neutron/src/screens/validator_details/components/blocks/styles.ts @@ -0,0 +1,21 @@ +import { makeStyles } from 'tss-react/mui'; + +const useStyles = makeStyles()(theme => ({ + root: { + '& .MuiTypography-h2': { + marginBottom: theme.spacing(2), + }, + }, + content: { + flex: 1, + display: 'flex', + alignItems: 'center', + justifyContent: 'space-around', + color: theme.palette.custom.fonts.fontThree, + backgroundColor: theme.palette.custom.general.surfaceTwo, + borderRadius: '8px', + height: '22vh', + }, +})); + +export default useStyles; diff --git a/packages/ui/public/locales/en/web_neutron.json b/packages/ui/public/locales/en/web_neutron.json index bb1e151003..ab85a0eda0 100644 --- a/packages/ui/public/locales/en/web_neutron.json +++ b/packages/ui/public/locales/en/web_neutron.json @@ -7,5 +7,6 @@ "params.transferTimeoutPeriod": "Transfer Timeout Period", "params.consumerRedistributionFraction": "Consumer Redistribution Fraction", "params.blocksPerDistributionTransmission": "Blocks Per Distribution Transmission", - "validators.stakingDataIsSourcedFromCosmoshub": "The staking data is sourced from Cosmos Hub, as Neutron is a consumer chain." + "validators.stakingDataIsSourcedFromCosmoshub": "The staking data is sourced from Cosmos Hub, as Neutron is a consumer chain.", + "validators.comingSoon": "Coming soon" } \ No newline at end of file