diff --git a/src/app/pages/ConsensusDashboardPage/LatestConsensusTransactions.tsx b/src/app/pages/ConsensusDashboardPage/LatestConsensusTransactions.tsx index 79ace305d..11d80e482 100644 --- a/src/app/pages/ConsensusDashboardPage/LatestConsensusTransactions.tsx +++ b/src/app/pages/ConsensusDashboardPage/LatestConsensusTransactions.tsx @@ -8,16 +8,31 @@ import Link from '@mui/material/Link' import { useGetConsensusTransactions } from '../../../oasis-nexus/api' import { SearchScope } from '../../../types/searchScope' import { ConsensusTransactions } from '../../components/Transactions' -import { NUMBER_OF_ITEMS_ON_DASHBOARD as limit } from '../../config' +import { NUMBER_OF_ITEMS_ON_DASHBOARD as limit, FILTERING_ON_DASHBOARD as shouldFilter } from '../../config' import { RouteUtils } from '../../utils/route-utils' +import { + getConsensusTransactionMethodFilteringParam, + WantedConsensusTxMethod, +} from '../../components/ConsensusTransactionMethod' +import Box from '@mui/material/Box' +import { ConsensusTransactionTypeFilter } from '../../components/Transactions/ConsensusTransactionTypeFilter' +import { useScreenSize } from '../../hooks/useScreensize' -export const LatestConsensusTransactions: FC<{ scope: SearchScope }> = ({ scope }) => { +export const LatestConsensusTransactions: FC<{ + scope: SearchScope + method: WantedConsensusTxMethod + setMethod: (value: WantedConsensusTxMethod) => void +}> = ({ scope, method, setMethod }) => { + const { isMobile } = useScreenSize() const { t } = useTranslation() const { network } = scope const transactionsQuery = useGetConsensusTransactions( network, - { limit }, + { + ...getConsensusTransactionMethodFilteringParam(method), + limit, + }, { query: { cacheTime: 0, @@ -32,11 +47,25 @@ export const LatestConsensusTransactions: FC<{ scope: SearchScope }> = ({ scope component="h3" title={t('transactions.latest')} action={ - - {t('common.viewAll')} - + + {shouldFilter && !isMobile && ( + + )} + + {t('common.viewAll')} + + } /> + {shouldFilter && isMobile && ( + + )} { const { isMobile } = useScreenSize() const scope = useRequiredScopeParam() const isLocal = isLocalnet(scope.network) + const [method, setMethod] = useTypedSearchParam('tx_method', 'all') return ( @@ -39,7 +42,7 @@ export const ConsensusDashboardPage: FC = () => { {!isLocal && } - + {!isLocal && ( <>