Skip to content

Commit

Permalink
Merge pull request #789 from Conflux-Chain/dev
Browse files Browse the repository at this point in the history
feat: add chart detail link to pos preivew title
  • Loading branch information
0x74616e67 authored Jun 22, 2022
2 parents e26e488 + eab12cf commit 73177fe
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 15 deletions.
16 changes: 12 additions & 4 deletions src/app/containers/HomePage/BlockchainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,26 @@ export function BlockchainInfo({ timestamp = 1 }: { timestamp?: number }) {
</Grid>
<Grid xs={24} sm={24} md={2}>
{Info(
t(translations.statistics.pos.totalAccountCount),
<Link to="/pos-charts/daily-accounts" className="info-link">
{t(translations.statistics.pos.totalAccountCount)}
</Link>,
POSSummaryInfo.posAccountCount,
)}
</Grid>
<Grid xs={24} sm={24} md={3}>
{Info(
t(translations.statistics.pos.totalLocked),
<Link to="/pos-charts/daily-staking" className="info-link">
{t(translations.statistics.pos.totalLocked)}
</Link>,
formatBalance(POSSummaryInfo.totalPosStakingTokens),
)}
</Grid>
<Grid xs={24} sm={24} md={3}>
{Info(
<InfoIconWithTooltip info={t(translations.statistics.pos.apyTip)}>
{t(translations.statistics.pos.apy)}
<Link to="/pos-charts/daily-apy" className="info-link">
{t(translations.statistics.pos.apy)}
</Link>
</InfoIconWithTooltip>,
lodash.isNil(POSSummaryInfo.apy)
? '--'
Expand All @@ -241,7 +247,9 @@ export function BlockchainInfo({ timestamp = 1 }: { timestamp?: number }) {

<Grid xs={24} sm={24} md={3}>
{Info(
t(translations.statistics.pos.totalInterest),
<Link to="/pos-charts/total-reward" className="info-link">
{t(translations.statistics.pos.totalInterest)}
</Link>,
formatBalance(POSSummaryInfo.totalPosRewardDrip),
)}
</Grid>
Expand Down
17 changes: 13 additions & 4 deletions src/app/containers/pos/HomePage/BlockchainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { formatBalance, formatTimeStamp } from 'utils';
import { reqHomeDashboardOfPOSSummary } from 'utils/httpRequest';
import lodash from 'lodash';
import { InfoIconWithTooltip } from 'app/components/InfoIconWithTooltip';
import { Link } from 'react-router-dom';

function Info(title, number: any) {
return (
Expand Down Expand Up @@ -54,20 +55,26 @@ export function BlockchainInfo({ timestamp = 1 }: { timestamp?: number }) {
</Grid>
<Grid xs={24} sm={24} md={2}>
{Info(
t(translations.statistics.pos.totalAccountCount),
<Link to="/pos-charts/daily-accounts" className="info-link">
{t(translations.statistics.pos.totalAccountCount)}
</Link>,
POSSummaryInfo.posAccountCount,
)}
</Grid>
<Grid xs={24} sm={24} md={3.5}>
{Info(
t(translations.statistics.pos.totalLocked),
<Link to="/pos-charts/daily-staking" className="info-link">
{t(translations.statistics.pos.totalLocked)}
</Link>,
formatBalance(POSSummaryInfo.totalPosStakingTokens),
)}
</Grid>
<Grid xs={24} sm={24} md={2.5}>
{Info(
<InfoIconWithTooltip info={t(translations.statistics.pos.apyTip)}>
{t(translations.statistics.pos.apy)}
<Link to="/pos-charts/daily-apy" className="info-link">
{t(translations.statistics.pos.apy)}
</Link>
</InfoIconWithTooltip>,
lodash.isNil(POSSummaryInfo.apy)
? '--'
Expand All @@ -76,7 +83,9 @@ export function BlockchainInfo({ timestamp = 1 }: { timestamp?: number }) {
</Grid>
<Grid xs={24} sm={24} md={3.5}>
{Info(
t(translations.statistics.pos.totalInterest),
<Link to="/pos-charts/total-reward" className="info-link">
{t(translations.statistics.pos.totalInterest)}
</Link>,
formatBalance(POSSummaryInfo.totalPosRewardDrip),
)}
</Grid>
Expand Down
8 changes: 4 additions & 4 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@
},
"activeAccounts": {
"title": "Active Accounts",
"subtitle": "The number of active accounts per day on the Conflux network.",
"subtitle": "The daily number of unique addresses that were active on the network as a sender or receiver of CFX or Token.",
"yAxisTitle": "Total Active Accounts",
"seriesName": "Total Active Accounts (Day)"
},
Expand Down Expand Up @@ -1715,11 +1715,11 @@
"pos": {
"finalizedEpoch": "Finalized Epoch",
"currentBlockNumber": "Current Block Number",
"totalLocked": "Total Locked",
"totalInterest": "Historical Interest",
"totalLocked": "Total Staked",
"totalInterest": "Total Reward",
"lastInterestDistributionDate": "Interest Distribution Date",
"lastInterestDistributionEpoch": "Latest Interest Distribution Block",
"totalAccountCount": "Nodes",
"totalAccountCount": "Accounts",
"votingBlock": "Latest Voted Block",
"apy": "APY",
"apyTip": "The existing base staking rate is 4%, and the PoS staking reward is added to this with a plus factor. Let x=CFX total circulation / CFX total staking, and the additional coefficient be √x.\nWhen the amount of staking is 1/4 of the circulation, the reward rate is 8%; When the amount of staking is 1/9 of the circulation, the reward rate is 12%; And so on. When the total number of votes cast is relatively low, those who vote will benefit more."
Expand Down
6 changes: 3 additions & 3 deletions src/locales/zh_cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@
},
"activeAccounts": {
"title": "活跃账户数",
"subtitle": "Conflux 网络上每日活跃的账户数量",
"subtitle": "Conflux 网络上每日 CFX 或代币交易的发送方或接收方的去重地址",
"yAxisTitle": "每日活跃账户数",
"seriesName": "每日活跃账户数"
},
Expand Down Expand Up @@ -1714,10 +1714,10 @@
"finalizedEpoch": "已确认纪元",
"currentBlockNumber": "当前区块编号",
"totalLocked": "总锁仓",
"totalInterest": "累计利息",
"totalInterest": "总奖励",
"lastInterestDistributionDate": "分发利息时间",
"lastInterestDistributionEpoch": "最新分发利息区块",
"totalAccountCount": "节点总数",
"totalAccountCount": "账户总数",
"votingBlock": "最新已投票区块",
"apy": "年利率",
"apyTip": "现有基础质押利率为 4%,而 PoS 质押奖励在此基础上添加加成系数。设 x=CFX总流通量 /CFX总质押量,加成系数为 √x。\n当质押量为流通量的 1/4 时,利率为 8%;当质押量为流通量 1/9 时,利率为 12%;以此类推。当参与投票的总数相对较低时,参与投票的人将获得更多的利益。"
Expand Down

0 comments on commit 73177fe

Please sign in to comment.