部分董事会
This commit is contained in:
parent
b2fb877052
commit
089d6f8ade
|
|
@ -16,3 +16,7 @@ REACT_APP_GRAPH_API_LOTTERY = "https://api.thegraph.com/subgraphs/name/pancakesw
|
|||
|
||||
REACT_APP_SNAPSHOT_BASE_URL = "https://hub.snapshot.page"
|
||||
REACT_APP_SNAPSHOT_VOTING_API = "https://voting-api.pancakeswap.info/api"
|
||||
|
||||
|
||||
REACT_APP_REQUEST_URL = 'http://101.35.117.69:9090'
|
||||
# REACT_APP_REQUEST_URL = 'http://192.168.2.210:8080'
|
||||
|
|
@ -1,7 +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 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'
|
||||
|
|
@ -12,9 +12,9 @@ interface DetailProps {
|
|||
content?: string
|
||||
publishTime?: number
|
||||
}
|
||||
const ContainerMain = styled(Container)`
|
||||
const ContainerMain = styled.div`
|
||||
background: ${({ theme }) => theme.colors.gradients.bubblegum};
|
||||
padding: 30px 0;
|
||||
/* padding: 30px 0; */
|
||||
`
|
||||
const MainDiv = styled.div`
|
||||
width: 100%;
|
||||
|
|
@ -130,10 +130,18 @@ const Announcement: React.FC = () => {
|
|||
const [list, setList] = useState([])
|
||||
const [totalVisible, setTotalVisible] = useState(false)
|
||||
const [detailData, setDetailData] = useState<DetailProps>({ title: '', publishTime: 0, content: '' })
|
||||
const getList = async (page: number, size: number, title?: string) => {
|
||||
const getList = async (page: number, size: number, title?: string, type?: string) => {
|
||||
if (totalVisible) return
|
||||
if (type) {
|
||||
setList([])
|
||||
}
|
||||
const data = await getAnnouncementPage({ page, size, title })
|
||||
const dataList = [...list, ...data.content]
|
||||
let dataList = []
|
||||
if (type) {
|
||||
dataList = data.content
|
||||
} else {
|
||||
dataList = [...list, ...data.content]
|
||||
}
|
||||
setList(dataList)
|
||||
if (data.content.length === 0 || !data.content) {
|
||||
setTotalVisible(true)
|
||||
|
|
@ -166,7 +174,8 @@ const Announcement: React.FC = () => {
|
|||
}
|
||||
const searchList = () => {
|
||||
setList([])
|
||||
getList(1, 10, searchTitle)
|
||||
setTotalVisible(false)
|
||||
getList(1, 10, searchTitle, 'search')
|
||||
}
|
||||
const close = () => {
|
||||
setDetailVisible(false)
|
||||
|
|
|
|||
Loading…
Reference in New Issue