diff --git a/src/language/hk.json b/src/language/hk.json index b78f155..06d7b51 100644 --- a/src/language/hk.json +++ b/src/language/hk.json @@ -128,5 +128,6 @@ "Binding Time": "綁定時間", "Contract(Rewards) Details": "合約(奖励)明細", "Days Staking": "天質押", - "Rewards Details": "收益及提取明細" + "Rewards Details": "收益及提取明細", + "Referral Contract":"推薦合約" } \ No newline at end of file diff --git a/src/language/zh.json b/src/language/zh.json index 161c893..4b3856b 100644 --- a/src/language/zh.json +++ b/src/language/zh.json @@ -128,5 +128,6 @@ "Binding Time": "绑定时间", "Contract(Rewards) Details": "合约(奖励)明细", "Days Staking": "天质押", - "Rewards Details": "收益及提取明细" + "Rewards Details": "收益及提取明细", + "Referral Contract":"推荐合约" } diff --git a/src/pages/invitation/index.tsx b/src/pages/invitation/index.tsx index b669e59..e6f4253 100644 --- a/src/pages/invitation/index.tsx +++ b/src/pages/invitation/index.tsx @@ -162,7 +162,7 @@ const Invitation = () => { > - + diff --git a/src/pages/pledge/index.tsx b/src/pages/pledge/index.tsx index 73d6a58..7042baf 100644 --- a/src/pages/pledge/index.tsx +++ b/src/pages/pledge/index.tsx @@ -20,7 +20,7 @@ const Pledge = () => { const { location } = useRouter() const { filBalance, walletAddress, contract } = store.state - const {Pledge__factory, FIL__factory, Pool__factory } = contract._contract ? contract._contract : {} as Contract_Factory + const { Pledge__factory, FIL__factory, Pool__factory } = contract._contract ? contract._contract : {} as Contract_Factory const [pledgeList, setPledgeList] = useState([ { day: 180, rate: 14 }, @@ -30,6 +30,7 @@ const Pledge = () => { const [amount, setAmount] = useState('') const [profit, setProfit] = useState('0.00') + const [totalProfit, setTotalProfit] = useState('0.00') const [tabIndex, setTabIndex] = useState(location.state ? location.state.index : 0) const [visible, setVisible] = useState(false) const [loading, setLoading] = useState(false) @@ -125,15 +126,19 @@ const Pledge = () => { const calcIncome = () => { if (amount === '') { setProfit('0.00') + setTotalProfit('0.00') return } const pledgeAmount = toWei(amount) const pledgeDay = toBigInt(pledgeList[tabIndex].day) const rate = toBigInt(pledgeList[tabIndex].rate) const year = toBigInt(365) - const total = pledgeAmount * rate / year * pledgeDay + const total = pledgeAmount * rate / year * pledgeDay; const _profit = ethers.formatUnits(total, 20) + const _totalProfit = ethers.formatUnits(toWei(toFixed2(_profit,18)) + pledgeAmount,18) + setProfit(_profit) + setTotalProfit(_totalProfit) } calcIncome() }, [amount, tabIndex]) @@ -209,7 +214,7 @@ const Pledge = () => {
{t('Est. Total Receivable')}:
-
{toFixed2(profit, 4)} FIL
+
{toFixed2(totalProfit, 4)} FIL