Skip to content

Commit

Permalink
Change delegations naming in account details
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Jul 15, 2024
1 parent f28b418 commit fc8411f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/components/Account/ConsensusAccountDetailsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const ConsensusAccountDetailsView: FC<ConsensusAccountDetailsViewProps> =
ticker: account.ticker,
})}
</dd>
<StyledListTitle>{t('common.staking')}</StyledListTitle>
<StyledListTitle>{t('common.staked')}</StyledListTitle>
<dd>
{t('common.valueInToken', {
...getPreciseNumberFormat(account.delegations_balance!),
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/Delegations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Delegations: FC<DelegationsProps> = ({
},
{
align: TableCellAlign.Right,
content: <RoundedBalance value={delegation.amount} />,
content: <RoundedBalance value={delegation.amount} ticker={delegation.ticker} />,
key: 'amount',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const BalanceDistributionContent: FC<BalanceDistributionContentProps> = ({ accou
value: Number(account.available),
},
{
label: t('common.staking'),
label: t('common.staked'),
value: Number(account.delegations_balance),
},
{
Expand Down
14 changes: 7 additions & 7 deletions src/app/pages/ConsensusAccountDetailsPage/Staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ type StakingProps = {
account: Account | undefined
isLoading: boolean
}
type DelegationStatus = 'active' | 'debonding'
type DelegationStatus = 'staked' | 'debonding'

export const Staking: FC<StakingProps> = ({ 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',
},
]
Expand All @@ -46,11 +46,11 @@ export const Staking: FC<StakingProps> = ({ account, isLoading }) => {
action={<FilterButtons options={options} value={type} onSelect={type => setType(type)} />}
disableTypography
component="h3"
title={t('common.staking')}
title={t('validator.delegations')}
/>
<CardContent>
{isLoading && <Skeleton variant="rectangular" height={300} />}
{account && type === 'active' && <ActiveDelegations address={account?.address} />}
{account && type === 'staked' && <ActiveDelegations address={account?.address} />}
{account && type === 'debonding' && <DebondingDelegations address={account?.address} />}
</CardContent>
</Card>
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"consensusOutOfDate": "Consensus out of date",
"copy": "Copy",
"data": "Data",
"debonding": "Debonding",
"emerald": "Emerald",
"epoch": "Epoch",
"cipher": "Cipher",
Expand Down Expand Up @@ -656,6 +657,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.",
Expand All @@ -674,7 +676,6 @@
"proposedBlocks": "Proposed Blocks",
"snapshot": "Validator Snapshot",
"shares": "Shares",
"staked": "Staked",
"stakingTrend": "Staking Trend",
"startDate": "Start Date",
"title": "Validator",
Expand Down

0 comments on commit fc8411f

Please sign in to comment.