This commit is contained in:
parent
8385cf5cc0
commit
14cf15f868
|
|
@ -8,7 +8,7 @@ export const queryUserInfo = () => {
|
|||
}
|
||||
export const uccnDetail = () => {
|
||||
return request.request({
|
||||
url: '/high_city/app/api/user/uccn/detail',
|
||||
url: '/high_city/app/api/index/uccn/detail',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import React, { useState, useEffect, useMemo, useRef } from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { useTranslation } from 'contexts/Localization'
|
||||
import Container from 'components/Layout/Container'
|
||||
import { getAnnouncementPage, getAnnouncementDetail } from 'services/announcement'
|
||||
import { Text, Flex, Image, Input, Heading } from '@pancakeswap/uikit'
|
||||
import ListItem from './components/ListItem'
|
||||
|
|
@ -11,13 +12,15 @@ interface DetailProps {
|
|||
content?: string
|
||||
publishTime?: number
|
||||
}
|
||||
|
||||
const ContainerMain = styled(Container)`
|
||||
background: ${({ theme }) => theme.colors.gradients.bubblegum};
|
||||
padding: 30px 0;
|
||||
`
|
||||
const MainDiv = styled.div`
|
||||
width: 100%;
|
||||
min-height: calc(100vh - 64px);
|
||||
background: ${({ theme }) => theme.colors.gradients.bubblegum};
|
||||
/* background: ${({ theme }) => theme.colors.gradients.bubblegum}; */
|
||||
box-sizing: border-box;
|
||||
padding: 30px 0;
|
||||
`
|
||||
const TableDiv = styled.div`
|
||||
width: 80%;
|
||||
|
|
@ -186,38 +189,40 @@ const Announcement: React.FC = () => {
|
|||
console.log(searchTitle)
|
||||
}
|
||||
return (
|
||||
<MainDiv ref={loadMoreRef as any} onScrollCapture={onScrollCapture}>
|
||||
{detailVisible ? (
|
||||
<Detail
|
||||
title={detailData.title}
|
||||
publishTime={detailData.publishTime}
|
||||
content={detailData.content}
|
||||
close={close}
|
||||
/>
|
||||
) : (
|
||||
<TableDiv>
|
||||
<SearchDiv>
|
||||
<InputMain>
|
||||
<SearchInput placeholder={t('Enter a keyword search')} value={searchTitle} onChange={handleChange} />
|
||||
<SearchBtn onClick={searchList}>
|
||||
<Image src="/images/announcement/search-icon.svg" alt="" width={16} height={16} />
|
||||
</SearchBtn>
|
||||
</InputMain>
|
||||
</SearchDiv>
|
||||
<ListMain>
|
||||
{renderContent()}
|
||||
{totalVisible ? <TextAll>{t('Loaded all')}</TextAll> : ''}
|
||||
<ContainerMain>
|
||||
<MainDiv ref={loadMoreRef as any} onScrollCapture={onScrollCapture}>
|
||||
{detailVisible ? (
|
||||
<Detail
|
||||
title={detailData.title}
|
||||
publishTime={detailData.publishTime}
|
||||
content={detailData.content}
|
||||
close={close}
|
||||
/>
|
||||
) : (
|
||||
<TableDiv>
|
||||
<SearchDiv>
|
||||
<InputMain>
|
||||
<SearchInput placeholder={t('Enter a keyword search')} value={searchTitle} onChange={handleChange} />
|
||||
<SearchBtn onClick={searchList}>
|
||||
<Image src="/images/announcement/search-icon.svg" alt="" width={16} height={16} />
|
||||
</SearchBtn>
|
||||
</InputMain>
|
||||
</SearchDiv>
|
||||
<ListMain>
|
||||
{renderContent()}
|
||||
{totalVisible ? <TextAll>{t('Loaded all')}</TextAll> : ''}
|
||||
|
||||
{/* <div ref={loadMoreRef} /> */}
|
||||
{/* {list.map((item) => (
|
||||
{/* <div ref={loadMoreRef} /> */}
|
||||
{/* {list.map((item) => (
|
||||
<Text key={item.id} onClick={() => lookDetail(item.id)}>
|
||||
<ListItem title={item.title} publishTime={item.publishTime} content={item.content} />
|
||||
</Text>
|
||||
))} */}
|
||||
</ListMain>
|
||||
</TableDiv>
|
||||
)}
|
||||
</MainDiv>
|
||||
</ListMain>
|
||||
</TableDiv>
|
||||
)}
|
||||
</MainDiv>
|
||||
</ContainerMain>
|
||||
)
|
||||
}
|
||||
export default Announcement
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import React, { useEffect, useCallback, useMemo, useState, useRef } from 'react'
|
|||
import { Route, useRouteMatch, useLocation } from 'react-router-dom'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import BigNumber from 'bignumber.js'
|
||||
import erc20 from 'config/abi/erc20.json'
|
||||
import multicall from 'utils/multicall'
|
||||
import { useWeb3React } from '@web3-react/core'
|
||||
import { Image, Heading, RowType, Toggle, Text } from '@pancakeswap/uikit'
|
||||
import styled from 'styled-components'
|
||||
|
|
@ -43,6 +45,23 @@ const Boards: React.FC = () => {
|
|||
dispatch(fetchBoardsPublicDataAsync())
|
||||
if (account) {
|
||||
dispatch(fetchBoardUserDataAsync(account))
|
||||
|
||||
const calls = [
|
||||
// 查节点的代币数量
|
||||
{
|
||||
address: tokenAddress,
|
||||
name: 'balanceOf',
|
||||
params: [BoardChefAddress],
|
||||
},
|
||||
// Token decimals
|
||||
{
|
||||
address: tokenAddress,
|
||||
name: 'decimals',
|
||||
},
|
||||
]
|
||||
// eslint-disable-next-line prefer-const
|
||||
let [tokenBalance, tokenDecimals] = await multicall(erc20, calls)
|
||||
tokenBalance = new BigNumber(tokenBalance).div(new BigNumber(10).pow(tokenDecimals))
|
||||
}
|
||||
}, [account, dispatch, fastRefresh])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue