增加锁仓结束

This commit is contained in:
myf 2022-05-11 13:37:02 +08:00
parent 8ec7833ec8
commit 7b1748ac3e
3 changed files with 16 additions and 9 deletions

View File

@ -1130,5 +1130,6 @@
"Invite": "邀请",
"top": "置顶",
"Cancel the pledge": "取消质押",
"Forced to cancel": "强制取消质押"
"Forced to cancel": "强制取消质押",
"End of the lock up": "锁仓结束"
}

View File

@ -1257,5 +1257,6 @@
"pledge": "pledge",
"top": "top",
"Cancel the pledge": "Cancel the pledge",
"Forced to cancel": "Forced to cancel"
"Forced to cancel": "Forced to cancel",
"End of the lock up": "End of the lock up"
}

View File

@ -103,10 +103,11 @@ const BoardCard: React.FC<NodeCardProps> = ({ board, account, boardsData }) => {
useEffect(() => {
const interval = setInterval(() => {
if (board.userData?.unlockTime) {
const time = board.userData?.unlockTime * 1000
if (time > 0) {
countDownFun(time - 1)
if (countDown === t('End of the lock up')) {
clearInterval(interval)
}
const time = board.userData?.unlockTime * 1000
countDownFun(time - 1)
}
}, 1000)
return () => clearInterval(interval)
@ -116,10 +117,14 @@ const BoardCard: React.FC<NodeCardProps> = ({ board, account, boardsData }) => {
const date1 = dayjs()
const date2 = dayjs(date)
const time = date2.diff(date1)
const hour = Math.floor((time / (1000 * 60 * 60)) % 24)
const minute = Math.floor((time / (1000 * 60)) % 60)
const second = Math.round((time / 1000) % 60)
setCountDown(`${hour}:${minute}:${second}`)
if (time > 0) {
const hour = Math.floor((time / (1000 * 60 * 60)) % 24)
const minute = Math.floor((time / (1000 * 60)) % 60)
const second = Math.round((time / 1000) % 60)
setCountDown(`${hour}:${minute}:${second}`)
} else {
setCountDown(`${t('End of the lock up')}`)
}
}
const [showExpandableSection, setShowExpandableSection] = useState(false)