-
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
13 changed files
with
143 additions
and
34 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 |
44 changes: 44 additions & 0 deletions
44
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,44 @@ | ||
import { FC } from 'react' | ||
import { getConsensusTxMethodOptions } from '../ConsensusTransactionMethod' | ||
import { useTranslation } from 'react-i18next' | ||
import { Select } from '../Select' | ||
import Typography from '@mui/material/Typography' | ||
import { ConsensusTxMethod } from 'oasis-nexus/api' | ||
|
||
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 type WantedConsensusTxMethod = ConsensusTxMethod | 'all' | ||
|
||
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/Transactions/ConsensusTransactionTypeFilter' | ||
|
||
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
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/Transactions/ConsensusTransactionTypeFilter' | ||
|
||
export type ValidatorDetailsContext = { | ||
scope: SearchScope | ||
address: string | ||
method: WantedConsensusTxMethod | ||
setMethod: (method: WantedConsensusTxMethod) => void | ||
} | ||
|
||
export const useValidatorDetailsProps = () => useOutletContext<ValidatorDetailsContext>() |
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