From c03189cc47b2c0b0bf7d5c8651268627a6ce0942 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 27 Jun 2024 11:30:37 +0200 Subject: [PATCH 1/9] Create generic FilterButtons component --- src/app/components/FilterButtons/index.tsx | 42 +++++++++++++++++++ .../components/Proposals/VoteTypeFilter.tsx | 37 ++-------------- 2 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 src/app/components/FilterButtons/index.tsx diff --git a/src/app/components/FilterButtons/index.tsx b/src/app/components/FilterButtons/index.tsx new file mode 100644 index 000000000..d9fa29f81 --- /dev/null +++ b/src/app/components/FilterButtons/index.tsx @@ -0,0 +1,42 @@ +import Box from '@mui/material/Box' +import Chip from '@mui/material/Chip' +import Typography from '@mui/material/Typography' +import { COLORS } from '../../../styles/theme/colors' + +type FilterButtonsProps = { + options: { label: string; value: T }[] + onSelect: (value: T) => void + value?: T +} + +export const FilterButtons = ({ options, onSelect, value }: FilterButtonsProps) => { + return ( + + {options.map(option => { + const selected = option.value === value + return ( + onSelect(option.value)} + clickable + color="secondary" + label={ + + + {option.label} + + + } + sx={{ + mr: 3, + borderColor: COLORS.brandMedium, + backgroundColor: selected ? COLORS.brandMedium : COLORS.brandMedium15, + color: selected ? COLORS.white : COLORS.grayExtraDark, + }} + variant={selected ? 'outlined-selected' : 'outlined'} + /> + ) + })} + + ) +} diff --git a/src/app/components/Proposals/VoteTypeFilter.tsx b/src/app/components/Proposals/VoteTypeFilter.tsx index f684f3090..5ac7c0b2a 100644 --- a/src/app/components/Proposals/VoteTypeFilter.tsx +++ b/src/app/components/Proposals/VoteTypeFilter.tsx @@ -1,17 +1,14 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' -import Box from '@mui/material/Box' -import Chip from '@mui/material/Chip' -import Typography from '@mui/material/Typography' -import { COLORS } from '../../../styles/theme/colors' import { ProposalVoteValue, VoteType } from '../../../types/vote' +import { FilterButtons } from '../FilterButtons' type VoteTypeFilterProps = { onSelect: (voteType: VoteType) => void value?: VoteType } -export const VoteTypeFilter: FC = ({ onSelect, value }) => { +export const VoteTypeFilter: FC = props => { const { t } = useTranslation() const options: { label: string; value: VoteType }[] = [ { @@ -32,33 +29,5 @@ export const VoteTypeFilter: FC = ({ onSelect, value }) => }, ] - return ( - - {options.map(option => { - const selected = option.value === value - return ( - onSelect(option.value)} - clickable - color="secondary" - label={ - - - {option.label} - - - } - sx={{ - mr: 3, - borderColor: COLORS.brandMedium, - backgroundColor: selected ? COLORS.brandMedium : COLORS.brandMedium15, - color: selected ? COLORS.white : COLORS.grayExtraDark, - }} - variant={selected ? 'outlined-selected' : 'outlined'} - /> - ) - })} - - ) + return } From e27105c259c8044bd0bf33483a30cbaadb1fc141 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 27 Jun 2024 11:41:45 +0200 Subject: [PATCH 2/9] Add filter buttons to Staking card --- .../ConsensusAccountDetailsPage/Staking.tsx | 29 ++++++++++--------- src/app/utils/externalLinks.ts | 1 - src/locales/en/translation.json | 4 +-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx index f222521c9..de8b19ece 100644 --- a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx +++ b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx @@ -1,42 +1,45 @@ -import { FC } from 'react' +import { FC, useState } from 'react' import { useTranslation } from 'react-i18next' import Card from '@mui/material/Card' import CardHeader from '@mui/material/CardHeader' import CardContent from '@mui/material/CardContent' import Link from '@mui/material/Link' import Skeleton from '@mui/material/Skeleton' -import { COLORS } from '../../../styles/theme/colors' import { Account, useGetConsensusAccountsAddressDelegations } from '../../../oasis-nexus/api' import { useRequiredScopeParam } from '../../../app/hooks/useScopeParam' import { AppErrors } from '../../../types/errors' import { NUMBER_OF_ITEMS_ON_DASHBOARD as PAGE_SIZE } from '../../config' import { useSearchParamsPagination } from '../../components/Table/useSearchParamsPagination' import { Delegations } from '../..//components/Delegations' -import { docs, wallet } from '../../utils/externalLinks' +import { wallet } from '../../utils/externalLinks' import { t } from 'i18next' import { ConsensusAccountCardEmptyState } from './ConsensusAccountCardEmptyState' +import { FilterButtons } from '../../components/FilterButtons' type StakingProps = { account: Account | undefined isLoading: boolean } +type DelegationStatus = 'active' | 'debonding' export const Staking: FC = ({ account, isLoading }) => { const { t } = useTranslation() + const [type, setType] = useState('active') + const options: { label: string; value: DelegationStatus }[] = [ + { + label: t('account.active'), + value: 'active', + }, + { + label: t('account.debonding'), + value: 'debonding', + }, + ] return ( - {t('validator.sharesDocs')} - - } + action={ setType(type)} />} disableTypography component="h3" title={t('common.staking')} diff --git a/src/app/utils/externalLinks.ts b/src/app/utils/externalLinks.ts index 64ced9e4d..182e65f3e 100644 --- a/src/app/utils/externalLinks.ts +++ b/src/app/utils/externalLinks.ts @@ -18,7 +18,6 @@ export const docs = { consensus: 'https://docs.oasis.io/core/consensus/', consensusTransactions: `https://docs.oasis.io/core/consensus/transactions/`, consensusServices: `https://docs.oasis.io/core/consensus/services/`, - consensusStaking: `https://docs.oasis.io/core/consensus/services/staking/`, consensusGenesis: `https://docs.oasis.io/core/consensus/genesis/`, consensusVectors: `https://docs.oasis.io/core/consensus/test-vectors/`, consensusComet: `https://docs.oasis.io/core/consensus/#cometbft`, diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 4fef6d85f..d704b553c 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -1,5 +1,6 @@ { "account": { + "active": "Active", "available": "Available", "balanceDistribution": "Balance Distribution", "cantLoadDetails": "Unfortunately we couldn't load the account details at this time. Please try again later.", @@ -672,8 +673,7 @@ "signedBlocksDescription": "Last 100 blocks", "proposedBlocks": "Proposed Blocks", "snapshot": "Validator Snapshot", - "sharesDocs": "How shares are calculated", - "staked": "Staked", + "shares": "Shares", "stakingTrend": "Staking Trend", "startDate": "Start Date", "title": "Validator", From eb214963d3f0bb1154660cae61ceb8aa196ee915 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 27 Jun 2024 11:47:27 +0200 Subject: [PATCH 3/9] Adjust active account active delegations to filter --- .../ConsensusAccountDetailsPage/Staking.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx index de8b19ece..b8e51c10d 100644 --- a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx +++ b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx @@ -46,22 +46,26 @@ export const Staking: FC = ({ account, isLoading }) => { /> {isLoading && } - {account && } + {account && type === 'active' && } + {account && type === 'debonding' && } ) } -type StakingContentProps = { +type DelegationCardProps = { address: string } -const StakingContent: FC = ({ address }) => { - const pagination = useSearchParamsPagination('page') +const ActiveDelegations: FC = ({ address }) => { + const pagination = useSearchParamsPagination('activeDelegations') const offset = (pagination.selectedPage - 1) * PAGE_SIZE const scope = useRequiredScopeParam() const { network } = scope - const delegationsQuery = useGetConsensusAccountsAddressDelegations(network, address) + const delegationsQuery = useGetConsensusAccountsAddressDelegations(network, address, { + limit: PAGE_SIZE, + offset, + }) const { isLoading, isFetched, data } = delegationsQuery if (isFetched && offset && !delegationsQuery.data?.data?.delegations?.length) { throw AppErrors.PageDoesNotExist @@ -97,3 +101,7 @@ const StakingContent: FC = ({ address }) => { ) } + +const DebondingDelegations: FC = ({ address }) => { + return null +} From 5cbee11de738600c6bc1d647211aeb2c77570bf0 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 27 Jun 2024 11:52:25 +0200 Subject: [PATCH 4/9] Add debonding delegations to Staking card --- .changelog/1461.trivial.md | 1 + src/app/components/Delegations/index.tsx | 5 +-- .../ConsensusAccountCardEmptyState.tsx | 2 +- .../ConsensusAccountDetailsPage/Staking.tsx | 44 ++++++++++++++++++- src/locales/en/translation.json | 3 +- src/oasis-nexus/api.ts | 30 +++++++++++++ 6 files changed, 78 insertions(+), 7 deletions(-) create mode 100644 .changelog/1461.trivial.md diff --git a/.changelog/1461.trivial.md b/.changelog/1461.trivial.md new file mode 100644 index 000000000..a84269c79 --- /dev/null +++ b/.changelog/1461.trivial.md @@ -0,0 +1 @@ +Add debonding delegations to Staking card diff --git a/src/app/components/Delegations/index.tsx b/src/app/components/Delegations/index.tsx index 8bfc674dc..d73a25bd4 100644 --- a/src/app/components/Delegations/index.tsx +++ b/src/app/components/Delegations/index.tsx @@ -56,12 +56,11 @@ export const Delegations: FC = ({ content: , key: 'shares', }, - ...(debonding + ...(debonding && 'debond_end' in delegation ? [ { align: TableCellAlign.Right, - // TODO: Add when API returns correct value and provides current epoch - content: <>-, + content: <>{delegation.debond_end}, key: 'debondingEnd', }, ] diff --git a/src/app/pages/ConsensusAccountDetailsPage/ConsensusAccountCardEmptyState.tsx b/src/app/pages/ConsensusAccountDetailsPage/ConsensusAccountCardEmptyState.tsx index 56a81bb3e..d8e5e92b7 100644 --- a/src/app/pages/ConsensusAccountDetailsPage/ConsensusAccountCardEmptyState.tsx +++ b/src/app/pages/ConsensusAccountDetailsPage/ConsensusAccountCardEmptyState.tsx @@ -36,7 +36,7 @@ export const ConsensusAccountCardEmptyState: FC = ({ address }) => { } const DebondingDelegations: FC = ({ address }) => { - return null + const pagination = useSearchParamsPagination('debondingDelegations') + const offset = (pagination.selectedPage - 1) * PAGE_SIZE + const scope = useRequiredScopeParam() + const { network } = scope + const delegationsQuery = useGetConsensusAccountsAddressDebondingDelegations(network, address, { + limit: PAGE_SIZE, + offset, + }) + const { isLoading, isFetched, data } = delegationsQuery + if (isFetched && offset && !delegationsQuery.data?.data?.debonding_delegations?.length) { + throw AppErrors.PageDoesNotExist + } + + if (isFetched && !delegationsQuery.data?.data.debonding_delegations.length) { + return + } + + return ( + <> + {isFetched && ( + + )} + + ) } diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index d704b553c..31dd9cf1d 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -15,6 +15,7 @@ "noTokens": "This account holds no tokens", "noBalances": "This account currently has no balances.", "notStaking": "This account is currently not staking.", + "notDebonding": "This account is currently not debonding.", "showMore": "+ {{counter}} more", "sizeTooltip": "This account is indicated as an {{size}} account based on sum of assets they own.", "startStaking": "Start staking now", @@ -655,7 +656,7 @@ "commissionBounds": "Commission Bounds", "commissionRates": "Commission Rates", "cumulativeVoting": "Cumulative Voting %", - "debondingEnd": "End of debonding", + "debondingEnd": "Unlock Epoch", "delegators": "Delegators", "emptyDebondingList": "No one is debonding delegations from this validator.", "emptyDelegationsList": "No one is delegating to this validator.", diff --git a/src/oasis-nexus/api.ts b/src/oasis-nexus/api.ts index eadeda31f..496ede7d4 100644 --- a/src/oasis-nexus/api.ts +++ b/src/oasis-nexus/api.ts @@ -1083,6 +1083,36 @@ export const useGetConsensusAccountsAddressDelegations: typeof generated.useGetC }) } +export const useGetConsensusAccountsAddressDebondingDelegations: typeof generated.useGetConsensusAccountsAddressDebondingDelegations = + (network, address, params?, options?) => { + const ticker = getTokensForScope({ network, layer: Layer.consensus })[0].ticker + return generated.useGetConsensusAccountsAddressDebondingDelegations(network, address, params, { + ...options, + request: { + ...options?.request, + transformResponse: [ + ...arrayify(axios.defaults.transformResponse), + (data: generated.DebondingDelegationList, headers, status) => { + if (status !== 200) return data + return { + ...data, + debonding_delegations: data.debonding_delegations.map(delegation => { + return { + ...delegation, + amount: fromBaseUnits(delegation.amount, consensusDecimals), + layer: Layer.consensus, + network, + ticker, + } + }), + } + }, + ...arrayify(options?.request?.transformResponse), + ], + }, + }) + } + export const useGetConsensusAccountsAddressDebondingDelegationsTo: typeof generated.useGetConsensusAccountsAddressDebondingDelegationsTo = (network, address, params?, options?) => { const ticker = getTokensForScope({ network, layer: Layer.consensus })[0].ticker From 8c39de26ce182df890d855f3f26125a177429df6 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 27 Jun 2024 15:47:03 +0200 Subject: [PATCH 5/9] Adjust column header in Staking card --- src/app/components/Delegations/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/Delegations/index.tsx b/src/app/components/Delegations/index.tsx index d73a25bd4..e7afa813d 100644 --- a/src/app/components/Delegations/index.tsx +++ b/src/app/components/Delegations/index.tsx @@ -27,7 +27,7 @@ export const Delegations: FC = ({ const { t } = useTranslation() const tableColumns: TableColProps[] = [ - { key: 'delegator', content: t('common.address') }, + { key: 'delegator', content: linkType === 'validator' ? t('validator.title') : t('common.address') }, { key: 'amount', content: t('validator.amount'), align: TableCellAlign.Right }, { key: 'shares', content: t('common.shares'), align: TableCellAlign.Right }, ...(debonding From 3536d777562b8d35da17666bc8ab8cec1b6ccb3c Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 27 Jun 2024 16:31:56 +0200 Subject: [PATCH 6/9] Fix issue with duplicated key in debonding --- src/app/components/Delegations/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/components/Delegations/index.tsx b/src/app/components/Delegations/index.tsx index e7afa813d..f27507010 100644 --- a/src/app/components/Delegations/index.tsx +++ b/src/app/components/Delegations/index.tsx @@ -35,7 +35,10 @@ export const Delegations: FC = ({ : []), ] const tableRows = delegations?.map(delegation => ({ - key: linkType === 'validator' ? delegation.validator : delegation.delegator, + key: + linkType === 'validator' + ? `${delegation.validator}${'debond_end' in delegation && delegation.debond_end}` + : delegation.delegator, data: [ { content: From 11bde43b62ee58636f0083a4643b1c114206ccd2 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 27 Jun 2024 18:06:43 +0200 Subject: [PATCH 7/9] Change delegations naming in account details --- .../Account/ConsensusAccountDetailsView.tsx | 2 +- src/app/components/Delegations/index.tsx | 2 +- .../BalanceDistribution.tsx | 2 +- .../pages/ConsensusAccountDetailsPage/Staking.tsx | 14 +++++++------- src/locales/en/translation.json | 2 ++ 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app/components/Account/ConsensusAccountDetailsView.tsx b/src/app/components/Account/ConsensusAccountDetailsView.tsx index a07c9ea32..6b662717c 100644 --- a/src/app/components/Account/ConsensusAccountDetailsView.tsx +++ b/src/app/components/Account/ConsensusAccountDetailsView.tsx @@ -83,7 +83,7 @@ export const ConsensusAccountDetailsView: FC = ticker: account.ticker, })} - {t('common.staking')} + {t('common.staked')}
{t('common.valueInToken', { ...getPreciseNumberFormat(account.delegations_balance!), diff --git a/src/app/components/Delegations/index.tsx b/src/app/components/Delegations/index.tsx index f27507010..14c5729e9 100644 --- a/src/app/components/Delegations/index.tsx +++ b/src/app/components/Delegations/index.tsx @@ -51,7 +51,7 @@ export const Delegations: FC = ({ }, { align: TableCellAlign.Right, - content: , + content: , key: 'amount', }, { diff --git a/src/app/pages/ConsensusAccountDetailsPage/BalanceDistribution.tsx b/src/app/pages/ConsensusAccountDetailsPage/BalanceDistribution.tsx index 65accef34..fe449c1c2 100644 --- a/src/app/pages/ConsensusAccountDetailsPage/BalanceDistribution.tsx +++ b/src/app/pages/ConsensusAccountDetailsPage/BalanceDistribution.tsx @@ -59,7 +59,7 @@ const BalanceDistributionContent: FC = ({ accou value: Number(account.available), }, { - label: t('common.staking'), + label: t('common.staked'), value: Number(account.delegations_balance), }, { diff --git a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx index 33b90caf7..8001b249d 100644 --- a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx +++ b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx @@ -24,18 +24,18 @@ type StakingProps = { account: Account | undefined isLoading: boolean } -type DelegationStatus = 'active' | 'debonding' +type DelegationStatus = 'staked' | 'debonding' export const Staking: FC = ({ account, isLoading }) => { const { t } = useTranslation() - const [type, setType] = useState('active') + const [type, setType] = useState('staked') const options: { label: string; value: DelegationStatus }[] = [ { - label: t('account.active'), - value: 'active', + label: t('common.staked'), + value: 'staked', }, { - label: t('account.debonding'), + label: t('common.debonding'), value: 'debonding', }, ] @@ -46,11 +46,11 @@ export const Staking: FC = ({ account, isLoading }) => { action={ setType(type)} />} disableTypography component="h3" - title={t('common.staking')} + title={t('validator.delegations')} /> {isLoading && } - {account && type === 'active' && } + {account && type === 'staked' && } {account && type === 'debonding' && } diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 31dd9cf1d..2007e7823 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -72,6 +72,7 @@ "consensusOutOfDate": "Consensus out of date", "copy": "Copy", "data": "Data", + "debonding": "Debonding", "emerald": "Emerald", "epoch": "Epoch", "cipher": "Cipher", @@ -657,6 +658,7 @@ "commissionRates": "Commission Rates", "cumulativeVoting": "Cumulative Voting %", "debondingEnd": "Unlock Epoch", + "delegations": "Delegations", "delegators": "Delegators", "emptyDebondingList": "No one is debonding delegations from this validator.", "emptyDelegationsList": "No one is delegating to this validator.", From 048f29be2df8a36f9e234bea539df5cba834fae7 Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 17 Jul 2024 11:34:52 +0200 Subject: [PATCH 8/9] Split validator and delegator logic in Delegations --- src/app/components/Delegations/index.tsx | 21 ++++---- src/app/components/Table/index.tsx | 64 ++++++++++++++---------- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/src/app/components/Delegations/index.tsx b/src/app/components/Delegations/index.tsx index 14c5729e9..6953feecb 100644 --- a/src/app/components/Delegations/index.tsx +++ b/src/app/components/Delegations/index.tsx @@ -27,7 +27,8 @@ export const Delegations: FC = ({ const { t } = useTranslation() const tableColumns: TableColProps[] = [ - { key: 'delegator', content: linkType === 'validator' ? t('validator.title') : t('common.address') }, + { key: 'delegator', content: t('common.address'), hide: linkType === 'validator' }, + { key: 'validator', content: t('validator.title'), hide: linkType !== 'validator' }, { key: 'amount', content: t('validator.amount'), align: TableCellAlign.Right }, { key: 'shares', content: t('common.shares'), align: TableCellAlign.Right }, ...(debonding @@ -35,20 +36,18 @@ export const Delegations: FC = ({ : []), ] const tableRows = delegations?.map(delegation => ({ - key: - linkType === 'validator' - ? `${delegation.validator}${'debond_end' in delegation && delegation.debond_end}` - : delegation.delegator, + key: `${delegation.delegator}${delegation.validator}${debonding ? 'debond_end' in delegation && delegation.debond_end : ''}`, data: [ { - content: - linkType === 'validator' ? ( - - ) : ( - - ), + content: , + hide: linkType === 'validator', key: 'delegator', }, + { + content: , + hide: linkType !== 'validator', + key: 'validator', + }, { align: TableCellAlign.Right, content: , diff --git a/src/app/components/Table/index.tsx b/src/app/components/Table/index.tsx index b54309d70..0f62430bd 100644 --- a/src/app/components/Table/index.tsx +++ b/src/app/components/Table/index.tsx @@ -51,6 +51,7 @@ export enum TableCellAlign { type TableCellProps = { align?: TableCellAlign content: ReactNode + hide?: boolean key: string } @@ -61,9 +62,10 @@ export type TableRowProps = { } export type TableColProps = { - key: string - content: ReactNode align?: TableCellAlign + content: ReactNode + hide?: boolean + key: string width?: string } type TableProps = { @@ -112,18 +114,23 @@ export const Table: FC = ({ - {columns.map((column, index) => ( - - {column.content} - - ))} + {columns.map((column, index) => { + if (column.hide) { + return null + } + return ( + + {column.content} + + ) + })} @@ -132,18 +139,23 @@ export const Table: FC = ({ )} {rows?.map(row => ( - {row.data.map((cell, index) => ( - - {cell.content} - - ))} + {row.data.map((cell, index) => { + if (cell.hide) { + return null + } + return ( + + {cell.content} + + ) + })} ))} From 6949bb2645b89f3c9d3f9d2b64b39f777c64a99f Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Wed, 17 Jul 2024 11:52:00 +0200 Subject: [PATCH 9/9] Improve type usage around FilterButtons --- src/app/components/FilterButtons/index.tsx | 2 +- src/app/pages/ConsensusAccountDetailsPage/Staking.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/FilterButtons/index.tsx b/src/app/components/FilterButtons/index.tsx index d9fa29f81..7d66584b8 100644 --- a/src/app/components/FilterButtons/index.tsx +++ b/src/app/components/FilterButtons/index.tsx @@ -6,7 +6,7 @@ import { COLORS } from '../../../styles/theme/colors' type FilterButtonsProps = { options: { label: string; value: T }[] onSelect: (value: T) => void - value?: T + value?: NoInfer } export const FilterButtons = ({ options, onSelect, value }: FilterButtonsProps) => { diff --git a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx index 8001b249d..8d0de6064 100644 --- a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx +++ b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx @@ -28,7 +28,7 @@ type DelegationStatus = 'staked' | 'debonding' export const Staking: FC = ({ account, isLoading }) => { const { t } = useTranslation() - const [type, setType] = useState('staked') + const [type, setType] = useState('staked') const options: { label: string; value: DelegationStatus }[] = [ { label: t('common.staked'),