diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index fb01df5..b44c3b8 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1128,5 +1128,7 @@ "Unclaimed income": "待领取收益", "pledge": "质押", "Invite": "邀请", - "top": "置顶" + "top": "置顶", + "Cancel the pledge": "取消质押", + "Forced to cancel": "强制取消质押" } diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index e850df9..35266b0 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1255,5 +1255,7 @@ "capital pool": "capital pool", "Unclaimed income": "Unclaimed income", "pledge": "pledge", - "top": "top" + "top": "top", + "Cancel the pledge": "Cancel the pledge", + "Forced to cancel": "Forced to cancel" } diff --git a/src/views/Board/components/BoardCard/BoardCard.tsx b/src/views/Board/components/BoardCard/BoardCard.tsx index eaea43f..9849e46 100644 --- a/src/views/Board/components/BoardCard/BoardCard.tsx +++ b/src/views/Board/components/BoardCard/BoardCard.tsx @@ -135,7 +135,7 @@ const BoardCard: React.FC = ({ board, account, boardsData }) => { {account && (
- {board.pid === 1 ? : ''} + {board.pid === 1 && board.userData?.amount ? : ''} {/* */}
diff --git a/src/views/Board/components/BoardCard/CardActionsContainer.tsx b/src/views/Board/components/BoardCard/CardActionsContainer.tsx index b853961..8c8bb48 100644 --- a/src/views/Board/components/BoardCard/CardActionsContainer.tsx +++ b/src/views/Board/components/BoardCard/CardActionsContainer.tsx @@ -56,7 +56,7 @@ const CardActions: React.FC = ({ board, account }) => { {t('Staked')} - + {t('Unclaimed income')} diff --git a/src/views/Board/components/BoardCard/StakeAction.tsx b/src/views/Board/components/BoardCard/StakeAction.tsx index b10afa0..1c0fe1d 100644 --- a/src/views/Board/components/BoardCard/StakeAction.tsx +++ b/src/views/Board/components/BoardCard/StakeAction.tsx @@ -4,6 +4,7 @@ import styled from 'styled-components' import BigNumber from 'bignumber.js' import { Button, Flex, Heading, IconButton, AddIcon, MinusIcon, useModal } from '@pancakeswap/uikit' import { getBalanceNumber } from 'utils/formatBalance' +import { Boards } from 'state/types' import { useBoardsFromPid } from 'state/hooks' import { useTranslation } from 'contexts/Localization' import useToast from 'hooks/useToast' @@ -17,6 +18,7 @@ interface NodeCardActionsProps { tokenBalance?: BigNumber tokenName?: string pid?: number + board?: Boards } const IconButtonWrapper = styled.div` @@ -25,8 +27,12 @@ const IconButtonWrapper = styled.div` width: 20px; } ` +const IconButtonDiv = styled(IconButton)` + width: auto; + padding: 0 10px; +` -const StakeAction: React.FC = ({ stakedBalance, tokenBalance, tokenName, pid }) => { +const StakeAction: React.FC = ({ stakedBalance, tokenBalance, tokenName, pid, board }) => { const { t } = useTranslation() const { toastWarning } = useToast() const { onStake } = useStakeBoard(pid) @@ -64,12 +70,16 @@ const StakeAction: React.FC = ({ stakedBalance, tokenBalan ) : ( {userData.stakedBalance > 0 ? ( - - - + + {board.pid === 1 + ? board.userData?.unlockTime * 1000 <= new Date().getTime() + ? t('Cancel the pledge') + : t('Forced to cancel') + : t('Cancel the pledge')} + ) : ( - + 2 )}