@ -11,7 +11,7 @@ import { toString } from '~/utils/wei'
const Home = ( ) = > {
const { push } = useRouter ( )
const { t } = useTranslation ( )
const { t , i18n } = useTranslation ( )
const [ pledgeList , setPledgeList ] = useState ( [
{ day : 180 , rate : 1408 } ,
@ -37,9 +37,24 @@ const Home = () => {
res . data && setPledgeList ( res . data )
}
const renderTitle = ( ) = > {
if ( i18n . language === 'en' ) {
return (
< div className = 'tac mt-1 fz-17' > Up To < span className = 'fz-24 fz-wb-550' > 7 % < / span > of Referees Staking Rewards < / div >
)
}
if ( i18n . language === 'hk' ) {
return (
< div className = 'tac mt-1 fz-17' > 高 達 質 押 人 賺 取 的 < span className = 'fz-24 fz-wb-550' > 7 % < / span > < / div >
)
}
return < div className = 'tac mt-1 fz-17' > 高 达 质 押 人 赚 取 的 < span className = 'fz-24 fz-wb-550' > 7 % < / span > < / div >
}
useEffect ( ( ) = > {
getData ( )
} , [ ] )
return (
< div className = "home" >
< div className = "liner-box" >
@ -71,7 +86,7 @@ const Home = () => {
< / div >
< div className = 'mt-2 row-between' >
< div > { t ( 'Annualized Percentage Rate (APR)' ) } < / div >
< div className = 'fz-26 fz-wb-550' > { toString ( pledgeList [ pledgeIndex ] . rate , 2 ) } % < / div >
< div className = 'fz-26 fz-wb-550' > { toString ( pledgeList [ pledgeIndex ] . rate , 2 ) } % < / div >
< / div >
< / div >
< / div >
@ -107,13 +122,13 @@ const Home = () => {
< div className = 'tac fz-18px fz-wb-550 mt-3' > { t ( 'Refer To Earn' ) } < / div >
< div className = 'plr-1' >
< div className = 'refer row-center' >
< img src = { require ( '~/assets/group.png' ) } className = 'img' alt = "" / >
< div className = 'box p-2' >
< div className = 'fz-wb-550 tac' > { t ( 'Up To 7% of Referees Staking Rewards' ) } < / div >
< div className = 'row-center mt-1 plr-1' onClick = { ( ) = > {
< div className = 'refer row-center' onClick = { ( ) = > {
push ( '/myPledge' )
} } >
< img src = { require ( '~/assets/group.png' ) } className = 'img' alt = "" / >
< div className = 'box plr-1' >
< div className = 'fz-wb-550 tac pt-1' > { renderTitle ( ) } < / div >
< div className = 'row-center mt-1 plr-1' >
< div className = 'tac fz-14' > { t ( 'By sharing your referral code and introducing your friends to SOFIL and stake, you can earn referral rewards and withdraw everyday.' ) } < / div >
< div className = 'iconfont icon-arrow fz-26' > < / div >
< / div >