({ title: '', publishTime: 0, content: '' })
+ const getList = async (page: number, size: number) => {
+ const data = await getAnnouncementPage({ page, size })
+ console.log(data.content)
+ setList(data.content)
+ }
+ useEffect(() => {
+ getList(1, 10)
+ }, [])
+
+ const lookDetail = async (id) => {
+ const data = await getAnnouncementDetail(id)
+ setDetailData(data)
+ setDetailVisible(true)
+ }
+ const searchList = () => {
+ getList(1, 10)
+ }
+ const close = () => {
+ setDetailVisible(false)
+ }
+
+ const renderContent = (): JSX.Element => {
+ return (
+
+ {list.map((item) => (
+ lookDetail(item.id)}>
+
+
+ ))}
+
+ )
+ }
+
+ return (
+
+ {detailVisible ? (
+
+ ) : (
+
+
+
+
+
+
+
+
+
+
+ {renderContent()}
+
+ {/* {list.map((item) => (
+ lookDetail(item.id)}>
+
+
+ ))} */}
+
+
+ )}
+
+ )
+}
+export default Announcement
diff --git a/src/views/Board/components/HeaderItem.tsx b/src/views/Board/components/HeaderItem.tsx
new file mode 100644
index 0000000..f40c3f0
--- /dev/null
+++ b/src/views/Board/components/HeaderItem.tsx
@@ -0,0 +1,36 @@
+import React from 'react'
+import { Text } from '@pancakeswap/uikit'
+import styled from 'styled-components'
+
+interface InfoProps {
+ title: string
+ price: number
+}
+
+const HeaderMain = styled.div`
+ height: 84px;
+ background: linear-gradient(180deg, #c2f9ff 0%, #b596f5 100%);
+ box-shadow: 0px 2px 1px #371588;
+ opacity: 0.5;
+ border-radius: 20px;
+ box-sizing: border-box;
+ padding: 16px 0 0 20px;
+ text-align: left;
+`
+
+const HeaderItem: React.FC = ({ title, price }) => {
+ return (
+ <>
+
+
+ {price}
+
+
+ {title}
+
+
+ >
+ )
+}
+
+export default HeaderItem
diff --git a/src/views/Board/index.tsx b/src/views/Board/index.tsx
index aa45de6..37b8ea5 100644
--- a/src/views/Board/index.tsx
+++ b/src/views/Board/index.tsx
@@ -12,6 +12,7 @@ import useRefresh from 'hooks/useRefresh'
import { fetchBoardUserDataAsync, fetchBoardsPublicDataAsync } from 'state/actions'
import { useTranslation } from 'contexts/Localization'
import BoardCard from './components/BoardCard/BoardCard'
+import HeaderItem from './components/HeaderItem'
const Header = styled.div`
padding: 32px 0px;
@@ -27,6 +28,9 @@ const Header = styled.div`
const SecondText = styled(Text)`
white-space: break-spaces;
`
+const FlexLayoutMain = styled(FlexLayout)`
+ margin-top: 20px;
+`
const Boards: React.FC = () => {
const { t } = useTranslation()
const boardsList = useBoards()
@@ -58,13 +62,22 @@ const Boards: React.FC = () => {
<>
- {t('Boards')}
+ {t('Total capital pool')}
-
+ {/*
{t(
'Joining the board of directors will obtain the governance token xcandy \n participate in the governance of the project, vote, obtain additional pledge income, \n and have a higher invitation airdrop reward',
)}
-
+ */}
+
+ 1.000.000.000.000
+
+
+
+
+
+
+
{renderContent()}
>
diff --git a/src/views/Referral/components/BuyNftModal.tsx b/src/views/Referral/components/BuyNftModal.tsx
index dcf6f69..ff31720 100644
--- a/src/views/Referral/components/BuyNftModal.tsx
+++ b/src/views/Referral/components/BuyNftModal.tsx
@@ -1,10 +1,10 @@
import React from 'react'
import styled from 'styled-components'
import { useTranslation } from 'contexts/Localization'
+import { useReferralNormalConfigInfo, useReferralCommanderConfigInfo } from 'state/referral/hooks'
import { Flex, Button, Modal, Image } from '@pancakeswap/uikit'
import TextFlex from './TextFlex'
import FlexCom from './FlexCom'
-import { useBuyTransaction } from '../hooks'
const ModalDiv = styled(Modal)`
width: 80%;
@@ -50,15 +50,19 @@ const ImageDiv = styled(Image)`
const BuyNftModal: React.FC = () => {
const { t } = useTranslation()
- const sendBuyTransaction = useBuyTransaction()
+ const referralCommanderConfigInfo = useReferralCommanderConfigInfo()
+ const referralRewardInfo = useReferralNormalConfigInfo()
// const onDismiss = () => {}
- const handleBuy = () => {
- sendBuyTransaction()
- }
return (
-
+
-
+
+ {/* */}
{
/>
-
-
+
+
@@ -75,7 +79,7 @@ const BuyNftModal: React.FC = () => {
- {t('Buy It Now')}
+ {t('Buy It Now')}
)
diff --git a/src/views/Referral/components/Connected.tsx b/src/views/Referral/components/Connected.tsx
index 5a4550f..6407c7b 100644
--- a/src/views/Referral/components/Connected.tsx
+++ b/src/views/Referral/components/Connected.tsx
@@ -2,6 +2,12 @@ import React from 'react'
import styled from 'styled-components'
import { useTranslation } from 'contexts/Localization'
import { Button, useModal, Text } from '@pancakeswap/uikit'
+import { inviteReceive } from 'services/referral'
+import {
+ useReferralNormalConfigInfo,
+ useReferralCommanderConfigInfo,
+ useReferralRewardInfo,
+} from 'state/referral/hooks'
import FlexCom from './FlexCom'
import BuyNftModal from './BuyNftModal'
import HeaderMain from './HeaderMain'
@@ -13,6 +19,13 @@ const ButtonDiv = styled(Button)`
border: 1px solid ${({ theme }) => theme.colors.textDisabled};
color: ${({ theme }) => theme.colors.textDisabled};
`
+const ButtonGet = styled(Button)`
+ width: 100%;
+ margin: 20px auto 0px auto;
+ border-radius: 50px;
+ border: 1px solid #1fc7d4;
+ color: #1fc7d4;
+`
const UpBtn = styled(Button)`
width: 100%;
@@ -41,23 +54,44 @@ const TextDiv = styled(Text)`
const ConnectedCom: React.FC = () => {
const { t } = useTranslation()
const [onBuyModal] = useModal()
-
+ const referralNormalConfigInfo = useReferralNormalConfigInfo()
+ console.log('referralNormalConfigInfo:', referralNormalConfigInfo)
+ const referralRewardInfo = useReferralRewardInfo()
+ console.log('referralRewardInfo:', referralRewardInfo)
+ const referralCommanderConfigInfo = useReferralCommanderConfigInfo()
+ const getInviteReceive = async () => {
+ await inviteReceive()
+ }
return (
<>
-
-
-
+
+
+
>
- {t('No income is received temporarily')}
+ {referralNormalConfigInfo.receiveLimit <=
+ referralRewardInfo.inviteReward - referralRewardInfo.inviteRewardReceive ? (
+
+ {t('Claim now')}
+
+ ) : (
+ {t('No income is received temporarily')}
+ )}
+
{t('Upgrade commander')}
- {t('each time')}
+ {`${t(
+ 'By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins',
+ )}${referralCommanderConfigInfo.dividendFirst / 10000}%${t('The commission')}`}
+ {/* {t('each time')}
{t('last bid')}
- {t('commission fee')}
+ {t('commission fee')} */}
)
diff --git a/src/views/Referral/components/HeaderMain.tsx b/src/views/Referral/components/HeaderMain.tsx
index 43119fa..32276aa 100644
--- a/src/views/Referral/components/HeaderMain.tsx
+++ b/src/views/Referral/components/HeaderMain.tsx
@@ -3,7 +3,7 @@ import styled from 'styled-components'
import { Image, Heading } from '@pancakeswap/uikit'
interface HeaderProp {
- title: string
+ title?: string
}
const HeadingDiv = styled(Heading)`
@@ -17,7 +17,7 @@ const TipDiv = styled(Image)`
top: 24px;
left: 0;
`
-const HeaderMain: React.FC = ({ title }) => {
+const HeaderMain: React.FC = ({ title = '' }) => {
return (
{title}
diff --git a/src/views/Referral/components/Regimental.tsx b/src/views/Referral/components/Regimental.tsx
index dabd677..d88649e 100644
--- a/src/views/Referral/components/Regimental.tsx
+++ b/src/views/Referral/components/Regimental.tsx
@@ -1,9 +1,10 @@
import React from 'react'
import styled from 'styled-components'
import { useTranslation } from 'contexts/Localization'
-import { Text, Image, Button } from '@pancakeswap/uikit'
+import { inviteReceive } from 'services/referral'
+import { useReferralCommanderConfigInfo, useReferralRewardInfo } from 'state/referral/hooks'
+import { Text, Image, Button, Heading } from '@pancakeswap/uikit'
import FlexCom from './FlexCom'
-import HeaderMain from './HeaderMain'
const ButtonDiv = styled(Button)`
width: 100%;
@@ -12,6 +13,13 @@ const ButtonDiv = styled(Button)`
border: 1px solid ${({ theme }) => theme.colors.textDisabled};
color: ${({ theme }) => theme.colors.textDisabled};
`
+const ButtonGet = styled(Button)`
+ width: 100%;
+ margin: 20px auto 0px auto;
+ border-radius: 50px;
+ border: 1px solid #1fc7d4;
+ color: #1fc7d4;
+`
const UpBtn = styled(Button)`
width: 100%;
@@ -62,24 +70,48 @@ const LogoImage = styled.div`
align-items: center;
justify-content: center;
`
+const HeadingDiv = styled(Heading)`
+ padding-top: 30px;
+ position: relative;
+`
const RegimentalCom: React.FC = () => {
const { t } = useTranslation()
+ const referralCommanderConfigInfo = useReferralCommanderConfigInfo()
+ console.log(referralCommanderConfigInfo)
+ const referralRewardInfo = useReferralRewardInfo()
+ const getInviteReceive = async () => {
+ await inviteReceive()
+ }
return (
-
+
+ {referralCommanderConfigInfo.properties.name}
+
-
+
+ {/* */}
<>
-
+
+
+
+
+
+ {/*
{
leftColor="textSubtle"
value="100000.00(HCC)"
/>
-
-
+
+ */}
>
- {t('No income is received temporarily')}
- {/* {t('Upgrade commander')} */}
+ {referralCommanderConfigInfo.receiveLimit <=
+ referralRewardInfo.inviteReward - referralRewardInfo.inviteRewardReceive ? (
+
+ {t('Claim now')}
+
+ ) : (
+ {t('No income is received temporarily')}
+ )}
+
+ {/* {t('Upgrade commander')} */}
- {t('each time')}
+ {`${t(
+ 'By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins',
+ )}${referralCommanderConfigInfo.dividendFirst / 10000}%${t('The commission')}`}
+ {/* {t('each time')}
{t('last bid')}
- {t('commission fee')}
+ {t('commission fee')} */}
diff --git a/src/views/Referral/components/UnunitedCom.tsx b/src/views/Referral/components/UnunitedCom.tsx
index 2961506..7dd42e2 100644
--- a/src/views/Referral/components/UnunitedCom.tsx
+++ b/src/views/Referral/components/UnunitedCom.tsx
@@ -32,9 +32,9 @@ const UnunitedCom: React.FC = () => {
- {t('each time')}
+ {/* {t('each time')}
{t('last bid')}
- {t('commission fee')}
+ {t('commission fee')} */}
>
)
diff --git a/src/views/Referral/index.tsx b/src/views/Referral/index.tsx
index 911f214..1eec00b 100644
--- a/src/views/Referral/index.tsx
+++ b/src/views/Referral/index.tsx
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
import styled from 'styled-components'
import { fetchReferralInfoAsync } from 'state/actions'
import { useAccount } from 'state/userInfo/hooks'
-import { useReferralCommanderConfigInfo } from 'state/referral/hooks'
+import { useReferralIsCommander } from 'state/referral/hooks'
import { useDispatch } from 'react-redux'
import UnunitedCom from './components/UnunitedCom'
import ConnectedCom from './components/Connected'
@@ -37,20 +37,31 @@ const ContentDiv = styled.div`
`
const Nft: React.FC = () => {
- // 邀请false普通邀请 true军团长邀请
- const [type, setType] = useState(false)
const dispatch = useDispatch()
const account = useAccount()
- const referralConfigInfo = useReferralCommanderConfigInfo()
- console.log(referralConfigInfo)
+ const referralIsCommander = useReferralIsCommander()
+ // const referralIsCommander = false
+ console.log('referralIsCommander:', referralIsCommander)
useEffect(() => {
dispatch(fetchReferralInfoAsync(account))
}, [account])
return (
- {type ? : {account ? : }}
+ {referralIsCommander ? (
+ <>
+ {account ? (
+
+ ) : (
+
+
+
+ )}
+ >
+ ) : (
+ {account ? : }
+ )}
)
}