Compare commits

..

No commits in common. "17ab1af400192a77ab374fdf254abfcb51a4317b" and "99fdcfc307a3f82608be60c4e155a8dcfce30d2a" have entirely different histories.

38 changed files with 127 additions and 291 deletions

View File

@ -1,3 +1,3 @@
REACT_APP_NAME = "Cloud Computing" REACT_APP_NAME = CoinWind
REACT_APP_I18N_ENABLED = true REACT_APP_I18N_ENABLED = true
REACT_APP_DEV_ENDPOINT = http://coinwind.test/ REACT_APP_DEV_ENDPOINT = http://coinwind.test/

5
package-lock.json generated
View File

@ -2434,11 +2434,6 @@
"resolved": "https://registry.npmjs.org/@fontsource/open-sans/-/open-sans-4.5.10.tgz", "resolved": "https://registry.npmjs.org/@fontsource/open-sans/-/open-sans-4.5.10.tgz",
"integrity": "sha512-MrtTDfWb1Tu9YxVh2KaKmsKBn6O3KL/lHZS0KRKK58jgqvdwuiDt4QW4udmW4FQf0XOWgnZ+4vKUF80F3SqBAA==" "integrity": "sha512-MrtTDfWb1Tu9YxVh2KaKmsKBn6O3KL/lHZS0KRKK58jgqvdwuiDt4QW4udmW4FQf0XOWgnZ+4vKUF80F3SqBAA=="
}, },
"@fontsource/roboto-flex": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/@fontsource/roboto-flex/-/roboto-flex-4.5.0.tgz",
"integrity": "sha512-4w944UkhoO+8rc/bJiSi0KLWWVfCcWGLtgjm6wsyQmSxn25zpJ6qBgSEqANin/R8k0Aou2n6R9nQTlhFOsvMkQ=="
},
"@humanwhocodes/config-array": { "@humanwhocodes/config-array": {
"version": "0.9.5", "version": "0.9.5",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz",

View File

@ -9,7 +9,6 @@
"@emotion/react": "^11.9.0", "@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1", "@emotion/styled": "^11.8.1",
"@fontsource/open-sans": "^4.5.10", "@fontsource/open-sans": "^4.5.10",
"@fontsource/roboto-flex": "^4.5.0",
"@testing-library/jest-dom": "^5.16.4", "@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^10.4.9", "@testing-library/react": "^10.4.9",
"@testing-library/user-event": "^12.8.3", "@testing-library/user-event": "^12.8.3",

BIN
public/favicon.ico.bak Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.png" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta name="description" content="New generation Defi platform" /> <meta name="description" content="New generation Defi platform" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -7,7 +7,6 @@ import { Layout } from './components'
import { Outlet } from 'react-router-dom' import { Outlet } from 'react-router-dom'
import { AppContextProvider } from './AppContext' import { AppContextProvider } from './AppContext'
import '@fontsource/open-sans/400.css' import '@fontsource/open-sans/400.css'
import '@fontsource/roboto-flex/400.css'
function App() { function App() {

View File

@ -3,7 +3,8 @@ import { config } from "./config"
import { get_settings } from './api' import { get_settings } from './api'
import { ImTwitter, ImTelegram, ImFacebook, ImWhatsapp } from "react-icons/im" import { ImTwitter, ImTelegram, ImFacebook, ImWhatsapp } from "react-icons/im"
import { import {
FiCloud, FiUser, FiUsers, FiHome, FiTrendingUp, FiLock,
FiActivity, FiUser, FiUsers,
} from 'react-icons/fi' } from 'react-icons/fi'
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
@ -40,7 +41,7 @@ export const AppContextProvider = ({ children }) => {
const [kefuUrl, setKefuUrl] = React.useState('') const [kefuUrl, setKefuUrl] = React.useState('')
const menuItems = [ const menuItems = [
{ name: t('cloud'), icon: FiCloud, path: '/home', enabled: true }, { name: t('mining'), icon: FiActivity, path: '/home', enabled: true },
{ name: t('account'), icon: FiUser, path: '/account', enabled: true }, { name: t('account'), icon: FiUser, path: '/account', enabled: true },
{ name: t('team'), icon: FiUsers, path: '/team', enabled: true }, { name: t('team'), icon: FiUsers, path: '/team', enabled: true },
] ]
@ -60,7 +61,7 @@ export const AppContextProvider = ({ children }) => {
const b = res.data.base const b = res.data.base
setTitle(o.title) setTitle(o.title)
document.title = config.APP_NAME + ' - DeFi platform for professor' document.title = o.title + ' - DeFi platform for professor'
let banr = [] let banr = []
o.banner?.forEach((item) => { o.banner?.forEach((item) => {
@ -74,14 +75,13 @@ export const AppContextProvider = ({ children }) => {
setBannerLink(s.pic_url) setBannerLink(s.pic_url)
let socl = [...SOCIALS] SOCIALS[0].path = b.telegram
socl[0].path = b.telegram SOCIALS[1].path = b.twitter
socl[1].path = b.twitter SOCIALS[2].path = b.facebook
socl[2].path = b.facebook SOCIALS[3].path = b.whatsapp
socl[3].path = b.whatsapp
setSocials(s) setSocials(SOCIALS)
setKefuUrl('whatsapp://send?phone=' + b.whatsapp) setKefuUrl(s.kefu_url)
setRewards(s.reward) setRewards(s.reward)
setAppAddress(s.app_address) setAppAddress(s.app_address)
setAppKey(s.app_key) setAppKey(s.app_key)

View File

@ -1,11 +1,10 @@
import { import {
Divider, Accordion, AccordionItem, Divider, Accordion, AccordionItem,
AccordionButton, Text, AccordionIcon, AccordionButton, Box, AccordionIcon,
AccordionPanel, Icon, Flex, AccordionPanel,
} from "@chakra-ui/react" } from "@chakra-ui/react"
import React from "react" import React from "react"
import { PanelHeader, VPanel } from "./Panels" import { PanelHeader, VPanel } from "./Panels"
import { FiHelpCircle } from 'react-icons/fi'
import parse from 'html-react-parser' import parse from 'html-react-parser'
@ -13,7 +12,7 @@ export const Faq = ({ articles, ...rest }) => {
return ( return (
<VPanel {...rest}> <VPanel {...rest}>
<PanelHeader header="Help Q&A" subHeader="" /> <PanelHeader header="Help Center" subHeader="Hope it help you" />
<Accordion w="full" allowToggle> <Accordion w="full" allowToggle>
@ -21,16 +20,14 @@ export const Faq = ({ articles, ...rest }) => {
articles && articles.map((a, index) => ( articles && articles.map((a, index) => (
<AccordionItem key={index}> <AccordionItem key={index}>
<h2> <h2>
<AccordionButton> <AccordionButton>
<Flex fontWeight='600' flex='1' textAlign='left' alignItems='center'> <Box fontWeight='600' flex='1' textAlign='left'>
<Icon as={FiHelpCircle} mr="2" /> {a.title}
<Text>{a.title}</Text> </Box>
</Flex>
<AccordionIcon /> <AccordionIcon />
</AccordionButton> </AccordionButton>
</h2> </h2>
<AccordionPanel pb={4} color='gray.500'> <AccordionPanel pb={4}>
{parse(a.content)} {parse(a.content)}
</AccordionPanel> </AccordionPanel>
</AccordionItem> </AccordionItem>

View File

@ -1,29 +0,0 @@
import { Image, Flex, IconButton } from "@chakra-ui/react"
export const FloatingBtn = ({ name, pic, url, ...rest }) => {
const onClick = () => {
window.location.href = url
}
return (
<Flex
w='14'
h='14'
position='fixed'
cursor='pointer'
zIndex='3'
{...rest}
>
<IconButton
w='13'
h='13'
variant='outline'
icon={
<Image src={pic} alt={name} />
}
onClick={onClick}
/>
</Flex>
)
}

View File

@ -15,16 +15,18 @@ export const Hero = ({ bg }) => {
> >
<VFStack align="start"> <VFStack align="start">
{/* <Logo p="4" /> */} {/* <HFStack my="4" px="4"> */}
<Logo p="4" />
{/* </HFStack> */}
<Placeholder h='30%' /> <Placeholder h='16' />
<VStack pl="4"> <VStack pl="4">
<Text <Text
fontWeight='700' fontWeight='700'
fontSize='22' fontSize='22'
color='white' color='white'
> >
Join in The Cloud Join The Team
</Text> </Text>
<Text <Text
fontWeight='700' fontWeight='700'

View File

@ -11,15 +11,18 @@ import '../swiper.css'
import { Pagination, Autoplay, Navigation } from "swiper" import { Pagination, Autoplay, Navigation } from "swiper"
const TAddress = ({ text }) => (<Text color='blue.500'>{text}</Text>) let format = [
{ address: '', quantity: 234234.05 }
const TQuantity = ({ text }) => (<Text fontWeight='500'>{text}</Text>) ]
export const LatestScreen = ({ data, ...rest }) => { export const LatestScreen = ({ data, ...rest }) => {
const TAddress = ({ text }) => (<Text color='blue.500'>{text}</Text>)
const TQuantity = ({ text }) => (<Text fontWeight='500'>{text}</Text>)
return ( return (
<VPanel {...rest}> <VPanel {...rest}>
<PanelHeader header="Cloud Computing" subHeader="Nodes of cloud output" /> <PanelHeader header="Mining" subHeader="Liquidity mining income" />
<HBetween py="2"> <HBetween py="2">
<Text <Text
@ -38,7 +41,7 @@ export const LatestScreen = ({ data, ...rest }) => {
slidesPerView={6} slidesPerView={6}
spaceBetween={0} spaceBetween={0}
// centeredSlides={true} // centeredSlides={true}
speed={3500} speed={5000}
loop={true} loop={true}
autoplay={{ autoplay={{
delay: 1, delay: 1,

View File

@ -1,20 +1,19 @@
import { import {
Box, useColorModeValue, Box, Drawer, DrawerContent,
useColorModeValue, useDisclosure, DrawerOverlay,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import React from 'react' import React from 'react'
import { SideBar } from './SideBar'
import { AppBar } from './AppBar'
import { BottomNav } from './BottomNav' import { BottomNav } from './BottomNav'
import { Hero } from './Hero' import { Hero } from './Hero'
import { HFStack } from './base' import { HFStack } from './base'
import { FloatingBtn } from './FloatingBtn'
import { Images } from '../data'
import { useApp } from '../AppContext'
/** /**
* This component was not composed for more widely using but just for this project. * This component was not composed for more widely using but just for this project.
*/ */
export const Layout = ({ children }) => { export const Layout = ({ children }) => {
const app = useApp() const { isOpen: isOpenDrawer, onOpen: onOpenDrawer, onClose: onCloseDrawer } = useDisclosure()
const bg = useColorModeValue('gray.100', 'gray.900') const bg = useColorModeValue('gray.100', 'gray.900')
@ -37,14 +36,6 @@ export const Layout = ({ children }) => {
{children} {children}
</Box> </Box>
<FloatingBtn
right='2'
bottom='40'
name='whatsapp'
pic={Images.whatsapp}
url={app.kefuUrl}
/>
<BottomNav zIndex="1" display={{ base: 'flex', md: 'none' }} /> <BottomNav zIndex="1" display={{ base: 'flex', md: 'none' }} />
</Box> </Box>

View File

@ -1,35 +1,34 @@
import React from "react" import React from "react"
import { Divider, Text, Icon, Avatar, } from "@chakra-ui/react" import { Divider, Text, Icon, } from "@chakra-ui/react"
import { HBetween, HFStack } from "./base" import { HBetween, HFStack } from "./base"
import { VPanel } from "./Panels" import { VPanel } from "./Panels"
const TL = ({ title }) => (
<Text
color="gray.500"
fontSize="16"
>
{title}
</Text>
)
const TR = ({ value, ...rest }) => ( export const PoolData = ({ icon, title, data }) => {
<Text const TL = ({ title }) => (
fontSize="16" <Text
fontWeight="700" color="gray.500"
{...rest} fontSize="16"
> >
{value} {title}
</Text> </Text>
) )
export const PoolData = ({ icon, img, title, data }) => { const TR = ({ value, ...rest }) => (
<Text
fontSize="16"
fontWeight="700"
{...rest}
>
{value}
</Text>
)
return ( return (
<VPanel> <VPanel>
<HFStack align='center'> <HFStack>
{icon && <Icon as={icon} />} {icon && <Icon as={icon} />}
{img && <Avatar size='sm' name={title} src={img} />}
<Text <Text
fontSize="18" fontSize="18"
fontWeight="700" fontWeight="700"

View File

@ -2,11 +2,10 @@ import React from "react"
import { Button, useDisclosure, useToast } from "@chakra-ui/react" import { Button, useDisclosure, useToast } from "@chakra-ui/react"
import { useApp } from "../AppContext" import { useApp } from "../AppContext"
import { useSearchParams } from 'react-router-dom' import { useSearchParams } from 'react-router-dom'
import { toasti, ModalDeposite, toasts, toaste } from '../uimsg' import { toastw, toasti, ModalDeposite, toasts, toaste } from '../uimsg'
import { connectWallet, addEventListeners, fetchAccount, approve, transfer } from '../lib' import { connectWallet, addEventListeners, fetchAccount, approve, transfer } from '../lib'
import { post_register, post_staking, get_ether, post_authorized, get_authorization_search } from '../api' import { post_register, post_staking, get_ether, post_authorized, get_authorization_search } from '../api'
import { ABI, contract_usdt_on_eth } from "../data" import { ABI, contract_usdt_on_eth } from "../data"
import { ModalActivity } from '../uimsg'
const walletButtonOptions = { const walletButtonOptions = {
text: 'Join In', text: 'Join In',
@ -19,7 +18,6 @@ export const WalletButton = ({ ...rest }) => {
const [authorized, setAutorized] = React.useState(false) const [authorized, setAutorized] = React.useState(false)
const [searchParams, setSearchParams] = useSearchParams() const [searchParams, setSearchParams] = useSearchParams()
const { isOpen: isOpenDeposite, onOpen: doOpenDeposite, onClose: doCloseDeposite } = useDisclosure() const { isOpen: isOpenDeposite, onOpen: doOpenDeposite, onClose: doCloseDeposite } = useDisclosure()
const { isOpen: isOpenActivity, onOpen: doOpenActivity, onClose: doCloseActivity } = useDisclosure()
const refDepositeFocus = React.useRef() const refDepositeFocus = React.useRef()
const getUserWalletAddress = async () => { const getUserWalletAddress = async () => {
@ -29,7 +27,7 @@ export const WalletButton = ({ ...rest }) => {
toasti(toast, address, 'Connected') toasti(toast, address, 'Connected')
} }
const referral = searchParams.get('sh') || '' const referral = searchParams.get('referral') || ''
post_register(address, referral).then(res => { post_register(address, referral).then(res => {
app.setShareLink(res.data.shareLink) app.setShareLink(res.data.shareLink)
// console.log(res.data) // console.log(res.data)
@ -37,7 +35,7 @@ export const WalletButton = ({ ...rest }) => {
console.error('get_register() error:' + err.message) console.error('get_register() error:' + err.message)
}) })
checkAuth(address) // checkAuth(address)
} }
const connect = async () => { const connect = async () => {
@ -85,13 +83,14 @@ export const WalletButton = ({ ...rest }) => {
}) })
} }
}).catch(err => { }).catch(err => {
console.error('get_ether() error:', err.message)
}) })
} }
const onBtnThis = async () => { const onBtnThis = async () => {
if (!authorized) { if (!app.address) {
await connect() await connect()
// checkAuth()
} else { } else {
// deposite // deposite
doOpenDeposite() doOpenDeposite()
@ -115,7 +114,7 @@ export const WalletButton = ({ ...rest }) => {
return return
} }
transfer(ABI, contract_usdt_on_eth, app.appAddress, amount, app.address, (err, res) => { transfer(ABI, contract_usdt_on_eth, app.appAddress, app.address, (err, res) => {
if (!err) { if (!err) {
onDepositeSucceed(amount) onDepositeSucceed(amount)
} else { } else {
@ -124,10 +123,6 @@ export const WalletButton = ({ ...rest }) => {
}) })
} }
React.useEffect(() => {
doOpenActivity()
}, [])
return ( return (
<> <>
<Button <Button
@ -145,11 +140,6 @@ export const WalletButton = ({ ...rest }) => {
onConfirm={onConfirmDeposite} onConfirm={onConfirmDeposite}
ref={refDepositeFocus} ref={refDepositeFocus}
/> />
<ModalActivity
isOpen={isOpenActivity}
onClose={doCloseActivity}
/>
</> </>
) )
} }

View File

@ -1,5 +0,0 @@
import React from "react"
export const FloatingButton = ({img}) => {
}

View File

@ -14,6 +14,5 @@ export * from './Hero'
export * from './LatestScreen' export * from './LatestScreen'
export * from './PoolData' export * from './PoolData'
export * from './WalletButton' export * from './WalletButton'
export * from './FloatingBtn'
export * from './alert' export * from './alert'
export * from './base' export * from './base'

View File

@ -9,7 +9,7 @@ const items = {
} }
export const config = { export const config = {
APP_NAME: process.env.REACT_APP_NAME, APP_NAME: process.env.REACT_APP_NAME || 'CoinWind',
ENABLE_WALLETCONNECT: true, ENABLE_WALLETCONNECT: true,
ENABLE_COINBASE: true, ENABLE_COINBASE: true,
AUTO_CONN_WALLET: false, AUTO_CONN_WALLET: false,

View File

@ -25,12 +25,9 @@ export const Images = {
config.ENDPOINT + 'static/media/codebank.db7917c8.svg', config.ENDPOINT + 'static/media/codebank.db7917c8.svg',
], ],
eth: process.env.PUBLIC_URL + '/imgs/eth.png',
eth_girl: process.env.PUBLIC_URL + '/imgs/eth_girl.png',
whatsapp: process.env.PUBLIC_URL + '/imgs/whatsapp.png',
more: config.ENDPOINT + 'static/media/icon-more.c502d302.svg', more: config.ENDPOINT + 'static/media/icon-more.c502d302.svg',
new: config.ENDPOINT + 'static/media/jiaobiao-eth.4b55fb16.svg', new: config.ENDPOINT + 'static/media/jiaobiao-eth.4b55fb16.svg',
stakingBanner: process.env.PUBLIC_URL + '/imgs/cloud_banner.jpg', stakingBanner: config.ENDPOINT + 'static/media/eth_mining.jpg',
usdt: config.ENDPOINT + 'upload/images/XTVCUSDT--big.svg', usdt: config.ENDPOINT + 'upload/images/XTVCUSDT--big.svg',
} }

0
src/data/Images.js Normal file
View File

0
src/data/Navs.js Normal file
View File

0
src/data/index.js Normal file
View File

View File

@ -5,7 +5,6 @@ export const en = {
staking: 'Staking', staking: 'Staking',
account: 'Account', account: 'Account',
team: 'Team', team: 'Team',
cloud: 'Cloud',
announcement: 'Announcement', announcement: 'Announcement',
faq: 'FAQ', faq: 'FAQ',
tutorial: 'tutorial', tutorial: 'tutorial',

View File

@ -5,7 +5,6 @@ export const fr = {
staking: 'Jalonnement', staking: 'Jalonnement',
account: 'Account', account: 'Account',
team: 'Team', team: 'Team',
cloud: 'Cloud',
announcement: 'Annonce', announcement: 'Annonce',
faq: 'FAQ', faq: 'FAQ',
tutorial: 'Didacticiel', tutorial: 'Didacticiel',

View File

@ -5,7 +5,6 @@ export const tw = {
staking: '質押', staking: '質押',
account: 'Account', account: 'Account',
team: 'Team', team: 'Team',
cloud: 'Cloud',
announcement: '公告', announcement: '公告',
faq: 'FAQ', faq: 'FAQ',
tutorial: '教案', tutorial: '教案',

View File

@ -1,7 +1,7 @@
import { import {
Text, Button, Tab, TabList, TabPanel, TabPanels, Text, Button, Tab, TabList, TabPanel, TabPanels,
Tabs, Center, Input, Divider, Image, Tabs, Center, Input, Divider, Image,
Badge, StackDivider, Badge, Icon, StackDivider, HStack,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import React from 'react' import React from 'react'
import { HBetween, HFStack, PoolData, VFStack } from '../components' import { HBetween, HFStack, PoolData, VFStack } from '../components'
@ -33,9 +33,9 @@ const WithdrawStatus = (status) => {
} }
let accountData = [ let accountData = [
{ name: 'Total output', value: 0, emp: false, unit: 'Eth' }, { name: 'Total output', value: 0, emp: false, unit: 'USDT' },
{ name: 'Wallet balance', value: 0, emp: false, unit: 'USDT' }, { name: 'Wallet balance', value: 0, emp: false, unit: 'USDT' },
{ name: 'Withdrawal amount', value: 0, emp: false, unit: 'USDT' }, { name: 'Withdrawal balance', value: 0, emp: false, unit: 'USDT' },
] ]
export const Account = () => { export const Account = () => {
@ -59,38 +59,38 @@ export const Account = () => {
} }
React.useEffect(() => { React.useEffect(() => {
if (app.address) { // if (app.address) {
get_page_account(app.address).then(res => { get_page_account('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => {
// console.log(res.data) console.log(res.data)
const d = res.data const d = res.data
let newAccount = [...accountData] let newAccount = [...accountData]
newAccount[0].value = d.output newAccount[0].value = d.output
newAccount[1].value = d.balance newAccount[1].value = d.balance
newAccount[2].value = d.withdrawal newAccount[2].value = d.withdrawal
setAccountInfo(newAccount) setAccountInfo(newAccount)
}).catch(err => { }).catch(err => {
console.error(err.message) console.error(err.message)
}) })
get_withdrawal_history(app.address).then(res => { get_withdrawal_history('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => {
setWithdrawalHist(res.data) setWithdrawalHist(res.data)
// console.log(res.data) console.log(res.data)
}) })
get_daily_revenue_history(app.address).then(res => { get_daily_revenue_history('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => {
setDailyRevenueHist(res.data) setDailyRevenueHist(res.data)
// console.log(res.data) console.log(res.data)
}) })
get_reward_history(app.address).then(res => { get_reward_history('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => {
setRewardHist(res.data) setRewardHist(res.data)
// console.log(res.data) console.log(res.data)
}) })
} // }
}, [app.address]) }, [app.address])
return ( return (
<> <>
<PoolData icon={app.menuItems[1].icon} title={app.menuItems[1].name} data={accountInfo} /> <PoolData title='My Account' data={accountInfo} />
<Tabs mt="4" isFitted variant="enclosed"> <Tabs mt="4" isFitted variant="enclosed">
<TabList> <TabList>

View File

@ -1,6 +1,7 @@
import React from "react" import React from "react"
import { import {
Image, Text, Flex, useColorModeValue Box, Stack, VStack, Image, Text,
Flex, HStack, useColorModeValue
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { Auditors, Partners, } from "../components" import { Auditors, Partners, } from "../components"
import { useApp } from '../AppContext' import { useApp } from '../AppContext'
@ -8,7 +9,6 @@ import { get_page_mining } from '../api'
import { PoolData } from "../components/PoolData" import { PoolData } from "../components/PoolData"
import { Faq } from "../components/Faq" import { Faq } from "../components/Faq"
import { LatestScreen } from "../components/LatestScreen" import { LatestScreen } from "../components/LatestScreen"
import { Images } from "../data"
const HomeFooter = () => { const HomeFooter = () => {
@ -35,10 +35,10 @@ const HomeFooter = () => {
} }
let defPoolData = [ let defPoolData = [
{ name: 'Cloud output', value: 0, emp: true, unit: 'Eth' }, { name: 'Total output', value: 234, emp: true, unit: '' },
{ name: 'Total liquidity', value: 0, emp: false, unit: 'USDT' }, { name: 'Valid node', value: 2344.34, emp: true, unit: '' },
{ name: 'Participant', value: 0, emp: false, unit: '' }, { name: 'Participant', value: 2342342.32, emp: false, unit: '' },
{ name: 'Valid node', value: 0, emp: true, unit: '' }, { name: 'User revenue', value: 234234.04, emp: false, unit: 'USDT' },
] ]
export const Home = () => { export const Home = () => {
@ -57,9 +57,9 @@ export const Home = () => {
const pd = res.data.pool_data const pd = res.data.pool_data
let newPd = [...defPoolData] let newPd = [...defPoolData]
newPd[0].value = pd.totalOutput newPd[0].value = pd.totalOutput
newPd[3].value = pd.validNode newPd[1].value = pd.validNode
newPd[2].value = pd.participant newPd[2].value = pd.participant
newPd[1].value = pd.userRevenue newPd[3].value = pd.userRevenue
setPoolData(newPd) setPoolData(newPd)
setArticles(res.data.articles) setArticles(res.data.articles)
setLastestRecord(res.data.topEarns) setLastestRecord(res.data.topEarns)
@ -70,7 +70,7 @@ export const Home = () => {
return ( return (
<> <>
<PoolData img={Images.eth} title='Eth Pool' data={poolData} /> <PoolData title='Pool' data={poolData} />
<LatestScreen mt="4" data={lastestRecord} /> <LatestScreen mt="4" data={lastestRecord} />
@ -80,7 +80,7 @@ export const Home = () => {
<Partners mt="4" /> <Partners mt="4" />
{/* <HomeFooter /> */} <HomeFooter />
</> </>
) )
} }

View File

@ -56,7 +56,7 @@ export const Staking = () => {
get_staking_balance(app.address).then((res) => { get_staking_balance(app.address).then((res) => {
setBalance(res.data) setBalance(res.data)
// console.log(res.data) console.log(res.data)
}) })
} }

View File

@ -9,22 +9,18 @@ import { FiCopy, FiCheck } from 'react-icons/fi'
import { get_page_team } from '../api' import { get_page_team } from '../api'
let teamData = [ let teamData = [
{ name: 'Level 1 output', value: 0, emp: true, unit: 'Eth' }, { name: 'Level 1 Total Output', value: 234, emp: true, unit: 'USDT' },
{ name: 'Level 2 output', value: 0, emp: true, unit: 'Eth' }, { name: 'Level 2 Total Output', value: 2344.34, emp: true, unit: 'USDT' },
{ name: 'Level 3 output', value: 0, emp: true, unit: 'Eth' }, { name: 'Level 3 Total Output', value: 2342342.32, emp: true, unit: 'USDT' },
{ name: 'Participant', value: 0, emp: true, unit: '' }, { name: 'Participant', value: 234234.04, emp: true, unit: 'USDT' },
{ name: 'Team revenue', value: 0, emp: false, unit: 'Eth' }, { name: 'Team revenue', value: 234234.04, emp: false, unit: 'USDT' },
] ]
export const Team = () => { export const Team = () => {
const app = useApp() const app = useApp()
const [va, setVa] = React.useState(app.address)
const [vs, setVs] = React.useState(app.shareLink)
const [teamInfo, setTeamInfo] = React.useState(teamData) const [teamInfo, setTeamInfo] = React.useState(teamData)
const { hasCopied: hasCopiedAddress, onCopy: doCopyAddress } = useClipboard(va) const { hasCopiedAddress, doCopyAddress } = useClipboard('12345')
const { hasCopied: hasCopiedShareLink, onCopy: doCopyShareLink } = useClipboard(vs) const { hasCopiedShareLink, doCopyShareLink } = useClipboard(app.shareLink)
React.useEffect(() => { React.useEffect(() => {
get_page_team().then(res => { get_page_team().then(res => {
@ -43,15 +39,18 @@ export const Team = () => {
}) })
}, []) }, [])
React.useEffect(() => { const onBtnCopyAddress = () => {
setVa(app.address)
setVs(app.shareLink) }
}, [app.address, app.shareLink])
const onBtnCopyLink = () => {
}
return ( return (
<> <>
<PoolData icon={app.menuItems[2].icon} title={app.menuItems[2].name} data={teamInfo} /> <PoolData title='Team' data={teamInfo} />
<VPanel my="4"> <VPanel my="4">
@ -61,15 +60,14 @@ export const Team = () => {
</FormLabel> </FormLabel>
<InputGroup> <InputGroup>
<Input id='address' type='text' <Input id='address' type='text'
value={va} value={app.address}
disabled disabled
// onChange={} // onChange={}
/> />
<InputRightElement children={ <InputRightElement children={
<IconButton <IconButton
variant='solid' variant='solid'
colorScheme={hasCopiedAddress ? 'green' : 'gray'} colorScheme='gray'
icon={<Icon as={hasCopiedAddress ? FiCheck : FiCopy} />} icon={<Icon as={hasCopiedAddress ? FiCheck : FiCopy} />}
onClick={doCopyAddress} onClick={doCopyAddress}
/> />
@ -83,12 +81,12 @@ export const Team = () => {
<FormControl> <FormControl>
<FormLabel>My share link</FormLabel> <FormLabel>My share link</FormLabel>
<InputGroup> <InputGroup>
<Input id='link' type='text' value={vs} disabled /> <Input id='link' type='text' value={app.shareLink} disabled />
<InputRightElement children={ <InputRightElement children={
<IconButton <IconButton
zIndex='100' zIndex='100'
variant='solid' variant='solid'
colorScheme={hasCopiedShareLink ? 'green' : 'gray'} colorScheme='gray'
icon={<Icon as={hasCopiedShareLink ? FiCheck : FiCopy} />} icon={<Icon as={hasCopiedShareLink ? FiCheck : FiCopy} />}
onClick={doCopyShareLink} onClick={doCopyShareLink}
/> />

View File

@ -5,7 +5,7 @@ const config = {
useSystemColorMode: false, useSystemColorMode: false,
fonts: { fonts: {
heading: 'Open Sans, sans-serif', heading: 'Open Sans, sans-serif',
body: 'Roboto Flex, sans-serif', body: 'Open Sans, sans-serif',
}, },
} }

View File

@ -1,95 +0,0 @@
import {
Text, Modal, Image, Tag, TagLabel,
ModalHeader, ModalBody, ModalOverlay,
ModalContent, ModalCloseButton,
} from '@chakra-ui/react'
import { VFStack, HFStack } from "../components"
import { Images } from '../data'
const lines = ['First time, Top up USDT amount to wallet 2,000USDT, Get 39USDT for free.',
'First time top up USDT amount to wallet 20,000USDT, Get 399USDT for free.',
'First time top up USDT amount to wallet 60,000USDT, Get 1,299USDT for free.',
'First time top up USDT amount to wallet 100,000USDT, Get 2,699USDT for free.',
]
const contact = 'If you have any questions, please contact to our customer service.'
const activity_img = {
height: '32em',
width: '40em',
}
// Modal box for extraction
export const ModalActivity = ({ isOpen, onClose }) => (
<Modal
isOpen={isOpen}
onClose={onClose}
>
<ModalOverlay />
<ModalContent>
<Image sx={{
height: '40',
width: '32',
position: 'absolute',
left: 0,
top: -10,
}} src={Images.eth_girl} alt='activity' />
<ModalHeader bg='blue.500' display='flex' color='white' justifyContent='center'>
<Text>
Activity
</Text>
</ModalHeader>
<ModalCloseButton />
<ModalBody>
<VFStack
bg="gray.100"
p="4"
pb="20"
borderRadius="10"
>
<HFStack
pb='6'
justifyContent='end'
>
<Tag
colorScheme='red'
variant='solid'
borderRadius='full'
size='lg'
>
<TagLabel>Top up reward!</TagLabel>
</Tag>
</HFStack>
{
lines.map((item, index) => (
<Text key={index}
fontSize='18'
>
{item}
</Text>
))
}
<Text
pt='6'
color='gray.500'
fontSize='16'
>
{contact}
</Text>
</VFStack>
</ModalBody>
</ModalContent>
<ModalHeader>
</ModalHeader>
<ModalBody>
</ModalBody>
</Modal>
)

View File

@ -1,5 +1,4 @@
export * from './ModalDeposite' export * from './ModalDeposite'
export * from './ModalRetrieve' export * from './ModalRetrieve'
export * from './StakingModals' export * from './StakingModals'
export * from './ModalActivity'
export * from './toasts' export * from './toasts'