From eeb4d0d07cb2656fcb0dffc89e578765f4deb746 Mon Sep 17 00:00:00 2001 From: myf <> Date: Sun, 24 Apr 2022 18:50:13 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/announcement/goback-icon.svg | 10 ++ public/images/announcement/search-icon.svg | 10 ++ public/locales/zh-CN.json | 9 +- src/App.tsx | 5 + src/components/Menu/config.ts | 5 + src/config/localization/translations.json | 9 +- src/services/announcement.ts | 18 ++ src/views/Announcement/components/Detail.tsx | 67 +++++++ .../Announcement/components/ListItem.tsx | 53 ++++++ src/views/Announcement/index.tsx | 170 ++++++++++++++++++ src/views/Board/components/HeaderItem.tsx | 36 ++++ src/views/Board/index.tsx | 19 +- 12 files changed, 406 insertions(+), 5 deletions(-) create mode 100644 public/images/announcement/goback-icon.svg create mode 100644 public/images/announcement/search-icon.svg create mode 100644 src/services/announcement.ts create mode 100644 src/views/Announcement/components/Detail.tsx create mode 100644 src/views/Announcement/components/ListItem.tsx create mode 100644 src/views/Announcement/index.tsx create mode 100644 src/views/Board/components/HeaderItem.tsx diff --git a/public/images/announcement/goback-icon.svg b/public/images/announcement/goback-icon.svg new file mode 100644 index 0000000..1d83b63 --- /dev/null +++ b/public/images/announcement/goback-icon.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/public/images/announcement/search-icon.svg b/public/images/announcement/search-icon.svg new file mode 100644 index 0000000..84de184 --- /dev/null +++ b/public/images/announcement/search-icon.svg @@ -0,0 +1,10 @@ + + + + + + diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 232069f..4c120fa 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1105,6 +1105,13 @@ "Assets and chain":"资产公链", "each time":"1.当倒计时少于1小时时,每次加价增加倒计时时间1小时", "last bid":"2.拍卖每次固定加价10%,倒计时结束后,拍卖品由最后出价的出价人获得", - "commission fee":"3.拍卖成功后,平台将收取发布人收益的6%作为手续费" + "commission fee":"3.拍卖成功后,平台将收取发布人收益的6%作为手续费", + "announcement":"公告", + "return":"返回", + "Total capital pool":"资金池总额", + "The total amount of dividends":"分红总额", + "Pending dividend":"待领取分红", + "Number of boards":"董事会数量", + "Number of holders":"持有人数量" } diff --git a/src/App.tsx b/src/App.tsx index 56fa646..44c7424 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -52,6 +52,7 @@ const RemoveLiquidity = lazy(() => import('./views/RemoveLiquidity')) const Referral = lazy(() => import('./views/Referral')) const Board = lazy(() => import('./views/Board')) const Nft = lazy(() => import('./views/Nft')) +const Announcement = lazy(() => import('./views/Announcement')) // This config is required for number formatting BigNumber.config({ @@ -103,6 +104,9 @@ const App: React.FC = () => { + + + {/* @@ -153,6 +157,7 @@ const App: React.FC = () => { + {/* Redirect */} {/* diff --git a/src/components/Menu/config.ts b/src/components/Menu/config.ts index 3516e8d..9244c4a 100644 --- a/src/components/Menu/config.ts +++ b/src/components/Menu/config.ts @@ -50,6 +50,11 @@ const config: (t: ContextApi['t']) => MenuEntry[] = (t) => [ icon: 'TicketIcon', href: '/board', }, + { + label: t('announcement'), + icon: 'TicketIcon', + href: '/announcement', + }, // { // label: t('Prediction (BETA)'), // icon: 'PredictionsIcon', diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index e7f2c6e..6cc8b8b 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1232,5 +1232,12 @@ "Assets and chain":"Assets and chain", "each time":"1. When the countdown is less than 1 hour, the countdown time will be increased by 1 hour each time", "last bid":"2. Each auction has a fixed 10% markup. After the countdown, the item will be awarded to the bidder who made the last bid", - "commission fee":"3. After the auction is successful, the platform will charge 6% of the publisher's earnings as a commission fee" + "commission fee":"3. After the auction is successful, the platform will charge 6% of the publisher's earnings as a commission fee", + "announcement":"announcement", + "return":"return", + "Total capital pool":"Total capital pool", + "The total amount of dividends":"The total amount of dividends", + "Pending dividend":"Pending dividend", + "Number of boards":"Number of boards", + "Number of holders":"Number of holders" } diff --git a/src/services/announcement.ts b/src/services/announcement.ts new file mode 100644 index 0000000..bd4131e --- /dev/null +++ b/src/services/announcement.ts @@ -0,0 +1,18 @@ +import request from 'utils/request' + +export const getAnnouncementPage = (params) => { + return request.request({ + url: '/high_city/app/api/announcement/page', + method: 'get', + params, + }) +} + +export const getAnnouncementDetail = (id) => { + return request.request({ + url: `/high_city/app/api/announcement/detail/${id}`, + method: 'get', + }) +} + +export default getAnnouncementPage diff --git a/src/views/Announcement/components/Detail.tsx b/src/views/Announcement/components/Detail.tsx new file mode 100644 index 0000000..8186d32 --- /dev/null +++ b/src/views/Announcement/components/Detail.tsx @@ -0,0 +1,67 @@ +import React, { useState, useEffect, useMemo, useRef } from 'react' +import dayjs from 'dayjs' +import styled from 'styled-components' +import { useTranslation } from 'contexts/Localization' +import { Text, Flex, Image, Input, Heading } from '@pancakeswap/uikit' + +interface ListProps { + title?: string + publishTime?: number + content?: string + close: () => void +} + +const DetailDiv = styled.div` + width: 80%; + background: rgba(255, 255, 255); + border-radius: 20px; + margin: 0 auto; + box-sizing: border-box; + padding: 40px 30px; +` +const HeaderFlex = styled(Flex)` + align-items: center; + cursor: pointer; +` +const TextBack = styled(Text)` + font-size: 18px; + color: #1fc7d4; + margin-left: 10px; +` +const HeadingText = styled(Heading)` + margin-top: 17px; + color: #333333; + font-size: 32px; +` +const TextTime = styled(Text)` + font-size: 14px; + color: #999999; + padding: 30px 0 20px 0; + border-bottom: 1px solid #e3e3e3; +` +const TextInfo = styled(Text)` + font-size: 14px; + color: #999999; + margin-top: 30px; +` + +const Detail: React.FC = ({ title, publishTime, content, close }) => { + const { t } = useTranslation() + const closeDetail = () => { + close() + } + return ( + <> + + + + {t('return')} + + {title} + {dayjs(publishTime).format('YYYY-MM-DD HH:mm')} + {content} + + + ) +} +export default Detail diff --git a/src/views/Announcement/components/ListItem.tsx b/src/views/Announcement/components/ListItem.tsx new file mode 100644 index 0000000..9f9f1df --- /dev/null +++ b/src/views/Announcement/components/ListItem.tsx @@ -0,0 +1,53 @@ +import React, { useState } from 'react' +import styled from 'styled-components' +import { Text, Flex } from '@pancakeswap/uikit' + +interface InfoProps { + title?: string + content?: string + publishTime?: number +} + +const FlexTable = styled(Flex)` + padding: 25px 0 20px 0; + align-items: center; + justify-content: space-between; + cursor: pointer; + border-bottom: 1px solid #e3e3e3; +` +const TableInfo = styled.div` + width: 70%; +` +const TextTitle = styled(Text)` + font-size: 18px; + color: #333333; +` +const TextInfo = styled(Text)` + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + font-size: 14px; + color: #666666; + margin-top: 10px; +` +const TextTime = styled(Text)` + font-size: 18px; + color: #999999; +` + +const ListItem: React.FC = ({ title, content, publishTime }) => { + return ( + <> + + + {title} + {content} + + {publishTime} + + + ) +} +export default ListItem diff --git a/src/views/Announcement/index.tsx b/src/views/Announcement/index.tsx new file mode 100644 index 0000000..60b1d14 --- /dev/null +++ b/src/views/Announcement/index.tsx @@ -0,0 +1,170 @@ +import React, { useState, useEffect, useMemo, useRef } from 'react' +import styled from 'styled-components' +import { getAnnouncementPage, getAnnouncementDetail } from 'services/announcement' +import { Text, Flex, Image, Input, Heading } from '@pancakeswap/uikit' +import ListItem from './components/ListItem' +import Detail from './components/Detail' + +interface DetailProps { + title?: string + content?: string + publishTime?: number +} + +const MainDiv = styled.div` + width: 100%; + min-height: calc(100vh - 64px); + background: ${({ theme }) => theme.colors.gradients.bubblegum}; + box-sizing: border-box; + padding: 30px 0; +` +const TableDiv = styled.div` + width: 80%; + background: rgba(255, 255, 255); + border-radius: 20px; + margin: 0 auto; +` + +const SearchDiv = styled(Flex)` + box-sizing: border-box; + border-bottom: 1px solid #e3e3e3; + width: 100%; + height: 105px; + align-items: center; + justify-content: center; +` + +const InputMain = styled(Flex)` + width: 60%; + height: 45px; + border: 1px solid #1fc7d4; + border-radius: 30px; + box-sizing: border-box; + align-items: center; + justify-content: space-between; + padding: 0 4px; +` + +const SearchInput = styled(Input)` + background-color: transparent; + width: calc(100% - 80px); + :focus { + } +` +const SearchBtn = styled.div` + width: 50px; + height: 37px; + background: linear-gradient(90deg, #1fd4b0 0%, #1fc9d3 100%); + border-radius: 19px; + display: flex; + align-items: center; + justify-content: center; +` + +const ListMain = styled.div` + box-sizing: border-box; + padding: 0 30px; +` + +const FlexTable = styled(Flex)` + padding: 25px 0 20px 0; + align-items: center; + justify-content: space-between; +` +const TableInfo = styled.div` + width: 70%; +` +const TextTitle = styled(Text)` + font-size: 18px; + color: #333333; +` +const DetailDiv = styled.div` + width: 80%; + background: rgba(255, 255, 255); + border-radius: 20px; + margin: 0 auto; + box-sizing: border-box; + padding: 40px 30px; +` +const HeaderFlex = styled(Flex)` + align-items: center; + cursor: pointer; +` +const TextBack = styled(Text)` + font-size: 18px; + color: #1fc7d4; + margin-left: 10px; +` +const HeadingText = styled(Heading)` + margin-top: 17px; + color: #333333; + font-size: 32px; +` +const TextTime = styled(Text)` + font-size: 14px; + color: #999999; + padding: 30px 0 20px 0; + border-bottom: 1px solid #e3e3e3; +` +const TextInfo = styled(Text)` + font-size: 14px; + color: #999999; + margin-top: 30px; +` + +const Announcement: React.FC = () => { + const [detailVisible, setDetailVisible] = useState(false) + const [list, setList] = useState([]) + const [detailData, setDetailData] = useState({ 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) + } + return ( + + {detailVisible ? ( + + ) : ( + + + + + + + + + + + {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()} From f1af3c0a28a11175f7e95a1d8fb284fae8c53caa Mon Sep 17 00:00:00 2001 From: myf <> Date: Sun, 24 Apr 2022 19:31:01 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E9=83=A8=E5=88=86=E5=86=9B=E5=9B=A2?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Referral/components/BuyNftModal.tsx | 13 +++---- src/views/Referral/components/Connected.tsx | 36 ++++++++++++++++--- src/views/Referral/components/Regimental.tsx | 36 ++++++++++++++++--- src/views/Referral/index.tsx | 22 ++++++++---- 4 files changed, 83 insertions(+), 24 deletions(-) diff --git a/src/views/Referral/components/BuyNftModal.tsx b/src/views/Referral/components/BuyNftModal.tsx index dcf6f69..8d9668a 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 } 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,11 +50,8 @@ const ImageDiv = styled(Image)` const BuyNftModal: React.FC = () => { const { t } = useTranslation() - const sendBuyTransaction = useBuyTransaction() + const referralRewardInfo = useReferralNormalConfigInfo() // const onDismiss = () => {} - const handleBuy = () => { - sendBuyTransaction() - } return ( @@ -66,8 +63,8 @@ const BuyNftModal: React.FC = () => { /> - - + + @@ -75,7 +72,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..e89a475 100644 --- a/src/views/Referral/components/Connected.tsx +++ b/src/views/Referral/components/Connected.tsx @@ -2,6 +2,8 @@ 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, useReferralRewardInfo } from 'state/referral/hooks' import FlexCom from './FlexCom' import BuyNftModal from './BuyNftModal' import HeaderMain from './HeaderMain' @@ -13,6 +15,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,17 +50,34 @@ 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 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')} diff --git a/src/views/Referral/components/Regimental.tsx b/src/views/Referral/components/Regimental.tsx index dabd677..74d0493 100644 --- a/src/views/Referral/components/Regimental.tsx +++ b/src/views/Referral/components/Regimental.tsx @@ -1,6 +1,8 @@ import React from 'react' import styled from 'styled-components' import { useTranslation } from 'contexts/Localization' +import { inviteReceive } from 'services/referral' +import { useReferralCommanderConfigInfo, useReferralRewardInfo } from 'state/referral/hooks' import { Text, Image, Button } from '@pancakeswap/uikit' import FlexCom from './FlexCom' import HeaderMain from './HeaderMain' @@ -12,6 +14,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%; @@ -65,6 +74,12 @@ const LogoImage = styled.div` const RegimentalCom: React.FC = () => { const { t } = useTranslation() + const referralCommanderConfigInfo = useReferralCommanderConfigInfo() + console.log(referralCommanderConfigInfo) + const referralRewardInfo = useReferralRewardInfo() + const getInviteReceive = async () => { + await inviteReceive() + } return ( @@ -79,7 +94,7 @@ const RegimentalCom: React.FC = () => { name={t('HCC total revenue percentage :10%')} paddings="0 10px" leftColor="textSubtle" - value="100000.00(HCC)" + value={`${referralCommanderConfigInfo.dividendFirst}%`} /> { 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')} diff --git a/src/views/Referral/index.tsx b/src/views/Referral/index.tsx index 911f214..0826bcb 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,30 @@ 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 = true useEffect(() => { dispatch(fetchReferralInfoAsync(account)) }, [account]) return ( - {type ? : {account ? : }} + {referralIsCommander ? ( + <> + {account ? ( + + ) : ( + + + + )} + + ) : ( + {account ? : } + )} ) } From 43e8c5f7f763b36a7901b6e20cf518727b117482 Mon Sep 17 00:00:00 2001 From: myf <> Date: Sun, 24 Apr 2022 20:12:56 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E9=83=A8=E5=88=86=E5=86=9B=E5=9B=A2?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/referral.ts | 7 +++++++ src/types/referral.ts | 1 + src/views/Referral/index.tsx | 1 + 3 files changed, 9 insertions(+) diff --git a/src/services/referral.ts b/src/services/referral.ts index e4a8f18..1367736 100644 --- a/src/services/referral.ts +++ b/src/services/referral.ts @@ -14,4 +14,11 @@ export const withdrawReward = () => { }) } +export const inviteReceive = () => { + return request.request({ + url: '/high_city/app/api/invite/reward/receive', + method: 'get', + }) +} + export default getReferralInfo diff --git a/src/types/referral.ts b/src/types/referral.ts index 0b3ae64..43cecd0 100644 --- a/src/types/referral.ts +++ b/src/types/referral.ts @@ -6,6 +6,7 @@ export enum ReferralConfigType { export interface ReferralConfigInfo { dividendFirst?: number dividendSecond?: number + receiveLimit?: number id?: number properties?: Record type?: string diff --git a/src/views/Referral/index.tsx b/src/views/Referral/index.tsx index 0826bcb..8955125 100644 --- a/src/views/Referral/index.tsx +++ b/src/views/Referral/index.tsx @@ -42,6 +42,7 @@ const Nft: React.FC = () => { const referralIsCommander = useReferralIsCommander() // const referralIsCommander = true + console.log('referralIsCommander:', referralIsCommander) useEffect(() => { dispatch(fetchReferralInfoAsync(account)) }, [account]) From b37c638f64067add5d0879bbceca06486268e142 Mon Sep 17 00:00:00 2001 From: myf <> Date: Sun, 24 Apr 2022 20:46:16 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E9=83=A8=E5=88=86=E5=86=9B=E5=9B=A2?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/zh-CN.json | 5 +++-- src/config/localization/translations.json | 4 +++- src/views/Referral/components/BuyNftModal.tsx | 4 ++-- src/views/Referral/components/Regimental.tsx | 15 +++++++++++++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 4c120fa..1beffd8 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1112,6 +1112,7 @@ "The total amount of dividends":"分红总额", "Pending dividend":"待领取分红", "Number of boards":"董事会数量", - "Number of holders":"持有人数量" - + "Number of holders":"持有人数量", + "total revenue":"总收益", + "revenue":"收益" } diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index 6cc8b8b..cc38b45 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1239,5 +1239,7 @@ "The total amount of dividends":"The total amount of dividends", "Pending dividend":"Pending dividend", "Number of boards":"Number of boards", - "Number of holders":"Number of holders" + "Number of holders":"Number of holders", + "total revenue":"total revenue", + "revenue":"revenue" } diff --git a/src/views/Referral/components/BuyNftModal.tsx b/src/views/Referral/components/BuyNftModal.tsx index 8d9668a..1340163 100644 --- a/src/views/Referral/components/BuyNftModal.tsx +++ b/src/views/Referral/components/BuyNftModal.tsx @@ -63,8 +63,8 @@ const BuyNftModal: React.FC = () => { /> - - + + diff --git a/src/views/Referral/components/Regimental.tsx b/src/views/Referral/components/Regimental.tsx index 74d0493..db18e9d 100644 --- a/src/views/Referral/components/Regimental.tsx +++ b/src/views/Referral/components/Regimental.tsx @@ -89,7 +89,18 @@ const RegimentalCom: React.FC = () => { <> - + + + + + + {/* { + /> */} From b1c951cb06a20e5457d89356194ad65b60c87c93 Mon Sep 17 00:00:00 2001 From: myf <> Date: Sun, 24 Apr 2022 21:13:11 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E9=83=A8=E5=88=86=E5=86=9B=E5=9B=A2?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Referral/components/HeaderMain.tsx | 4 ++-- src/views/Referral/components/Regimental.tsx | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) 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 db18e9d..e13d452 100644 --- a/src/views/Referral/components/Regimental.tsx +++ b/src/views/Referral/components/Regimental.tsx @@ -3,9 +3,8 @@ import styled from 'styled-components' import { useTranslation } from 'contexts/Localization' import { inviteReceive } from 'services/referral' import { useReferralCommanderConfigInfo, useReferralRewardInfo } from 'state/referral/hooks' -import { Text, Image, Button } from '@pancakeswap/uikit' +import { Text, Image, Button, Heading } from '@pancakeswap/uikit' import FlexCom from './FlexCom' -import HeaderMain from './HeaderMain' const ButtonDiv = styled(Button)` width: 100%; @@ -71,6 +70,10 @@ 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() @@ -83,9 +86,12 @@ const RegimentalCom: React.FC = () => { return ( - + + {referralCommanderConfigInfo.properties.name} + - + + {/* */} <> From 491f13b17202583bc5dd681ac605d54e664b79c6 Mon Sep 17 00:00:00 2001 From: myf <> Date: Sun, 24 Apr 2022 21:18:40 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E9=83=A8=E5=88=86=E5=86=9B=E5=9B=A2?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/zh-CN.json | 3 ++- src/config/localization/translations.json | 3 ++- src/views/Referral/components/BuyNftModal.tsx | 13 ++++++++++--- src/views/Referral/index.tsx | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 1beffd8..fd94b58 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1114,5 +1114,6 @@ "Number of boards":"董事会数量", "Number of holders":"持有人数量", "total revenue":"总收益", - "revenue":"收益" + "revenue":"收益", + "purchase":"购买" } diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index cc38b45..38f3750 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1241,5 +1241,6 @@ "Number of boards":"Number of boards", "Number of holders":"Number of holders", "total revenue":"total revenue", - "revenue":"revenue" + "revenue":"revenue", + "purchase":"purchase" } diff --git a/src/views/Referral/components/BuyNftModal.tsx b/src/views/Referral/components/BuyNftModal.tsx index 1340163..ff31720 100644 --- a/src/views/Referral/components/BuyNftModal.tsx +++ b/src/views/Referral/components/BuyNftModal.tsx @@ -1,7 +1,7 @@ import React from 'react' import styled from 'styled-components' import { useTranslation } from 'contexts/Localization' -import { useReferralNormalConfigInfo } from 'state/referral/hooks' +import { useReferralNormalConfigInfo, useReferralCommanderConfigInfo } from 'state/referral/hooks' import { Flex, Button, Modal, Image } from '@pancakeswap/uikit' import TextFlex from './TextFlex' import FlexCom from './FlexCom' @@ -50,12 +50,19 @@ const ImageDiv = styled(Image)` const BuyNftModal: React.FC = () => { const { t } = useTranslation() + const referralCommanderConfigInfo = useReferralCommanderConfigInfo() const referralRewardInfo = useReferralNormalConfigInfo() // const onDismiss = () => {} return ( - + - + + {/* */} { const dispatch = useDispatch() const account = useAccount() - const referralIsCommander = useReferralIsCommander() - // const referralIsCommander = true + // const referralIsCommander = useReferralIsCommander() + const referralIsCommander = false console.log('referralIsCommander:', referralIsCommander) useEffect(() => { dispatch(fetchReferralInfoAsync(account)) From 0cee519744feed45d289a01093b19e20e8c64a98 Mon Sep 17 00:00:00 2001 From: myf <> Date: Sun, 24 Apr 2022 21:30:47 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/zh-CN.json | 3 ++- src/config/localization/translations.json | 3 ++- src/views/Announcement/index.tsx | 25 ++++++++++++++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index fd94b58..3406185 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1115,5 +1115,6 @@ "Number of holders":"持有人数量", "total revenue":"总收益", "revenue":"收益", - "purchase":"购买" + "purchase":"购买", + "Enter a keyword search":"输入关键字搜索" } diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index 38f3750..7a06a8d 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1242,5 +1242,6 @@ "Number of holders":"Number of holders", "total revenue":"total revenue", "revenue":"revenue", - "purchase":"purchase" + "purchase":"purchase", + "Enter a keyword search":"Enter a keyword search" } diff --git a/src/views/Announcement/index.tsx b/src/views/Announcement/index.tsx index 60b1d14..0bacc21 100644 --- a/src/views/Announcement/index.tsx +++ b/src/views/Announcement/index.tsx @@ -1,5 +1,6 @@ import React, { useState, useEffect, useMemo, useRef } from 'react' import styled from 'styled-components' +import { useTranslation } from 'contexts/Localization' import { getAnnouncementPage, getAnnouncementDetail } from 'services/announcement' import { Text, Flex, Image, Input, Heading } from '@pancakeswap/uikit' import ListItem from './components/ListItem' @@ -113,6 +114,9 @@ const TextInfo = styled(Text)` ` const Announcement: React.FC = () => { + const { t } = useTranslation() + const loadMoreRef = useRef(null) + const [detailVisible, setDetailVisible] = useState(false) const [list, setList] = useState([]) const [detailData, setDetailData] = useState({ title: '', publishTime: 0, content: '' }) @@ -136,6 +140,19 @@ const Announcement: React.FC = () => { const close = () => { setDetailVisible(false) } + + const renderContent = (): JSX.Element => { + return ( +
+ {list.map((item) => ( + lookDetail(item.id)}> + + + ))} +
+ ) + } + return ( {detailVisible ? ( @@ -149,18 +166,20 @@ const Announcement: React.FC = () => { - + - {list.map((item) => ( + {renderContent()} +
+ {/* {list.map((item) => ( lookDetail(item.id)}> - ))} + ))} */} )} From 5b32d7024517758293ddf0f744da6a25d33c5952 Mon Sep 17 00:00:00 2001 From: myf <> Date: Mon, 25 Apr 2022 09:43:46 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E9=83=A8=E5=88=86=E5=86=9B=E5=9B=A2?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/zh-CN.json | 4 +++- src/config/localization/translations.json | 4 +++- src/views/Referral/components/Connected.tsx | 14 +++++++++++--- src/views/Referral/components/Regimental.tsx | 7 +++++-- src/views/Referral/components/UnunitedCom.tsx | 4 ++-- src/views/Referral/index.tsx | 4 ++-- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/public/locales/zh-CN.json b/public/locales/zh-CN.json index 3406185..5592efc 100644 --- a/public/locales/zh-CN.json +++ b/public/locales/zh-CN.json @@ -1116,5 +1116,7 @@ "total revenue":"总收益", "revenue":"收益", "purchase":"购买", - "Enter a keyword search":"输入关键字搜索" + "Enter a keyword search":"输入关键字搜索", + "By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins":"使用页面右上方的邀请,可邀请新用户进入,并在用户购买币后获得", + "The commission":"的提成!" } diff --git a/src/config/localization/translations.json b/src/config/localization/translations.json index 7a06a8d..4373195 100644 --- a/src/config/localization/translations.json +++ b/src/config/localization/translations.json @@ -1243,5 +1243,7 @@ "total revenue":"total revenue", "revenue":"revenue", "purchase":"purchase", - "Enter a keyword search":"Enter a keyword search" + "Enter a keyword search":"Enter a keyword search", + "By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins":"By using the invitation at the top right of the page, new users can be invited to enter and obtained after users purchase coins", + "The commission":"The commission!" } diff --git a/src/views/Referral/components/Connected.tsx b/src/views/Referral/components/Connected.tsx index e89a475..6407c7b 100644 --- a/src/views/Referral/components/Connected.tsx +++ b/src/views/Referral/components/Connected.tsx @@ -3,7 +3,11 @@ import styled from 'styled-components' import { useTranslation } from 'contexts/Localization' import { Button, useModal, Text } from '@pancakeswap/uikit' import { inviteReceive } from 'services/referral' -import { useReferralNormalConfigInfo, useReferralRewardInfo } from 'state/referral/hooks' +import { + useReferralNormalConfigInfo, + useReferralCommanderConfigInfo, + useReferralRewardInfo, +} from 'state/referral/hooks' import FlexCom from './FlexCom' import BuyNftModal from './BuyNftModal' import HeaderMain from './HeaderMain' @@ -54,6 +58,7 @@ const ConnectedCom: React.FC = () => { console.log('referralNormalConfigInfo:', referralNormalConfigInfo) const referralRewardInfo = useReferralRewardInfo() console.log('referralRewardInfo:', referralRewardInfo) + const referralCommanderConfigInfo = useReferralCommanderConfigInfo() const getInviteReceive = async () => { await inviteReceive() } @@ -81,9 +86,12 @@ const ConnectedCom: React.FC = () => { {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/Regimental.tsx b/src/views/Referral/components/Regimental.tsx index e13d452..d88649e 100644 --- a/src/views/Referral/components/Regimental.tsx +++ b/src/views/Referral/components/Regimental.tsx @@ -140,9 +140,12 @@ const RegimentalCom: React.FC = () => { {/* {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 66a90d8..1eec00b 100644 --- a/src/views/Referral/index.tsx +++ b/src/views/Referral/index.tsx @@ -40,8 +40,8 @@ const Nft: React.FC = () => { const dispatch = useDispatch() const account = useAccount() - // const referralIsCommander = useReferralIsCommander() - const referralIsCommander = false + const referralIsCommander = useReferralIsCommander() + // const referralIsCommander = false console.log('referralIsCommander:', referralIsCommander) useEffect(() => { dispatch(fetchReferralInfoAsync(account))