调整代码

This commit is contained in:
myf 2022-05-10 18:19:12 +08:00
parent 7e3b354b3e
commit 15b05e3aab
5 changed files with 11 additions and 9 deletions

BIN
build.zip Normal file

Binary file not shown.

View File

@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { Tag, Flex, Heading, Image } from '@pancakeswap/uikit' import { Tag, Flex, Heading, Image } from '@pancakeswap/uikit'
import { useAccount } from 'state/userInfo/hooks'
import Question from 'components/QuestionHelper' import Question from 'components/QuestionHelper'
import { useTranslation } from 'contexts/Localization' import { useTranslation } from 'contexts/Localization'
@ -23,7 +24,7 @@ const Wrapper = styled(Flex)`
svg { svg {
margin-right: 4px; margin-right: 4px;
} }
.ribbon { .corner-mark {
width: 88px; width: 88px;
height: 89px; height: 89px;
overflow: hidden; overflow: hidden;
@ -32,7 +33,7 @@ const Wrapper = styled(Flex)`
right: 0px; right: 0px;
} }
.ribbon1 { .ribbon {
line-height: 12px; line-height: 12px;
text-align: center; text-align: center;
transform: rotate(50deg); transform: rotate(50deg);
@ -70,6 +71,7 @@ const HeaderFlex = styled(Flex)``
const CardHeading: React.FC<ExpandableSectionProps> = ({ name, img, tokenSymbol, amount }) => { const CardHeading: React.FC<ExpandableSectionProps> = ({ name, img, tokenSymbol, amount }) => {
const { t } = useTranslation() const { t } = useTranslation()
const account = useAccount()
return ( return (
<Wrapper justifyContent="space-between" alignItems="center" mb="12px"> <Wrapper justifyContent="space-between" alignItems="center" mb="12px">
@ -78,9 +80,9 @@ const CardHeading: React.FC<ExpandableSectionProps> = ({ name, img, tokenSymbol,
<Heading mb="4px">{name}</Heading> <Heading mb="4px">{name}</Heading>
{/* <Question text={t('To join board, you need to stake at least 0.1% total supply of Token')} /> */} {/* <Question text={t('To join board, you need to stake at least 0.1% total supply of Token')} /> */}
</HeaderFlex> </HeaderFlex>
{amount > 0 && ( {amount > 0 && account && (
<div className="ribbon"> <div className="corner-mark">
<div className="ribbon1">{t('Staked')}</div> <div className="ribbon">{t('Staked')}</div>
</div> </div>
)} )}
</Wrapper> </Wrapper>

View File

@ -80,7 +80,7 @@ const Boards: React.FC = () => {
// totalAmount: getBalanceAmount(new BigNumber(boardPoolInfo.totalAmount._hex)).toNumber(), // totalAmount: getBalanceAmount(new BigNumber(boardPoolInfo.totalAmount._hex)).toNumber(),
holderNum: new BigNumber(boardPoolInfo?.holderNum?._hex).toNumber(), holderNum: new BigNumber(boardPoolInfo?.holderNum?._hex).toNumber(),
waitWithdrawAmount: getBalanceAmount(new BigNumber(waitWithdrawAmount.balance._hex)).toNumber(), waitWithdrawAmount: getBalanceAmount(new BigNumber(waitWithdrawAmount.balance._hex)).toNumber(),
totalReward: new BigNumber(boardPoolInfo?.totalReward?._hex).toNumber(), totalReward: getBalanceAmount(new BigNumber(boardPoolInfo?.totalReward?._hex)).toNumber(),
} }
}), }),
) )

View File

@ -116,11 +116,11 @@ const RegimentalCom: React.FC = () => {
/> />
<FlexCom <FlexCom
name={t('First stage sharing ratio')} name={t('First stage sharing ratio')}
value={`${formatDivNumber(referralCommanderConfigInfo.dividendFirst || 0)}%`} value={`${referralCommanderConfigInfo.dividendFirst as number}%`}
/> />
<FlexCom <FlexCom
name={t('Secondary split ratio')} name={t('Secondary split ratio')}
value={`${formatDivNumber((referralCommanderConfigInfo.dividendSecond as number) || 0)}%`} value={`${referralCommanderConfigInfo.dividendSecond as number}%`}
/> />
</> </>

View File

@ -43,7 +43,7 @@ const Nft: React.FC = () => {
const referralIsCommander = useReferralIsCommander() const referralIsCommander = useReferralIsCommander()
useEffect(() => { useEffect(() => {
dispatch(fetchReferralInfoAsync(account)) dispatch(fetchReferralInfoAsync(account))
}, [account]) }, [account, referralIsCommander])
return ( return (
<MainDiv> <MainDiv>