-
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.
Extend transaction method filtering to consensus and validators
- Loading branch information
Showing
15 changed files
with
185 additions
and
42 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 |
---|---|---|
@@ -1 +1 @@ | ||
Add support for filtering latest TX list for method type | ||
Add support for filtering transactions by method type |
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
41 changes: 41 additions & 0 deletions
41
src/app/components/Transactions/ConsensusTransactionTypeFilter.tsx
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,41 @@ | ||
import { FC } from 'react' | ||
import { getConsensusTxMethodOptions, WantedConsensusTxMethod } from '../ConsensusTransactionMethod' | ||
import { useTranslation } from 'react-i18next' | ||
import { Select } from '../Select' | ||
import Typography from '@mui/material/Typography' | ||
|
||
const FilterLabel: FC = () => { | ||
const { t } = useTranslation() | ||
return ( | ||
<Typography | ||
component={'span'} | ||
sx={{ | ||
fontStyle: 'normal', | ||
fontWeight: 700, | ||
fontSize: 16, | ||
lineHeight: '150%', | ||
marginRight: 4, | ||
}} | ||
> | ||
{t('transactions.filterByType')} | ||
</Typography> | ||
) | ||
} | ||
|
||
export const ConsensusTransactionTypeFilter: FC<{ | ||
value: WantedConsensusTxMethod | ||
setValue: (value: WantedConsensusTxMethod) => void | ||
expand?: boolean | ||
}> = ({ value, setValue, expand }) => { | ||
const { t } = useTranslation() | ||
return ( | ||
<Select | ||
className={expand ? 'expand' : undefined} | ||
light={true} | ||
label={<FilterLabel />} | ||
options={[{ value: 'all', label: 'All' }, ...getConsensusTxMethodOptions(t)]} | ||
defaultValue={value} | ||
handleChange={setValue as any} | ||
/> | ||
) | ||
} |
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
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
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
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { useOutletContext } from 'react-router-dom' | ||
import { SearchScope } from '../../../types/searchScope' | ||
import { WantedConsensusTxMethod } from '../../components/ConsensusTransactionMethod' | ||
|
||
export type ConsensusAccountDetailsContext = { | ||
scope: SearchScope | ||
address: string | ||
method: WantedConsensusTxMethod | ||
setMethod: (value: WantedConsensusTxMethod) => void | ||
} | ||
|
||
export const useConsensusAccountDetailsProps = () => useOutletContext<ConsensusAccountDetailsContext>() |
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
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
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
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
Oops, something went wrong.